SHARE
TWEET

Untitled

a guest Apr 12th, 2019 110 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <engine>
  4. #include <fun>
  5. #include <fakemeta_util>
  6. #include <hamsandwich>
  7. #include <colorchat>
  8.  
  9.  
  10. #define PLUGIN "Vip"
  11. #define VERSION "1.0a"
  12. #define AUTHOR "costea"
  13.  
  14.  
  15. #define ADMIN_GOLD   ADMIN_LEVEL_H //t
  16. #define ADMIN_SILVER   ADMIN_LEVEL_G //s
  17.  
  18.  
  19. #define SCOREATTRIB_DEAD    ( 1 << 0 )
  20. #define SCOREATTRIB_VIP  ( 1 << 2 )
  21.  
  22.  
  23. new Cvar_VIP
  24. new Runda_Arme = 3
  25. new bool: Activare = false
  26. new bool: premenuactive = true
  27. new Contor = 0
  28. new g_szMessage[256]
  29. new const g_szBeginning[ ] = "Membrii VIP"
  30.  
  31.  
  32. const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
  33. const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
  34.  
  35.  
  36. new mkb,mhb,cvar_vip_maxhp,cvar_vip_maxap,cvar_hp_kill_premium,cvar_ap_kill_premium,cvar_hp_kill_classic,cvar_ap_kill_classic,cvar_vip_jump
  37. new cvar_vip_in_out,jumpnum[33], bool: dojump[33],cvar_vip_showC,cvar_vip_showH,SyncHudMessage
  38.  
  39. #define tag "INFO-VIP"
  40.  
  41. public plugin_init () {
  42.    
  43.    register_plugin ("PLUGIN", "VERSION", "AUTHOR")
  44.    new MapName[32]
  45.    get_mapname(MapName,31)
  46.    if(MapName[0] == 'a' && MapName[1] == 'w' && MapName[2] == 'p')
  47.       pause("ac","VIPT.amxx")
  48.    if(equal(MapName,"35hp_2"))
  49.       pause("ac","VIPT.amxx")
  50.    if(equal(MapName,"35hp"))
  51.       pause("ac","VIPT.amxx")  
  52.    if(equal(MapName,"awp_india"))
  53.       pause("ac","VIPT.amxx")
  54.    if(equal(MapName,"awp_bycastor32"))
  55.       pause("ac","VIPT.amxx")  
  56.      
  57.  
  58.  
  59.    
  60.    
  61.  
  62.  
  63.    register_clcmd("say /wantvip", "vip_info")
  64.    register_clcmd("say /vips", "print_adminlist")
  65.    RegisterHam(Ham_Spawn, "player", "cmdSpawn", 1)
  66.    register_event("DeathMsg", "eDeathMsg", "a")
  67.    register_logevent("RoundStart", 2, "1=Round_Start")
  68.    register_message(get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib")
  69.    Cvar_VIP = register_cvar("amx_vip" , "0")
  70.    cvar_vip_in_out = register_cvar("amx_vip_in_out", "1")
  71.    cvar_vip_jump = register_cvar("amx_vip_jump", "1" )
  72.    cvar_hp_kill_premium = register_cvar("amx_vip_addhp", "15")  
  73.    cvar_ap_kill_premium = register_cvar("amx_vip_addap", "10")
  74.    cvar_hp_kill_classic = register_cvar("amx_vip_addhp", "10")  
  75.    cvar_ap_kill_classic = register_cvar("amx_vip_addap", "10")
  76.    cvar_vip_maxhp = register_cvar("amx_vip_maxhp", "100")
  77.    cvar_vip_maxap = register_cvar("amx_vip_maxap", "100")  
  78.    mkb = register_cvar("money_kill_bonus","300")
  79.    mhb = register_cvar("money_hs_bonus","500")
  80.    cvar_vip_showC = register_cvar("amx_vip_show_chat", "1")
  81.    cvar_vip_showH = register_cvar("amx_vip_show_hud", "1")
  82.    
  83.  
  84.    set_task( 1.0, "TaskDisplayVips", _, _, _, "b", 0 )
  85.    SyncHudMessage = CreateHudSyncObj( )
  86.  
  87. }
  88.  
  89. public TaskDisplayVips( )
  90. {
  91.    if(get_pcvar_num(cvar_vip_showH))
  92.    {
  93.       static iPlayers[ 32 ];
  94.       static iPlayersNum;
  95.    
  96.       get_players( iPlayers, iPlayersNum, "ch" );
  97.       if( !iPlayersNum )
  98.          return 1;
  99.    
  100.       static iVipsConnected, szVipsNames[ 128 ], szName[ 32 ];
  101.       formatex( szVipsNames, sizeof ( szVipsNames ) -1, "" ); // Is this needed ?
  102.       iVipsConnected = 0;
  103.    
  104.       static id, i;
  105.       for( i = 0; i < iPlayersNum; i++ )
  106.       {
  107.          id = iPlayers[ i ];
  108.          if( get_user_flags( id ) & ADMIN_GOLD )
  109.          {
  110.             get_user_name( id, szName, sizeof ( szName ) -1 );
  111.          
  112.             add( szVipsNames, sizeof ( szVipsNames ) -1, szName );
  113.             add( szVipsNames, sizeof ( szVipsNames ) -1, "^n" );
  114.          
  115.             iVipsConnected++;
  116.          }
  117.       }
  118.    
  119.       formatex( g_szMessage, sizeof ( g_szMessage ) -1, "%s ( %i )^n%s",
  120.          g_szBeginning, iVipsConnected, szVipsNames );
  121.      
  122.       set_hudmessage( 25, 255, 25, 0.01, 0.25, 0, 0.0, 1.0, 0.1, 0.1, -1 );
  123.       ShowSyncHudMsg( 0, SyncHudMessage, g_szMessage );
  124.    }
  125.    return PLUGIN_CONTINUE;
  126.      
  127. }
  128.  
  129. public print_adminlist(user)
  130. {
  131.    if(get_pcvar_num(cvar_vip_showC))
  132.    {
  133.       new adminnames[33][32];
  134.       new message[256];
  135.       new id, count, x, len;
  136.  
  137.       for(id = 1 ; id <= get_maxplayers() ; id++)
  138.          if(is_user_connected(id))
  139.             if(get_user_flags(id) & ADMIN_GOLD || get_user_flags(id) & ADMIN_SILVER)
  140.                get_user_name(id, adminnames[count++], charsmax(adminnames[ ]));
  141.    
  142.       len = format(message, 255, "^3[%s] ^1VIP ACTIVE:^4 " ,tag);
  143.       if(count > 0)
  144.          {
  145.          for(x = 0 ; x < count ; x++)
  146.             {
  147.             len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"");
  148.             if(len > 96)
  149.             {
  150.                print_message(user, message);
  151.                len = format(message, 255, " ");
  152.             }
  153.             }
  154.          print_message(user, message);
  155.          }
  156.       else
  157.       {
  158.          ColorChat(0, GREEN, "^3[%s] ^1Momentan pe server nu se afla nici un ^4VIP^1 ACTIV .", tag);
  159.       }
  160.    }
  161.    return PLUGIN_CONTINUE;  
  162. }
  163.  
  164. print_message(id, msg[])
  165. {
  166.    message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
  167.    write_byte(id);
  168.    write_string(msg);
  169.    message_end();
  170. }
  171.  
  172. public MessageScoreAttrib(iMsgID, iDest, iReceiver) // Display VIP pe TAB
  173. {
  174.        new iPlayer = get_msg_arg_int(1);
  175.        if(is_user_connected( iPlayer )
  176.        && (get_user_flags( iPlayer ) & ADMIN_GOLD))
  177.       {
  178.               set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD);
  179.           }
  180. }
  181.  
  182. public in(id)    
  183. {
  184.    if(get_pcvar_num(cvar_vip_in_out))
  185.    {
  186.       new name[32];
  187.  
  188.       get_user_name(id, name, charsmax(name));
  189.  
  190.  
  191.       if(get_user_flags(id) & ADMIN_GOLD || get_user_flags(id) & ADMIN_SILVER)  
  192.       {
  193.          ColorChat(0, GREEN, "^3[%s] ^1VIP: ^4%s ^1s-a conectat.", tag, name);
  194.       }
  195.       return PLUGIN_HANDLED;
  196.    }
  197.    return PLUGIN_CONTINUE;
  198. }
  199.  
  200. public out(id)    
  201. {  
  202.    if(get_pcvar_num(cvar_vip_in_out))
  203.    {
  204.       new name[32];
  205.       get_user_name(id, name, charsmax(name));
  206.  
  207.       if(get_user_flags(id) & ADMIN_GOLD || get_user_flags(id) & ADMIN_SILVER)  
  208.       {
  209.          ColorChat(0, GREEN, "^3[%s] ^1VIP: ^4%s ^1s-a deconectat.", tag, name);
  210.       }
  211.       return PLUGIN_HANDLED;
  212.    }
  213.    return PLUGIN_CONTINUE;
  214. }
  215.  
  216. public client_connect(id) {
  217.    if(get_pcvar_num(Cvar_VIP) !=0 && !(get_user_flags(id) & ADMIN_SILVER))
  218.       set_user_flags(id,get_user_flags(id) + 262144)
  219. }
  220.  
  221. public client_PreThink(id)
  222. {
  223.    if(!is_user_alive(id))
  224.       return PLUGIN_CONTINUE;
  225.  
  226.    new BUTON = get_user_button(id)
  227.    new OLDBUTON = get_user_oldbutton(id)
  228.    new JUMP_VIP = get_pcvar_num(cvar_vip_jump)
  229.  
  230.    if((BUTON & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(OLDBUTON & IN_JUMP))
  231.    {
  232.       if(((get_user_flags(id) & ADMIN_GOLD) && (jumpnum[id] < JUMP_VIP)))
  233.       {
  234.          dojump[id] = true
  235.          jumpnum[id]++
  236.       }
  237.    }
  238.  
  239.    if((BUTON & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
  240.    {
  241.       jumpnum[id] = 0
  242.    }
  243.  
  244.    return PLUGIN_CONTINUE;
  245. }
  246.  
  247. public client_PostThink(id)
  248. {
  249.    if(!is_user_alive(id))
  250.       return PLUGIN_CONTINUE;
  251.  
  252.    if(dojump[id] == true)
  253.    {
  254.       new Float: velocity[3]  
  255.       entity_get_vector(id, EV_VEC_velocity, velocity)
  256.       velocity[2] = random_float(265.0, 285.0)
  257.       entity_set_vector(id, EV_VEC_velocity, velocity)
  258.       dojump[id] = false
  259.    }
  260.    return PLUGIN_CONTINUE;
  261. }
  262.  
  263. public client_putinserver(id)
  264. {  
  265.    set_task(2.0, "in", id)
  266.    jumpnum[id] = 0
  267.    dojump[id] = false
  268. }
  269.  
  270. public client_disconnect(id)
  271. {
  272.    set_task(2.0, "out", id)
  273.    jumpnum[id] = 0;
  274.    dojump[id] = false;
  275. }
  276.  
  277. public vip_info(id)
  278. {
  279.    show_motd(id, "/addons/amxmodx/configs/vip_info.html");
  280. }
  281.  
  282. public eDeathMsg()
  283. {
  284.    new id_Killer = read_data(1);
  285.    new VIP_MAXHP = get_pcvar_num(cvar_vip_maxhp);
  286.    new VIP_MAX_HP = get_user_health(id_Killer);
  287.    new VIP_MAXAP = get_pcvar_num(cvar_vip_maxap);
  288.    new VIP_MAX_AP = get_user_armor(id_Killer);
  289.  
  290.    if(is_user_alive(id_Killer))
  291.    {
  292.       if(get_user_flags(id_Killer) & ADMIN_GOLD && read_data(3) == 0)
  293.          {
  294.         if(VIP_MAX_HP + get_pcvar_num(cvar_hp_kill_premium) > VIP_MAXHP)
  295.             set_user_health(id_Killer, VIP_MAXHP);
  296.         else
  297.             set_user_health(id_Killer, get_user_health(id_Killer) + get_pcvar_num(cvar_hp_kill_premium));
  298.  
  299.         if(VIP_MAX_AP + get_pcvar_num(cvar_ap_kill_premium) > VIP_MAXAP)
  300.             set_user_armor(id_Killer, VIP_MAXAP);
  301.         else
  302.             set_user_armor(id_Killer, get_user_armor(id_Killer) + get_pcvar_num(cvar_ap_kill_premium));
  303.            
  304.         cs_set_user_money(id_Killer,cs_get_user_money(id_Killer) + get_pcvar_num(mkb))
  305.          }
  306.       if(get_user_flags(id_Killer) & ADMIN_GOLD && read_data(3) == 1)
  307.          {
  308.         if(VIP_MAX_HP + get_pcvar_num(cvar_hp_kill_premium) > VIP_MAXHP)
  309.             set_user_health(id_Killer, VIP_MAXHP);
  310.         else
  311.             set_user_health(id_Killer, get_user_health(id_Killer) + get_pcvar_num(cvar_hp_kill_premium));
  312.  
  313.         if(VIP_MAX_AP + get_pcvar_num(cvar_ap_kill_premium) > VIP_MAXAP)
  314.             set_user_armor(id_Killer, VIP_MAXAP);
  315.         else
  316.             set_user_armor(id_Killer, get_user_armor(id_Killer) + get_pcvar_num(cvar_ap_kill_premium));
  317.            
  318.         cs_set_user_money(id_Killer,cs_get_user_money(id_Killer) + get_pcvar_num(mhb))
  319.          }  
  320.       if(get_user_flags(id_Killer) & ADMIN_SILVER && read_data(3) == 1 && !(get_user_flags(id_Killer) & ADMIN_GOLD))
  321.          {
  322.         if(VIP_MAX_HP + get_pcvar_num(cvar_hp_kill_classic) > VIP_MAXHP)
  323.             set_user_health(id_Killer, VIP_MAXHP);
  324.         else
  325.             set_user_health(id_Killer, get_user_health(id_Killer) + get_pcvar_num(cvar_hp_kill_classic));
  326.            
  327.         if(VIP_MAX_AP + get_pcvar_num(cvar_ap_kill_classic) > VIP_MAXAP)
  328.             set_user_armor(id_Killer, VIP_MAXAP);
  329.         else   
  330.             set_user_armor(id_Killer, get_user_armor(id_Killer) + get_pcvar_num(cvar_ap_kill_classic));
  331.            
  332.         cs_set_user_money(id_Killer,cs_get_user_money(id_Killer) + get_pcvar_num(mhb))
  333.          }
  334.       if(get_user_flags(id_Killer) & ADMIN_SILVER && read_data(3) == 0 && !(get_user_flags(id_Killer) & ADMIN_GOLD))
  335.          {
  336.         cs_set_user_money(id_Killer,cs_get_user_money(id_Killer) + get_pcvar_num(mkb))
  337.          }
  338.    }
  339.  
  340.    return PLUGIN_HANDLED;
  341. }
  342.  
  343. public PreMenu( id )
  344. {
  345.    static menu;
  346.    menu = menu_create ("\rPRO-VIP \wGUN MENU","menu_pre");
  347.    
  348.    menu_additem ( menu,"\wDeagle \r[PRO-VIP]","1", ADMIN_GOLD)
  349.    menu_additem ( menu,"\wUSP \r[PRO-VIP]","2", ADMIN_GOLD)
  350.    menu_additem ( menu,"\wKevlar \r[PRO-VIP]","3", ADMIN_GOLD)
  351.    
  352.    menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
  353.    menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
  354.    
  355.    menu_display ( id, menu, 0 );
  356.    return 0;
  357. }
  358.  
  359. public menu_pre ( id, menu, item )
  360. {
  361.    if ( item == MENU_EXIT )
  362.    {
  363.       menu_destroy ( menu );
  364.       return 1;
  365.    }
  366.    
  367.    new data [ 6 ], szName [ 64 ];
  368.    new access, callback;
  369.    
  370.    menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
  371.    
  372.    new key = str_to_num ( data );
  373.    
  374.    switch ( key )
  375.    {
  376.       case 1:
  377.       {
  378.          drop_weapons(id,2)
  379.          give_item(id, "weapon_hegrenade")
  380.          give_item ( id,"weapon_deagle" );
  381.          cs_set_user_bpammo( id, CSW_DEAGLE, 35 );
  382.          ColorChat(id, GREEN, "^3[%s]^1 Ai ales:^4 Deagle", tag);
  383.       }
  384.       case 2:
  385.       {
  386.         drop_weapons(id,2)
  387.          give_item ( id,"weapon_usp" );
  388.          cs_set_user_bpammo( id, CSW_USP, 35 );                
  389.          ColorChat(id, GREEN, "^3[%s]^1 Ai ales:^4 USP", tag);
  390.       }      
  391.       case 3:
  392.       {
  393.          give_item(id, "item_kevlar")
  394.     give_item(id, "weapon_flashbang")
  395.     give_item(id, "weapon_flashbang")
  396.     give_item(id, "weapon_hegrenade")
  397.    
  398.          ColorChat(id, GREEN, "^3[%s]^1 Ai ales:^4 Kevlar", tag);
  399.       }              
  400.    }
  401.    menu_destroy ( menu );
  402.    return 1;
  403. }
  404.  
  405. public GoldMenu( id )
  406. {
  407.    static menu;
  408.    menu = menu_create ("\rPRO-VIP GOLD \wGUN MENU","menu_gold");
  409.    
  410.    menu_additem ( menu,"\rM4A1 \y+ \wDeagle \y+ \wiTem Pack \r[PRO-VIP]","1", ADMIN_GOLD)
  411.    menu_additem ( menu,"\rAK47 \y+ \wDeagle \y+ \wiTem Pack \r[PRO-VIP]","2", ADMIN_GOLD)
  412.    menu_additem ( menu,"\rAWP \y+ \wDeagle \y+ \wiTem Pack \r[PRO-VIP]","3", ADMIN_GOLD)
  413.    
  414.    menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
  415.    menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
  416.    
  417.    menu_display ( id, menu, 0 );
  418.    return 0;
  419. }
  420.  
  421.  
  422. public menu_gold ( id, menu, item )
  423. {
  424.    if ( item == MENU_EXIT )
  425.    {
  426.       menu_destroy ( menu );
  427.       return 1;
  428.    }
  429.    
  430.    new data [ 6 ], szName [ 64 ];
  431.    new access, callback;
  432.    
  433.    menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
  434.    
  435.    new key = str_to_num ( data );
  436.    
  437.    switch ( key )
  438.    {
  439.       case 1:
  440.       {
  441.          drop_weapons(id,1)
  442.          drop_weapons(id,2)
  443.          give_item(id, "weapon_hegrenade")
  444.          give_item(id, "weapon_flashbang")
  445.          cs_set_user_bpammo(id, CSW_FLASHBANG, 2)
  446.          give_item(id, "item_assaultsuit")
  447.          give_item(id, "item_thighpack")
  448.          give_item ( id,"weapon_deagle" );
  449.          cs_set_user_bpammo( id, CSW_DEAGLE, 35 );
  450.          give_item ( id,"weapon_m4a1" )
  451.          cs_set_user_bpammo( id, CSW_M4A1, 90 );
  452.          ColorChat(id, GREEN, "^3[%s]^1 Ai ales:^4 M4A1+Deagle+^3iTem Pack", tag);
  453.       }
  454.       case 2:
  455.       {
  456.          drop_weapons(id,1)
  457.          drop_weapons(id,2)
  458.          give_item(id, "weapon_hegrenade")
  459.          give_item(id, "weapon_flashbang")
  460.          cs_set_user_bpammo(id, CSW_FLASHBANG, 2)
  461.          give_item(id, "item_assaultsuit")
  462.          give_item(id, "item_thighpack")
  463.          give_item ( id,"weapon_deagle" );
  464.          cs_set_user_bpammo( id, CSW_DEAGLE, 35 );                
  465.          give_item ( id,"weapon_ak47" )
  466.          cs_set_user_bpammo( id, CSW_AK47, 90 )
  467.          ColorChat(id, GREEN, "^3[%s]^1 Ai ales:^4 AK47+Deagle+^3iTem Pack", tag);
  468.       }      
  469.       case 3:
  470.       {
  471.          drop_weapons(id,1)
  472.          drop_weapons(id,2)
  473.          give_item(id, "weapon_hegrenade")
  474.          give_item(id, "weapon_flashbang")
  475.          cs_set_user_bpammo(id, CSW_FLASHBANG, 2)
  476.          give_item(id, "item_assaultsuit")
  477.          give_item(id, "item_thighpack")
  478.          give_item ( id,"weapon_deagle" );
  479.          cs_set_user_bpammo( id, CSW_DEAGLE, 35 );                
  480.          give_item ( id,"weapon_awp" )
  481.          cs_set_user_bpammo( id, CSW_AWP, 30 )
  482.          ColorChat(id, GREEN, "^3[%s]^1 Ai ales:^4 AWP+Deagle+^3iTem Pack", tag);
  483.       }              
  484.    }
  485.    menu_destroy ( menu );
  486.    return 1;
  487. }
  488.  
  489.  
  490. public cmdSpawn(id) {
  491.    if(get_user_flags(id) & ADMIN_GOLD && is_user_alive(id)) {
  492.       if(Activare)
  493.          GoldMenu( id )
  494.    }
  495.    else if(get_user_flags(id) & ADMIN_SILVER && is_user_alive(id))
  496.    {
  497.       if(Activare)
  498.          SilverMenu( id )
  499.    }
  500.    
  501.    if(get_user_flags(id) & ADMIN_GOLD || get_user_flags(id) & ADMIN_SILVER && is_user_alive(id)){
  502.     if(premenuactive)
  503.         PreMenu( id )
  504.     }
  505.    
  506.    if(get_pcvar_num(Cvar_VIP) !=0 && !(get_user_flags(id) & ADMIN_SILVER))
  507.       set_user_flags(id,get_user_flags(id) + 262144)
  508. }
  509.  
  510. public SilverMenu ( id )
  511. {
  512.    static menu;
  513.    menu = menu_create ("\rPRO-VIP SILVER \wGUN MENU","menu_silver");
  514.    
  515.    menu_additem ( menu,"\rM4A1 \y+ \wDeagle \y+ \wiTem Pack \r[PRO-VIP]","1", ADMIN_SILVER)
  516.    menu_additem ( menu,"\rAK47 \y+ \wDeagle \y+ \wiTem Pack \r[PRO-VIP]","2", ADMIN_SILVER)
  517.  
  518.  
  519.    menu_setprop ( menu, MPROP_NUMBER_COLOR,"\y");
  520.    menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
  521.    
  522.    menu_display ( id, menu, 0 );
  523.    return 0;
  524. }
  525.  
  526.  
  527. public menu_silver ( id, menu, item )
  528. {
  529.    if ( item == MENU_EXIT )
  530.    {
  531.       menu_destroy ( menu );
  532.       return 1;
  533.    }
  534.    
  535.    new data [ 6 ], szName [ 64 ];
  536.    new access, callback;
  537.    
  538.    menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
  539.    
  540.    new key = str_to_num ( data );
  541.    
  542.    switch ( key )
  543.    {
  544.       case 1:
  545.       {
  546.          drop_weapons(id,1)
  547.          drop_weapons(id,2)
  548.          give_item(id, "weapon_hegrenade")
  549.          give_item(id, "weapon_flashbang")
  550.          cs_set_user_bpammo(id, CSW_FLASHBANG, 2)
  551.          give_item(id, "item_assaultsuit")
  552.          give_item(id, "item_thighpack")
  553.          give_item ( id,"weapon_deagle" )
  554.          cs_set_user_bpammo( id, CSW_DEAGLE, 35 )              
  555.          give_item ( id,"weapon_m4a1" )
  556.          cs_set_user_bpammo( id, CSW_M4A1, 90 )
  557.          ColorChat(id, GREEN, "^3[%s]^1 Ai ales:^4 M4A1+Deagle+^3iTem Pack", tag);
  558.       }
  559.       case 2:
  560.       {
  561.          drop_weapons(id,1)
  562.          drop_weapons(id,2)
  563.          give_item(id, "weapon_hegrenade")
  564.          give_item(id, "weapon_flashbang")
  565.          cs_set_user_bpammo(id, CSW_FLASHBANG, 2)
  566.          give_item(id, "item_assaultsuit")
  567.          give_item(id, "item_thighpack")
  568.          give_item ( id,"weapon_deagle" )
  569.          cs_set_user_bpammo( id, CSW_DEAGLE, 35 )                
  570.          give_item ( id,"weapon_ak47" )
  571.          cs_set_user_bpammo( id, CSW_AK47, 90 )
  572.      ColorChat(id, GREEN, "^3[%s]^1 Ai ales:^4 AK47+Deagle+^3iTem Pack", tag);
  573.       }              
  574.    }
  575.    menu_destroy ( menu );
  576.    return PLUGIN_HANDLED
  577. }
  578.  
  579. public RoundStart( )
  580. {
  581.    Contor++
  582.    if(Contor >= Runda_Arme)
  583.       Activare = true
  584.      
  585.      
  586.    if(Contor < Runda_Arme)
  587.     premenuactive = true
  588.    else
  589.     premenuactive = false
  590.      
  591. }
  592. stock drop_weapons(id, dropwhat)
  593. {
  594.    static Weapons[32], Num, i, WeaponID;
  595.    Num = 0;
  596.    get_user_weapons(id, Weapons, Num);
  597.    for(i = 0; i < Num; i ++)
  598.    {
  599.       WeaponID = Weapons[i];
  600.       if((dropwhat == 1 && ((1 << WeaponID) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1 << WeaponID) & SECONDARY_WEAPONS_BIT_SUM )))
  601.       {
  602.          static DropName[32], WeaponEntity;
  603.          get_weaponname(WeaponID, DropName, charsmax(DropName));
  604.          WeaponEntity = fm_find_ent_by_owner(-1, DropName, id);
  605.          set_pev(WeaponEntity, pev_iuser1, cs_get_user_bpammo (id, WeaponID));
  606.          engclient_cmd(id, "drop", DropName);
  607.          cs_set_user_bpammo(id, WeaponID, 0);
  608.       }
  609.    }
  610. }
  611.  
  612. #pragma tabsize 0
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