Advertisement
AutismAlex

Working Admin Mode

Dec 5th, 2019
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. am = array();
  2. AdminKit = "admin"; //Here set the name of the admin kit.
  3.  
  4. //Translations:
  5. adminmode_on = "You now are in admin mode";
  6. adminmode_off = "You desactive the admin mode";
  7.  
  8. command adminmode(){
  9. permission = "admin";
  10. execute(){
  11. pia = 0;
  12. foreach(val in am){
  13. if(val == player.id){
  14. pia = 1;
  15. am.remove(val);
  16. }
  17. }
  18. if(pia == 0){
  19. player.god = true;
  20. player.sudo("/kit " + AdminKit);
  21. player.message(adminmode_on);
  22. am.add(player.id);
  23. }
  24. else {
  25. player.god = false;
  26. server.execute("ci " + player.name);
  27. player.message(adminmode_off);
  28. }
  29. }
  30. }
  31.  
  32. event onPlayerGestured(player, gesture){
  33. pia = 0;
  34. foreach(val in am){
  35. if(val==player.id){
  36. pia = 1;
  37. }
  38. }
  39. if(gesture == "PunchLeft" or gesture == "PunchRight"){
  40. if(pia == 1){
  41. looking = player.look.getBarricade();
  42. if(isSet(looking) == false){
  43. return;
  44. }
  45. if(looking.hasDoor() == true){
  46. dr = looking.getDoor();
  47. if(dr.isOpen == true){
  48. dr.close();
  49. }
  50. else {
  51. dr.open();
  52. }
  53. }
  54. else if(looking.hasStorage()){
  55. se = looking.getStorage();
  56. se.open(player);
  57. }
  58. }
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement