Jump to content

[TIPS] Need tips with gui


dex.

Recommended Posts

Using Event Handler, something like this

Client Side

function onGUIStartOpen ()
	triggerServerEvent("onGUIStartOpenServer", localPlayer)
end
addCommandHandler("opengui", onGUIStartOpen)

function openGUIPanel ()
	-- Your code
end
addEvent("openGUIPanel", true)
addEventHandler("openGUIPanel", root, openGUIPanel)

Server Side

function onGUIStartOpenServer ()
	local username = getAccountName(getPlayerAccount(client))
	if isObjectInACLGroup ("user."..username, aclGetGroup ( "Admin" ) ) then
		triggerClientEvent(client, "openGUIPanel", client)	
	end
end
addEvent("onGUIStartOpenServer", true)
addEventHandler("onGUIStartOpenServer", root, onGUIStartOpenServer)

 

Link to comment

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...