Advertisement
iFenomenal

Untitled

Jan 24th, 2019
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.54 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <fun>
  4. #include <hamsandwich>
  5.  
  6. #define PLUGIN "Menu Gold&Silver"
  7. #define VERSION "1.0"
  8. #define AUTHOR "iF .!."
  9.  
  10. #define ADMIN_GOLD read_flags("t")
  11. #define ADMIN_SILVER read_flags("r")
  12.  
  13. new bool:g_iRunda[ 33 ], bool:g_iRound[ 33 ];
  14.  
  15. new const GoldTag[] = "[!gGold!teamVip!y]"
  16. new const SilverTag[] = "[!gSilver!teamVip!y]"
  17.  
  18. public plugin_init () {
  19.    
  20.     register_plugin ("PLUGIN", "VERSION", "AUTHOR");
  21.     register_clcmd ("say /vipgold","Gold");
  22.     register_clcmd ("say /vipsilver","Silver");
  23.     RegisterHam(Ham_Spawn, "player", "cmdSpawn", 1);
  24.     register_logevent("RoundStart", 2, "1=Round_Start")
  25. }
  26.  
  27. public Gold ( id )
  28. {
  29.     if (get_user_flags(id) & ADMIN_GOLD)
  30.     {
  31.         GoldMenu( id );
  32.         g_iRunda[id] = true
  33.     }
  34.     else
  35.     {
  36.         Chat_Color(id, "%sNu ai acces la aceasta comanda",GoldTag)
  37.         return 1;
  38.     }
  39.     return 0
  40. }
  41.  
  42. public Silver ( id )
  43. {
  44.     if (get_user_flags(id) & ADMIN_SILVER)
  45.     {
  46.         SilverMenu( id )
  47.         g_iRound[id] = true
  48.     }
  49.     else
  50.     {
  51.         Chat_Color(id, "%sNu ai acces la aceasta comanda",SilverTag)
  52.         return 1;
  53.     }
  54.     return 0
  55. }
  56.  
  57. public GoldMenu( id )
  58. {  
  59.     if(g_iRunda[id])
  60.     {
  61.         Chat_Color(id, "%sAi folosit deja odata,incearca runda urmatoare",GoldTag)
  62.         return 1
  63.     }
  64.    
  65.     static menu;
  66.     menu = menu_create ("yVIPMENUr Gold","menu_gold");
  67.    
  68.     menu_additem ( menu,"w M3r +w Deagle","1", 0 );
  69.     menu_additem ( menu,"w AWPr +w Deagle","2", 0 );
  70.    
  71.     menu_setprop ( menu, MPROP_NUMBER_COLOR,"y");
  72.     menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
  73.    
  74.     menu_display ( id, menu, 0 );
  75.     return 0;
  76. }
  77.  
  78. public menu_gold ( id, menu, item )
  79. {
  80.     if ( item == MENU_EXIT )
  81.     {
  82.         menu_destroy ( menu );
  83.         return 1;
  84.     }
  85.    
  86.     new data [ 6 ], szName [ 64 ];
  87.     new access, callback;
  88.    
  89.     menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
  90.    
  91.     new key = str_to_num ( data );
  92.    
  93.     switch ( key )
  94.     {
  95.         case 1:
  96.         {
  97.             give_item ( id,"weapon_deagle" );
  98.             cs_set_user_bpammo( id, CSW_DEAGLE, 35 );
  99.             give_item ( id,"weapon_m3" )
  100.             cs_set_user_bpammo( id, CSW_M3, 32 );
  101.            
  102.         }
  103.         case 2:
  104.         {
  105.             give_item ( id,"weapon_deagle" );
  106.             cs_set_user_bpammo( id, CSW_DEAGLE, 35 );                
  107.             give_item ( id,"weapon_awp" )
  108.             cs_set_user_bpammo( id, CSW_AWP, 30 )
  109.            
  110.         }              
  111.     }
  112.     menu_destroy ( menu );
  113.     return 1;
  114. }
  115.  
  116. public cmdSpawn(id) {
  117.     if(get_user_flags(id) & ADMIN_GOLD && is_user_alive(id)) {
  118.        
  119.         set_user_armor(id, 110)
  120.         set_user_health(id, 110)
  121.         give_item ( id,"weapon_hegrenade" )
  122.         give_item ( id,"weapon_flashbang" )
  123.         cs_set_user_bpammo(id, CSW_FLASHBANG, 2)
  124.     }
  125.     else if(get_user_flags(id) & ADMIN_SILVER && is_user_alive(id))
  126.     {
  127.         set_user_armor(id, 100)
  128.         set_user_health(id, 100)
  129.         give_item ( id,"weapon_hegrenade" )
  130.     }
  131. }
  132.  
  133. public SilverMenu ( id )
  134. {
  135.     if(g_iRound[id])
  136.     {
  137.         Chat_Color(id, "%sAi folosit deja odata,incearca runda urmatoare",SilverTag)
  138.         return 1;
  139.     }
  140.    
  141.     static menu;
  142.     menu = menu_create ("yVIPMENUr Silver","menu_silver");
  143.    
  144.     menu_additem ( menu,"w M4A1","1", 0 );
  145.     menu_additem ( menu,"w AK47","2", 0 );
  146.    
  147.     menu_setprop ( menu, MPROP_NUMBER_COLOR,"y");
  148.     menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
  149.    
  150.     menu_display ( id, menu, 0 );
  151.     return 0;
  152. }
  153.  
  154. public menu_silver ( id, menu, item )
  155. {
  156.     if ( item == MENU_EXIT )
  157.     {
  158.         menu_destroy ( menu );
  159.         return 1;
  160.     }
  161.    
  162.     new data [ 6 ], szName [ 64 ];
  163.     new access, callback;
  164.    
  165.     menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
  166.    
  167.     new key = str_to_num ( data );
  168.    
  169.     switch ( key )
  170.     {
  171.         case 1:
  172.         {
  173.             give_item ( id,"weapon_m4a1" )
  174.             cs_set_user_bpammo( id, CSW_M4A1, 90 );
  175.            
  176.         }
  177.         case 2:
  178.         {
  179.             give_item ( id,"weapon_ak47" )
  180.             cs_set_user_bpammo( id, CSW_AK47, 90 );
  181.         }              
  182.     }
  183.     menu_destroy ( menu );
  184.     return 1;
  185. }
  186.  
  187. public RoundStart( )
  188. {
  189.     new iPlayers[32], iNum;
  190.     get_players( iPlayers, iNum)
  191.     for( new i = 0; i < iNum;i++ )
  192.     {
  193.         g_iRunda[ iPlayers[ i ] ] = false;
  194.         g_iRound[ iPlayers[ i ] ] = false;
  195.     }
  196. }
  197. stock Chat_Color(const id, const input[], any:...)
  198. {
  199.     new count = 1, players[32]
  200.     static msg[191]
  201.     vformat(msg, 190, input, 3)
  202.    
  203.     replace_all(msg, 190, "!g", "^4")
  204.     replace_all(msg, 190, "!y", "^1")
  205.     replace_all(msg, 190, "!team", "^3")
  206.    
  207.     if (id) players[0] = id; else get_players(players, count, "ch")
  208.     {
  209.     for (new i = 0; i < count; i++)
  210.     {
  211.         if (is_user_connected(players[i]))
  212.         {
  213.             message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  214.             write_byte(players[i]);
  215.             write_string(msg);
  216.             message_end();
  217.         }
  218.     }
  219. }
  220. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement