Karuzo Posted February 2, 2014 Share Posted February 2, 2014 Hey Guys, as the title says i have a problem with triggering from client-side to server-side. Client: username = SpielerName password = guiGetText(Register.label[1]) passwordConfirm = guiGetText(Register.label[2]) triggerServerEvent("onRequestRegister",getLocalPlayer(),username,password,passwordConfirm) Server : function registerPlayer(username,password,passwordConfirm) if not (username == "") then if not (password == "") then if not (passwordConfirm == "") then if password == passwordConfirm then local account = getAccount (username,password) if (account == false) then local accountAdded = addAccount(tostring(username),tostring(password)) if (accountAdded) then outputChatBox ("#00FF00Herzlich Willkommen!! [username: #FFFFFF" .. username .. " #00FF00| Passwort: #FFFFFF" .. password .. "#00FF00 ]",source,255,255,255,true ) else outputChatBox("Bitte versuche es wieder mit einem anderen Usernamen und Passwort!!", thePlayer, 255, 0, 0) end else outputChatBox("Dieser Name existiert bereits!!", thePlayer, 255, 0, 0) end else outputChatBox("Die Passwörter stimmen nicht überein!!", thePlayer, 255, 0, 0) end else outputChatBox("Du musst dein Passwort nochmal eingeben!", thePlayer, 255, 0, 0) end else outputChatBox("Du musst dein Passwort eingeben!", thePlayer, 255, 0, 0) end else outputChatBox("Du musst deinen Namen eingeben!", thePlayer, 255, 0, 0) end end addEvent("onRequestRegister",true) addEventHandler("onRequestRegister",getRootElement(),registerPlayer) Link to comment
Castillo Posted February 2, 2014 Share Posted February 2, 2014 And what's the problem? Link to comment
Karuzo Posted February 2, 2014 Author Share Posted February 2, 2014 It says that i trigger serverside onRequestRegister but that the event isn't added serverside. Link to comment
Castillo Posted February 2, 2014 Share Posted February 2, 2014 Any error on the debugscript? is the server side script added to the meta.xml? Link to comment
Karuzo Posted February 2, 2014 Author Share Posted February 2, 2014 Yes it is . The error is as i said : It says that i trigger serverside onRequestRegister but that the event isn't added serverside. Link to comment
Castillo Posted February 2, 2014 Share Posted February 2, 2014 I don't see why that error appears, the server side seems to be just fine. Link to comment
iPrestege Posted February 2, 2014 Share Posted February 2, 2014 Try to change the event name from onRequestRegister to '_onRequestRegister' and try again . 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