StefanAlmighty Posted February 19, 2016 Share Posted February 19, 2016 Okay I want a GUI to appear for all players who are logged out once a resource starts. function onAccountsStart() local players = getElementsByType ( "player" ) for theKey, thePlayer in ipairs(players) do if getElementData(thePlayer, "account:logged") == false then triggerClientEvent(thePlayer, "loadLoginPanel", thePlayer) end end end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), onAccountsStart) It loops through all players and if account:logged is false then it triggers a client event. But for some reason, it isn't triggering the event and is not giving off any errors in the console or debugscript. Any help is appreciated. Link to comment
tosfera Posted February 19, 2016 Share Posted February 19, 2016 the server's side looks okay, how's the client's side? And why aren't you doing it on the client's side anyway? Much easier to do and no hussle with weird triggers and such. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now