Advertisement
Guest User

uRegister

a guest
Oct 16th, 2019
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. event onLoad(){
  2. database.execute("CREATE TABLE IF NOT EXISTS uRegister(
  3. steamid VARCHAR(17) PRIMARY KEY,
  4. email VARCHAR(255) NOT NULL DEFAULT 0,
  5. password VARCHAR(255) NOT NULL DEFAULT 0
  6. );");
  7. }
  8. command uregister(email, password){
  9. permission = "uRegister";
  10. execute(){
  11. if(isSet(email) and isSet(password)){
  12. DBcheck = database.execute("SELECT * FROM uRegister WHERE steamid = '" + player.id + "';");
  13. DBcheck = DBcheck[0];
  14. if(DBcheck.count != 1){
  15. database.execute("INSERT INTO uRegister (steamid, email, password) VALUES ('" + player.id + "', '" + email + "', '" + password + "');");
  16. player.message("Registration Complete!");
  17. player.release();
  18. player.speed = 1;
  19. player.god = false;
  20. player.vanish = false;
  21. }
  22. else{
  23. player.message("You have already registered!");
  24. }
  25. }
  26. else{
  27. player.message("Usage: /uregister EMAIL PASSWORD");
  28. }
  29. }
  30. }
  31. command ulogin(password){
  32. permission = "uRegister";
  33. execute(){
  34. DBcheck = database.execute("SELECT * FROM uRegister WHERE steamid = '" + player.id + "';");
  35. DBcheck = DBcheck[0];
  36. if(DBcheck.count != 0){
  37. if(toString(DBcheck[2]) == toString(password)){
  38. player.message("Password Correct!");
  39. player.release();
  40. player.speed = 1;
  41. player.god = false;
  42. player.vanish = false;
  43. }
  44. else{
  45. player.message("Incorrect Password");
  46. }
  47. }
  48. else{
  49. player.message("Register First Using /uregister EMAIL PASSWORD");
  50. }
  51. }
  52. }
  53.  
  54. event onPlayerJoined(player){
  55. DBcheck = database.execute("SELECT * FROM uRegister WHERE steamid = '" + player.id + "';");
  56. DBcheck = DBcheck[0];
  57. if(DBcheck.count != 0){
  58. player.message("Please Login Using /uLogin password");
  59. player.arrest();
  60. player.speed = 0;
  61. player.god = true;
  62. player.vanish = true;
  63. }
  64. else{
  65. player.message("Please Register Your Account Using /uRegister EMAIL PASSWORD");
  66. player.arrest();
  67. player.speed = 0;
  68. player.god = true;
  69. player.vanish = true;
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement