• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Skream

  • Rank
  1. setBlurLevel not working

    I gotta the following code addEventHandler('onClientBrowserCreated', cefBrowser, function() loadBrowserURL(cefBrowser, loginConfig['url']) showCursor(true) fadeCamera(true) setBlurLevel(128) end ) everything else works alright but my screen doesn't blur
  2. fromJSON

    already fixed it thanks
  3. CEF and ACL

    I'm trying to run my login in lua but all I get is a black screen so I wonder to know if I have to do anything on ACL mod just in case this is my LUA code -- rio-login config loginConfig = { ['url'] = 'http://mta/rio-login/html/login.html' } screenW, screenH = guiGetScreenSize() cefBrowser = guiGetBrowser(guiCreateBrowser(0, 0, screenW, screenH, true, true)) addEventHandler('onClientBrowserCreated', cefBrowser, function() loadBrowserURL(cefBrowser, loginConfig['url']) showCursor(true) fadeCamera(false) end ) addEventHandler('rio_onClientLogin', root, function() setBrowserRenderingPaused(cefBrowser, true) guiSetVisible(cefBrowser, false) end ) addEvent('rio_onClientAttemptLogin', true) addEventHandler('rio_onClientAttemptLogin', root, function(username, password) triggerServerEvent('tryLogin' root, username, password) end ) addEvent('rio_onClientAttemptRegister', true) addEventHandler('rio_onClientAttemptRegister', root, function(username, email, password) triggerServerEvent('tryRegister' root, username, email, password) end )
  4. setBrowserRenderingPaused

    I think its not that simple because I use insertAdjacentHTML too much. What about function clearChat() { var resetHtml = "<div class='container'>" + "<div id='text-chat' class='chat'></div>" + "<input id='chat-input' type='text' placeholder='Fale por aqui...' spellcheck='false'>" "</div>"; document.body.innerHTML = resetHtml; } do you have any ideia if I would need to call addEventListener again? Because I use focusout check onload window.onload = function() { const chatInput = document.getElementById('chat-input'); chatInput.addEventListener('focusout', function(e) { = 'hide .2s'; = 'forwards'; mta.triggerEvent('processChat', ''); document.removeEventListener('keydown', enterKeyInputBox, false); }); };
  5. setBrowserRenderingPaused

    I'm doing a CEF chat But I need a clearChat function to anti divulgation propouses do you think this would do the job ? function clearChatBox() loadBrowserURL(cefBrowser, chatUrl) end like a attempt to "reload" the url?
  6. setBrowserRenderingPaused

    setBrowserRenderingPaused hidde the browser? How can I destroy the browser?
  7. Is there any better version of object preview? I want to print all skins (I have custom ones) but some of then doesn't render well. I'm using this resource this is my lua code based on wiki -- -- c_main.lua -- local scx, scy = guiGetScreenSize () local myObject,myElement, guiWindow = nil, nil, nil local myRotation = {0,0,180} local mySkin = 0 addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource()), function() outputChatBox('Use num keys to rotate the object') local x1, y1, z1 = getCameraMatrix() myElement = createPed(mySkin, 1760.5491, -1950.9703, 14.1096) myObject = exports.object_preview:createObjectPreview(myElement,0,0,180,1,1,1,1,true,false,true) guiWindow = guiCreateWindow(0, 0,400,400,"Test area",false,false) guiSetAlpha(guiWindow, 0.05 + 0.2) local projPosX, projPosY = guiGetPosition(guiWindow,true) local projSizeX, projSizeY = guiGetSize(guiWindow, true) bindKey ( "p", "down", function() for i = mySkin + 1, 312 do if isValidSkin(i) == 1 then mySkin = i setElementModel(myElement, mySkin) break end end end ) bindKey ( "i", "down", function() setElementModel(myElement, mySkin) end ) bindKey ( "o", "down", function() exports.object_preview:saveRTToFile(myObject, "skins/"..mySkin..".png") end) end) addEventHandler("onClientRender", root, function() if myObject then local projPosX, projPosY = guiGetPosition(guiWindow,true) local projSizeX, projSizeY = guiGetSize(guiWindow, true) exports.object_preview:setRotation(myObject,myRotation[1], myRotation[2], myRotation[3]) exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY, true, true) end end) addEventHandler("onClientResourceStop", getResourceRootElement( getThisResource()), function() exports.object_preview:destroyObjectPreview(myObject) end ) function isValidSkin( specifiedSkin ) -- Define the function local result = false -- Define result, it is currently false if ( specifiedSkin ) then -- If skin specified local allSkins = getValidPedModels ( ) -- Get valid skin IDs for key, skin in ipairs( allSkins ) do -- Check all skins if skin == tonumber( specifiedSkin ) then -- If skin equals specified one, it is valid result = 1 -- So set it as result break --stop looping through a table after we found the skin end end end return result end
  8. CEF - audio

    mp3/sounds in CEF <audio id="intro" controls autoplay loop hidden=true> <source src="sounds/intro.mp3" type="audio/mpeg"> </audio> nothing happens in-game. It works pretty well if I open it in my browser but I get nothing ingame I tried to play it with JS but still nothing happens screenW, screenH = guiGetScreenSize() webBrowser = guiCreateBrowser(0, 0, screenW, screenH, true, true, false) theBrowser = guiGetBrowser(webBrowser) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(theBrowser, "http://mta/rio-login/index.html") setBrowserVolume(theBrowser, 1); showCursor(true) fadeCamera(false) showChat(false) end ) this is my lua code and everything works alright except playing sounds. nothing happens with setBrowserVolume either I know I can play the intro ingame k no problem about that but how can it would be hard to call a mta.trigger everytime I need to use a sound for hover or click
  9. fetchRemote - Empty formfields

  10. fetchRemote - Empty formfields

    I get a attempt to my php server but the formfields are empty there postData = { queueName = "só de borest", connectionAttempts = 3, connectTimeout = 5000, formFields = { login_username = "kitgay", login_password = "naminhaescolanao", login_email = "", }, } fetchRemote("myurl", postData, function(data, info) outputDebugString( "wiki based attempt" .. " success:" .. tostring(info.success) .. " statusCode:" .. tostring(info.statusCode) .. " data:" .. tostring(data) ) end ) xml is <min_mta_version server="1.5.4-9.11413" client="1.3.2" />
  11. Whats wrong with it

    still not working its like the resource never started and yes it is getting download and my xml look ok. I just have that resource and my mysql connection
  12. Whats wrong with it

    I'm trying to do a login but when I connect I just get black screen local screenWidth, screenHeight = guiGetScreenSize() addEventHandler("onClientResourceStart", localPlayer, function() loginGUI.background = guiCreateStaticImage(0, 0, 1920, 1200, "background.png", false) loginGUI.font = guiCreateFont("Roboto-Thin.ttf", 10) loginGUI.windowLogin = guiCreateStaticImage((screenWidth - 238) / 2, (screenHeight - 184) / 2, 238, 184, "images/login.png", false) loginGUI.loginUsername = guiCreateEdit(15, 30, 238, 36, "Usuário ou E-mail", false, loginGUI.windowLogin) loginGUI.loginPassword = guiCreateEdit(15, 69, 238, 36, "Senha", false, loginGUI.windowLogin) guiEditSetMaxLength(loginGUI.loginUsername, 64) guiEditSetMaxLength(loginGUI.loginPassword, 32) guiEditSetMasked(loginGUI.loginPassword, true) guiSetFont(loginGUI.loginUsername, loginGUI.font) guiSetFont(loginGUI.loginPassword, loginGUI.font) guiLabelSetHorizontalAlign(loginGUI.loginUsername, "right") guiLabelSetHorizontalAlign(loginGUI.loginPassword, "right") loginGUI.windowReg = guiCreateStaticImage((screenWidth - 238) / 2, (screenHeight - 223) / 2, 0, 0, 238, 223, "images/register.png", false) loginGUI.regUsername = guiCreateEdit(15, 30, 238, 36, "Usuário", false, loginGUI.windowReg) loginGUI.regPassword = guiCreateEdit(15, 69, 238, 36, "Senha", false, loginGUI.windowReg) loginGUI.regEmail = guiCreateEdit(15, 108, 238, 36, "E-mail", false, loginGUI.windowReg) guiEditSetMaxLength(loginGUI.regUsername, 22) guiEditSetMaxLength(loginGUI.regPassword, 32) guiEditSetMaxLength(loginGUI.regEmail, 64) guiEditSetMasked(loginGUI.regPassword, true) guiSetFont(loginGUI.regUsername, loginGUI.font) guiSetFont(loginGUI.regPassword, loginGUI.font) guiSetFont(loginGUI.regEmail, loginGUI.font) guiLabelSetHorizontalAlign(loginGUI.regUsername, "right") guiLabelSetHorizontalAlign(loginGUI.regPassword, "right") guiLabelSetHorizontalAlign(loginGUI.regEmail, "right") showLogin() introMusic = playSound("sounds/intro.mp3", true) setSoundVolume(soundIntro, 0.7) triggerEvent("onAccountRegister", hideEverything()) triggerEvent("onAccountLogin", hideEverything()) end ) function showLogin() guiSetVisible(loginGUI.background, true) guiSetVisible(loginGUI.windowLogin, true) guiSetVisible(loginGUI.windowReg, false) showChat(false) showCursor(true) end