xXMADEXx Posted May 29, 2013 Share Posted May 29, 2013 Hello everyone. I have no idea, why my script isn't working... All the errors will work fine (such as no username/password entered, etc...), but for some reason, the "triggerServerEvent" isn't working. Here it is: Client: function onPlayerSubmitRegister ( ) --if ( source == rButton["register"] ) then local username = guiGetText ( rEdit["username"] ) local password = guiGetText ( rEdit["password"] ) if ( isAllRegFieldsValid ( ) == true ) then if password == guiGetText(rEdit["cPassword"]) then if #password > 3 and #username > 3 then local email = guiGetText ( rEdit["email"] ) if ( string.find ( email, "@" ) ) then triggerServerEvent("onPlayerAttemptRegister",source,username,password) else exports["SRNCore"]:sendClientError(1,"Your email is invalid.") end else exports["SRNCore"]:sendClientError(1,"Your password and username need to be at least 4\ncharacters long.") end else exports["SRNCore"]:sendClientError(1,"Your passwords don't match.") end else exports["SRNCore"]:sendClientError ( 1, "You need to enter all the fields." ) end --end end -- "onClientGUIClick" is defined somewhere else. Server: function onPlayerAttemptRegister ( user, pass ) if ( user ) and ( pass ) then local nAccount = addAccount ( user, pass ) if ( nAccount ) then local nAccount = getAccount ( user ) logIn ( source, nAccount, pass ) exports["SRNCore"]:sendClientError ( 0, "Thank you for registering on the server!" ) triggerClientEvent ( source, "onPlayerCloseLoginScreens", source ) else exports["SRNCore"]:sendClientError ( 1, "Account: "..user.." already exists on this server.") end else exports["SRNCore"]:sendClientError ( 1, "You need to enter a passsword and a username." ) end end addEvent ( "onPlayerAttemptRegister", true ) addEventHandler ( "onPlayerAttemptRegister", root, onPlayerAttemptRegister ) Note: Nothing in the server file will even trigger. Link to comment
Lucario Posted May 29, 2013 Share Posted May 29, 2013 Where is the addEvent adn addEventHandler for onPlayerCloseLoginScreens? if you dont show the full script, we cant help you Link to comment
Castillo Posted May 29, 2013 Share Posted May 29, 2013 triggerServerEvent("onPlayerAttemptRegister",source,username,password) You are using "source", change it with "localPlayer". Link to comment
xXMADEXx Posted May 29, 2013 Author Share Posted May 29, 2013 triggerServerEvent("onPlayerAttemptRegister",source,username,password) You are using "source", change it with "localPlayer". shit i hate client sides Where is the addEvent adn addEventHandler for onPlayerCloseLoginScreens? if you dont show the full script, we cant help you That isn't the whole script. I don't want people taking it. 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