Advertisement
CheezPuff

ViewCD Settings Menu | go ahead

Feb 25th, 2017
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.47 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4.  
  5. #define PLUGIN "Settings Menu ViewCD" // i know it useful/HardCode i just made it for fun.
  6. #define VERSION "1.0b"
  7. #define AUTHOR "CheezPuff"
  8.  
  9. new Laser[ 33 ], Sounds[ 33 ], Beacon[ 33 ];
  10.  
  11. public plugin_init() {
  12.     register_plugin(PLUGIN, VERSION, AUTHOR)
  13.    
  14.     register_clcmd( "say /menu", "MenuSettings");
  15.    
  16.     register_clcmd( "chooseteam", "MenuSettings");
  17. }
  18.  
  19. public client_putinserver( Index )
  20. {
  21.     Sounds[ Index ] = 1;
  22.     Laser[ Index ] = 1;
  23.     Beacon[ Index ] = 1;
  24. }
  25.  
  26. public MenuSettings( Index )
  27. {
  28.     new szMenu[ 64 ];
  29.    
  30.     formatex( szMenu, charsmax( szMenu ), "\r[\wViewCD HitAndRun\r] \wSettings Main Menu" );
  31.    
  32.     new Menu = menu_create( szMenu, "Menu_Sub" );
  33.    
  34.     formatex(szMenu, charsmax(szMenu), "\ySounds\w: %s", Sounds[ Index ] ? "\rEnable" : "\dDisabled" );
  35.     menu_additem( Menu, szMenu);
  36.    
  37.     formatex(szMenu, charsmax(szMenu), "\yLaser Shot\w: %s", Laser[ Index ] ? "\rEnable" : "\dDisabled" );
  38.     menu_additem( Menu, szMenu);
  39.    
  40.     formatex(szMenu, charsmax(szMenu), "\yBeacon\w: %s", Beacon[ Index ] ? "\rEnable" : "\dDisabled" );
  41.     menu_additem( Menu, szMenu);
  42.    
  43.     menu_display(Index, Menu);
  44.     return PLUGIN_HANDLED;
  45. }
  46.  
  47. public Menu_Sub(Index, Menu, Item)
  48. {      
  49.     menu_destroy( Menu );
  50.    
  51.     if (Item == MENU_EXIT)
  52.         return;
  53.        
  54.     switch(Item)
  55.     {
  56.         case 0: Sounds[Index] = !Sounds[Index];
  57.         case 1: Laser[Index] = !Laser[Index];
  58.         case 2: Beacon[Index] = !Beacon[Index];
  59.     }
  60.    
  61.     MenuSettings( Index );
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement