Guest User

Untitled

a guest
Oct 18th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. function loginPlayer(Username, Password)
  2. if getAccount(Username, Password) then
  3. logIn(source, getAccount(Username), Password)
  4. outputChatBox("You successfully logged in.", source, 0, 255, 0)
  5. triggerClientEvent(source, "menuGui", source, false)
  6. -- showCursor(source, false)
  7. -- setCameraTarget(source)
  8.  
  9. setCameraMatrix(source, -688.05273, 937.66650, 13.6328, -688.05273, 933.66650, 13.6328, 0, 0)
  10.  
  11.  
  12. else
  13. outputChatBox("Invalid username or password!", source, 255, 0, 0)
  14. end
  15. end
  16. addEvent("logPlayer", true)
  17. addEventHandler("logPlayer", getRootElement(), loginPlayer)
  18.  
  19. function registerPlayer(Username, Password)
  20. if not getAccount(Username, Password) then
  21. addAccount(Username, Password)
  22. outputChatBox("Successfully registered. You can now log in.", source, 255, 255, 0)
  23. else
  24. outputChatBox("Name already in use.", source, 255, 0, 0)
  25. end
  26. end
  27. addEvent("regPlayer", true)
  28. addEventHandler("regPlayer", getRootElement(), registerPlayer)
  29.  
  30. --spawnPlayer(source, -2335.53003, 2300.24341, 4.98438, 270, math.random(290,310))
  31.  
  32.  
  33. function dumpCharacterData(Caccount,Cname,Cgender,Crace,Cday,Cmonth,Cyear,Cheight,Cweight,Ceye,Chair,Cskin)
  34. outputChatBox("Character was successfully created.", getPlayerFromName(tostring(AccountName)), 0,255,0)
  35. outputChatBox(Cname .. Cgender .. Cday)
  36. executeSQLUpdate("charactersDescribtion","account='"Caccount"',name='"Cname"',gender='"Cgender"',bornday='"Cday"',bornmonth='"Cmonth',bornyear='"Cyear"',race='"Crace"',height='"Cheight"', weight='"Cweight"',eyecolor='"Ceye"',haircolor='"Chair"',skinid='"Cskin"'")
  37. end
  38. addEvent("characterDataInfo", true)
  39. addEventHandler("characterDataInfo", getRootElement(), dumpCharacterData)
Add Comment
Please, Sign In to add comment