LonelyRoad Posted August 23, 2013 Share Posted August 23, 2013 I am trying to make a login system, but when the player first connects to the server and downloads all the resources - it seems to be the case that either this doesn't work at all, or goes too quickly and nothing happens on the client: function showLogin() triggerClientEvent(source, "showLoginWindow", source) end addEventHandler("onPlayerJoin", getRootElement(), showLogin) Here is the client of the event: showLoginWindow function playerConnect() showPlayerHudComponent("all", false) setAmbientSoundEnabled( "gunfire", false ) clearChat() setElementDimension(getLocalPlayer(), 9999) setElementInterior(getLocalPlayer(), 0) setCameraMatrix( 2149.0729980469, 1901.8781738281, 15, 1381.1181640625, 1904.9548339844, 200) fadeCamera(true) connect_openLoginWindow() end addEvent("showLoginWindow", true) addEventHandler("showLoginWindow", getRootElement(), playerConnect) And connect_openLoginWindow() is supposed to be the thing that actually draws the login GUI - I am not sure at what step it fails, but if the player reconnects everything functions as it should do (ie. all the functions get called and the GUI shows up as anticipated). Any ideas please? Link to comment
ixjf Posted August 23, 2013 Share Posted August 23, 2013 This is never going to work because client scripts are most likely still being downloaded when the client event is called, which at that time is absent. Link to comment
fmj02 Posted August 23, 2013 Share Posted August 23, 2013 So in this case you should consider using OnClientResourceStart 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