Jump to content
  • 0

Load Browser In Game


nurfaizfy19

Question

Hello MTA, sorry if my English is bad

I'm looking for a way to load a website in the game, for example a website that I have forums.javaliferoleplay.web.id

I have a code like this

function register_panel( )
	local screenWidth, screenHeight = guiGetScreenSize()
	local windowWidth, windowHeight = 1280, 720
	local left = screenWidth/2 - windowWidth/2
	local top = screenHeight/2 - windowHeight/2
	local window = guiCreateWindow( left, top, windowWidth, windowHeight , "Register", false )
	local browser = guiCreateBrowser( 0, 28, windowWidth, windowHeight -60, false, false, false, window )
	local theBrowser = guiGetBrowser( browser )
	guiWindowSetSizable(window, false)
	requestBrowserDomains({ "forums.javaliferoleplay.web.id" })
	addEventHandler( "onClientBrowserCreated", theBrowser, 
		function( )
			loadBrowserURL( source, "http://forums.javaliferoleplay.web.id/" )
		end
	)
	local close = guiCreateButton(0, 700, 1280, 50, "CLOSE", false, window)
	addEventHandler ( "onClientGUIClick", close, 
		function()
			guiSetVisible(window, false)
		end
	)
end

 

In the code above, the website I intended to load does not appear, but there is a dialog box asking for permission to open the link. But when opening youtube for example, the website opens normally. Can someone help me? Thanks before

Edited by nurfaizfy19
Link to comment

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...