Advertisement
kd8lvt

Untitled

Apr 17th, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. function login(player)
  2. if player != loginName then
  3. print("[KdLogin] Sorry, but you aren't authorized to login here. Try the Guest account!")
  4. return false
  5. elseif args[] < 2 then
  6. print("[KdLogin] You need two arguments; the playername, and the loginName, you can also change this to a username and password in teh console.")
  7. return false
  8. elseif player == loginName then
  9. print("[KdLogin] Logging in ".. player .." now.")
  10. loggedIn = true
  11. end
  12. end
  13. function setLoginName(name)
  14. loginName = name
  15. return true
  16. end
  17. function isLoggedIn()
  18. if loggedIn then
  19. return true
  20. else
  21. return false
  22. end
  23. end
  24. function logOut()
  25. if loggedIn() then
  26. loggedIn = !loggedIn
  27. print("[KdLogin] Logging out")
  28. return true
  29. else
  30. return false
  31. end
  32. end
  33. function logInGuest()
  34. if loggedIn() == false then
  35. loggedInGuest = true
  36. print("[KdLogin] Logging in the guest account")
  37. return true
  38. else
  39. print("[KdLogin] You need to log out first!")
  40. return false
  41. end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement