nurfaizfy19

Load Browser In Game

Recommended Posts

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

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.