Jump to content

Search the Community

Showing results for tags 'onclientbrowserdocumentready'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Member Title





Found 1 result

  1. Hello I have an issue when I trigger an event that call a function using onClientBrowserDocumentReady, i don't know what is the issue... This is my code: The issue is... onClientBrowserDocumentReady doesn't found the browser and it can't in into the event. the executeBrowserJavascript doesn't work event = {add = addEventHandler, load = addEvent, execute = triggerServerEvent} local WINDOW_WIDTH, WINDOW_HEIGHT = guiGetScreenSize() local CEF = nil local browser = nil function deleteWebPage() if isElement(CEF) then destroyElement(CEF) showCursor(false) end end function createWebPage() page = "http://mta/player/html/login.html" CEF = guiCreateBrowser(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, true, false, false) browser = guiGetBrowser(CEF) addEventHandler("onClientBrowserCreated", browser, function() loadBrowserURL(source, page) showCursor(true) end) end function sendErrorLabel(error) addEventHandler("onClientBrowserDocumentReady", browser, function() executeBrowserJavascript(browser, "document.querySelector('.error:nth-child(5)').innerHTML = '" .. error .. "'"); executeBrowserJavascript(browser, "document.querySelector('.error:nth-child(5)').style = 'display: initial; top: 90%; left:40.5%'"); end) end event.load('login-data:send', true) event.add('login-data:send', root, function(user, password) event.execute('login-menu:execute', resourceRoot, user, password) end, true) event.load("onClientPlayerLogout", true) event.add("onClientPlayerLogout", root, function() createWebPage() end) event.load("show-label:error", true) event.add("show-label:error", root, function(error) sendErrorLabel(error) end) event.load('login-menu:remove', true) event.add('login-menu:remove', root, function() deleteWebPage() end) event.add("onClientResourceStart", resourceRoot, function() createWebPage() end)
  • Create New...