SHARE
TWEET

Power Menu v1.0

orayon Jun 1st, 2020 (edited) 599 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <fun>
  3.  
  4. #define ADMIN_FLAG ADMIN_SLAY
  5.  
  6. new bool: isGodmode[33] = false, bool: isGravity[33] = false, bool: isNoclip[33] = false, Prefix[] = "Prefix";
  7.  
  8. public plugin_init() {
  9.     register_plugin("Power menu", "1.0" , "Orayon aka BiBi")
  10.     register_clcmd("say /power", "cmdpower")
  11. }
  12.  
  13. public cmdpower(id)
  14. {
  15.     if (!(get_user_flags(id) & ADMIN_FLAG))
  16.         return client_print(id, print_chat, "^3Error: ^1You have ^3no access ^1to that ^3command")
  17.    
  18.     new format[120], menu;
  19.    
  20.     formatex(format, charsmax(format), "\r[\w%s\r] \wPower \rMenu", Prefix)
  21.     menu = menu_create(format, "pHand")
  22.    
  23.     formatex(format, charsmax(format), "%sble Godmode", (isGodmode[id]) ? "Ena" : "Disa")
  24.     menu_additem(menu, format)
  25.    
  26.     formatex(format, charsmax(format), "%sble Gravity", (isGravity[id]) ? "Ena" : "Disa")
  27.     menu_additem(menu, format)
  28.    
  29.     formatex(format, charsmax(format), "%sble Noclip", (isNoclip[id]) ? "Ena" : "Disa")
  30.     menu_additem(menu, format)
  31.    
  32.     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
  33.     menu_display(id, menu)
  34. }
  35.  
  36. public pHand(id, menu, item)
  37. {
  38.     if (item == MENU_EXIT)
  39.     {
  40.         menu_destroy(menu)
  41.         return;
  42.     }
  43.        
  44.     switch (item)
  45.     {
  46.         case 0:
  47.         {
  48.             isGodmode[id] = !isGodmode[id]
  49.             client_print(id, print_chat, "^3[^1%s^3] Your Godmode is now %sbled", Prefix, (isGodmode[id]) ? "Ena" : "Disa")
  50.            
  51.             if (isGodmode[id])
  52.             {
  53.                 set_user_godmode(id, 1)
  54.             }
  55.             else
  56.             {
  57.                 set_user_godmode(id, 0)
  58.             }
  59.         }
  60.        
  61.         case 1:
  62.         {
  63.             isGravity[id] = !isGravity[id]
  64.             client_print(id, print_chat, "^3[^1%s^3] Your Gravity is now %sbled", Prefix, (isGravity[id]) ? "Ena" : "Disa")
  65.            
  66.             if (isGravity[id])
  67.             {
  68.                 set_user_gravity(id, 0.5)
  69.             }
  70.             else
  71.             {
  72.                 set_user_gravity(id, 1.0)
  73.             }
  74.         }      
  75.         case 2:
  76.         {
  77.             isNoclip[id] = !isNoclip[id]
  78.             client_print(id, print_chat, "^3[^1%s^3] Your Noclip is now %sbled", Prefix, (isNoclip[id]) ? "Ena" : "Disa")
  79.            
  80.             if (isNoclip[id])
  81.             {
  82.                 set_user_noclip(id, 1)
  83.             }
  84.             else
  85.             {
  86.                 set_user_noclip(id, 0)
  87.             }
  88.         }
  89.     }
  90. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top