Advertisement
Guest User

Untitled

a guest
Jul 5th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. function LoginScreen_Register()
  2. local username = guiGetText(tUsername)
  3. local password = guiGetText(tPassword)
  4. if (string.len(username)<3) then
  5. LoginScreen_showWarningMessage("Your username must be a minimum of 3 characters!")
  6. elseif (string.find(username, ";", 0)) or (string.find(username, "'", 0)) or (string.find(username, "@", 0)) or (string.find(username, ",", 0)) or (string.find(username, " ", 0)) then
  7. LoginScreen_showWarningMessage("Your username cannot contain ;,@.' or space!")
  8. elseif (string.len(password)<6) then
  9. LoginScreen_showWarningMessage("Your password is too short. \n You must enter 6 or more characters.", 255, 0, 0)
  10. elseif (string.len(password)>=30) then
  11. LoginScreen_showWarningMessage("Your password is too long. \n You must enter less than 30 characters.", 255, 0, 0)
  12. elseif (string.find(password, ";", 0)) or (string.find(password, "'", 0)) or (string.find(password, "@", 0)) or (string.find(password, ",", 0)) then
  13. LoginScreen_showWarningMessage("Your password cannot contain ;,@'.", 255, 0, 0)
  14. else
  15. showChat(false)
  16. triggerServerEvent("accounts:register:attempt", getLocalPlayer(), username, password)
  17. end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement