Fujikatoma Posted September 6, 2014 Share Posted September 6, 2014 Hello, i got the error shown in the title with the following code : Server: (onPlayerjoin) triggerClientEvent(source, "onCreateLoginWindow", source) -- Event Triggern Client function createLoginWindow() loginGUI = {} showCursor(true) guiSetInputEnabled(true) loginGUI.window = guiCreateWindow(623, 328, 367, 161, "Login", false) guiWindowSetSizable(loginGUI.window, false) guiWindowSetMovable(loginGUI.window, false) loginGUI.label = guiCreateLabel(41, 35, 280, 15, "Es exestiert bereits ein Account mit dem Namen", false, loginGUI.window) loginGUI.btnLogin = guiCreateButton(41, 102, 280, 31, "Login", false, loginGUI.window) loginGUI.edtPassword = guiCreateEdit(40, 64, 281, 23, "", false, loginGUI.window) addEventHandler("onClientGUIClick", loginGUI.btnLogin, function(button, state) if button == "left" and state == "up" then local password = guiGetText(loginGUI.edtPassword) if password then triggerServerEvent("submitLogin", getRootElement(), password) else outputChatBox("Please enter your password.") end end end , false) end addEvent( "onCreateLoginWindow", true ) addEventHandler( "onCreateLoginWindow", localPlayer, createLoginWindow) Does someone has an idear how to fixx that error ? Link to comment
MIKI785 Posted September 6, 2014 Share Posted September 6, 2014 Youre using it in onPlayerJoin... resource didn't start on client side yet, why would you use that event anyway? Just use onClientResourceStart... Link to comment
Fujikatoma Posted September 6, 2014 Author Share Posted September 6, 2014 onClientResourceStart isn't the right choice , because it's not called every time the user joins Link to comment
Olle Risk Posted September 6, 2014 Share Posted September 6, 2014 onClientResourceStart isn't the right choice , because it's not called every time the user joinsYes it is, "onClientResourceStart" is triggered for a individual player, more correctly the player who just joined as soon the client side files are downloaded. "onPlayerJoin" triggers for all players on the server when a new player joins.I think the event you are looking for here is "onClientPlayerJoin" which is triggered for all players except the player who just joined as soon the client resources are downloaded. Try to be more specific about what you want to do and then look for a proper event to use. Link to comment
Fujikatoma Posted September 8, 2014 Author Share Posted September 8, 2014 After the Client is connected , a mysql query is excecuted and checks if the user exists. If no the rigister GUI will be displayed, if there is an account with his name the login GUI is displayed. 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