From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This function gets the rendering state of a browser element.


bool isBrowserRenderingPaused ( browser webBrowser )

OOP Syntax Help! I don't understand this!

Method: browser:isRenderingPaused(...)
Variable: .renderingPaused
Counterpart: setBrowserRenderingPaused

Required Arguments


Returns true if the browser rendering is paused, false otherwise.


This will create a browser element and a command to pause the browser rendering:

-- In order to render the browser on the full screen, we need to know the dimensions.
local screenWidth, screenHeight = guiGetScreenSize ()
-- Let's create a new browser in remote mode.
local window = guiCreateWindow (0, 0, screenWidth, screenHeight, "Webbrowser", false)
local browser = guiCreateBrowser (0, 0, 800, 600, false, false, false, window)
-- The event onClientBrowserCreated will be triggered, after the browser has been initialized.
-- After this event has been triggered, we will be able to load our URL
local theBrowser = guiGetBrowser (browser) -- Get the browser element from gui-browser
addEventHandler ("onClientBrowserCreated", theBrowser, 
    function ()
		-- After the browser has been initialized, we can load
		loadBrowserURL (source, "")

addCommandHandler ("pause", -- Add a command named 'pause'
  function (player, commandName)
      if isBrowserRenderingPaused (theBrowser) then
          setBrowserRenderingPaused (theBrowser, false)
          setBrowserRenderingPaused (theBrowser, true)


Minimum server version n/a
Minimum client version 1.5.8-9.20806

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.5.8-9.20806" />

See also