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

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({ "" })
	addEventHandler( "onClientBrowserCreated", theBrowser, 
		function( )
			loadBrowserURL( source, "" )
	local close = guiCreateButton(0, 700, 1280, 50, "CLOSE", false, window)
	addEventHandler ( "onClientGUIClick", close, 
			guiSetVisible(window, false)


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

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.