1LoL1 Posted February 21, 2016 Share Posted February 21, 2016 (edited) Hello, i created Register system but i have here 1 error and i don't know how to fix. Can anyone please help me? When i registered account with user "TEST" and password "TEST" it's works but when i again want registered new account with user "test" and paswrod "TEST" it's say account was registered but it's not addEvent("Register",true) addEventHandler("Register",getRootElement(), function (user,pass) if user ~= "" then if pass ~= "" then if (string.len(pass) >= 4) then local account = getAccount(user,pass) if (account) then outputChatBox("[!] Account: '"..user.."' exists [!]", source, 255, 0, 0, true) else addAccount(user,pass) outputChatBox("[!] Account: '"..user.."' | Password: '"..pass.."' [!]", source, 255, 0, 0, true) end else outputChatBox("[!] Your password must be at least 4 characters long [!]", source, 255, 0, 0, true) end else outputChatBox("[!] Password can not be blank [!]", source, 255, 0, 0, true) end else outputChatBox("[!] Login can not be blank [!]", source, 255, 0, 0, true) end end) Edited February 22, 2016 by Guest Link to comment
Simple0x47 Posted February 21, 2016 Share Posted February 21, 2016 Could you show the script until outputChatBox with the message you've been registered successfully? Link to comment
1LoL1 Posted February 21, 2016 Author Share Posted February 21, 2016 Could you show the script until outputChatBox with the message you've been registered successfully? There where is addAccount. Link to comment
Simple0x47 Posted February 21, 2016 Share Posted February 21, 2016 Try this: addEvent("Register",true) addEventHandler("Register",getRootElement(), function (user,pass) if user ~= "" then if pass ~= "" then if (string.len(pass) >= 4) then local account = getAccount(user,pass) if (account) then outputChatBox("[!] Account: '"..user.."' exists [!]", source, 255, 0, 0, true) else if addAccount( user, pass) then outputChatBox("[!] Account: '"..user.."' | Password: '"..pass.."' [!]", source, 255, 0, 0, true) else outputChatBox("[!] Account cannot be registered [!]", source, 255, 0, 0) end else outputChatBox("[!] Your password must be at least 4 characters long [!]", source, 255, 0, 0, true) end else outputChatBox("[!] Password can not be blank [!]", source, 255, 0, 0, true) end else outputChatBox("[!] Login can not be blank [!]", source, 255, 0, 0, true) end end) Link to comment
1LoL1 Posted February 21, 2016 Author Share Posted February 21, 2016 Try this: addEvent("Register",true) addEventHandler("Register",getRootElement(), function (user,pass) if user ~= "" then if pass ~= "" then if (string.len(pass) >= 4) then local account = getAccount(user,pass) if (account) then outputChatBox("[!] Account: '"..user.."' exists [!]", source, 255, 0, 0, true) else if addAccount( user, pass) then outputChatBox("[!] Account: '"..user.."' | Password: '"..pass.."' [!]", source, 255, 0, 0, true) else outputChatBox("[!] Account cannot be registered [!]", source, 255, 0, 0) end else outputChatBox("[!] Your password must be at least 4 characters long [!]", source, 255, 0, 0, true) end else outputChatBox("[!] Password can not be blank [!]", source, 255, 0, 0, true) end else outputChatBox("[!] Login can not be blank [!]", source, 255, 0, 0, true) end end) This i don't must test i see this wrong. I mean i created account "TEST" password "TEST" if i created new account "test" with password "TEST" i see outputChatBox account is created but when i want log in it say account don't exists. Link to comment
Dimos7 Posted February 21, 2016 Share Posted February 21, 2016 can you show the client side please Link to comment
1LoL1 Posted February 21, 2016 Author Share Posted February 21, 2016 can you show the client side please Why client? Link to comment
1LoL1 Posted February 22, 2016 Author Share Posted February 22, 2016 Please can anyone help me? Link to comment
Bonus Posted February 22, 2016 Share Posted February 22, 2016 Seems like login is case sensitive, addAccount not. Thats good, I don't want accounts Bonus, bonus, bonuS etc. Link to comment
tosfera Posted February 22, 2016 Share Posted February 22, 2016 Seems like login is case sensitive, addAccount not.Thats good, I don't want accounts Bonus, bonus, bonuS etc. That's true as far as I've used the default account system. I would suggest you to transfer all the characters from the usernames to lowercase to avoid people with weird account names. This'll also fix the; I can create several accounts, but not login with them since they don't exist. Link to comment
1LoL1 Posted February 22, 2016 Author Share Posted February 22, 2016 Seems like login is case sensitive, addAccount not.Thats good, I don't want accounts Bonus, bonus, bonuS etc. That's true as far as I've used the default account system. I would suggest you to transfer all the characters from the usernames to lowercase to avoid people with weird account names. This'll also fix the; I can create several accounts, but not login with them since they don't exist. So how i can fix please? Link to comment
GTX Posted February 22, 2016 Share Posted February 22, 2016 Use addAccount(username, password, true) to allow case variations. However, I think you can't create account "test" because it's reserved. Link to comment
1LoL1 Posted February 22, 2016 Author Share Posted February 22, 2016 ok Thanks i fixed by me. 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