Код:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#define VIP_FLAG ADMIN_LEVEL_H
new 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)
new const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
new lock[33]
new round_number
public plugin_cfg()
{
new const szDisableMapTypes[][] = {"35hp_", "awp__", "aim_", "fy_"};
new szMapname[32];
get_mapname(szMapname, charsmax(szMapname));
for(new i; i < sizeof szDisableMapTypes; i++)
if(equali(szMapname, szDisableMapTypes[i], strlen(szDisableMapTypes[i]))) pause("ad");
}
public plugin_init()
{
register_plugin("Admin_vip", "1.0", "kent-4")
RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("TextMsg", "Event_NewGame", "a", "2=#Game_will_restart_in", "2=#Game_Commencing" )
register_clcmd("say /m4a1", "m4a1")
register_clcmd("say /ak47", "ak47")
register_clcmd("say /awp", "awp")
}
public Player_Spawn_Post(id)
{
set_task(0.5, "VIP", id + 6910)
}
public event_round_start ( )
{
round_number++
arrayset(lock, 0, 33)
}
public VIP(TaskID)
{
new id = TaskID - 6910
if(!is_user_alive( id ))
return
if(get_user_flags ( id ) & VIP_FLAG )
{
message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
write_byte(id)
write_byte(4)
message_end()
if ( round_number <= 3 )
{
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_flashbang")
give_item(id,"weapon_flashbang")
give_item(id,"weapon_smokegrenade")
drop_weapons(id, 2)
give_item(id,"weapon_deagle")
ExecuteHamB(Ham_GiveAmmo, id, 70, "50ae", 70)
give_item(id,"item_assaultsuit")
set_user_armor(id, 100)
if(get_user_team(id) == 2)
give_item(id, "item_thighpack")
}
}
}
public client_putinserver(id)
{
new name[32]
get_user_name(id, name, 31)
if (get_user_flags(id) & ADMIN_LEVEL_H)
{
ChatColor ( 0 , "!team[!gRastaCS!team]!y Поприветствуем !team[VIP] !g%s!y!", name);
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public m4a1 ( id )
{
if ( ! ( get_user_flags ( id ) & VIP_FLAG ) )
{
ChatColor ( id , "!team[!gRastaCS!team]!yТолько для !team[VIP]!y!" );
return PLUGIN_HANDLED;
}
if ( ! is_user_alive ( id ) )
{
ChatColor(id, "!team[!gRastaCS!team] !yТы !team[Мертв]!y!");
return PLUGIN_HANDLED;
}
if ( round_number <= 3 )
{
ChatColor ( id , "!team[!gRastaCS!team]!yДоступно со !team2 !yраунда!" );
return PLUGIN_HANDLED;
}
if (lock[id])
{
ChatColor ( id , "!team[!gRastaCS!team]!yДоступно !team1 !yраз за раунд!" );
return PLUGIN_HANDLED
}
drop_weapons(id, 1)
give_item( id, "weapon_m4a1" )
ExecuteHamB(Ham_GiveAmmo, id, 90, "556nato", 90)
lock[id] = 1
return PLUGIN_CONTINUE;
}
public ak47 ( id )
{
if ( ! ( get_user_flags ( id ) & VIP_FLAG ) )
{
ChatColor ( id , "!team[!gRastaCS!team]!yТолько для !team[VIP]!y!" );
return PLUGIN_HANDLED;
}
if ( ! is_user_alive ( id ) )
{
ChatColor(id, "!team[!gRastaCS!team] !yТы !team[Мертв]!y!");
return PLUGIN_HANDLED;
}
if ( round_number <= 3 )
{
ChatColor ( id , "!team[!gRastaCS!team] !yДоступно со !team2 !yраунда!" );
return PLUGIN_HANDLED;
}
if (lock[id])
{
ChatColor ( id , "!team[!gRastaCS!team] !yДоступно !team1 !yраз за раунд!" );
return PLUGIN_HANDLED
}
drop_weapons(id, 1)
give_item( id, "weapon_ak47" )
ExecuteHamB(Ham_GiveAmmo, id, 90, "762nato", 90)
lock[id] = 1
return PLUGIN_CONTINUE;
}
public awp ( id )
{
if ( ! ( get_user_flags ( id ) & VIP_FLAG ) )
{
ChatColor ( id , "!team[!gRastaCS!team] !yТолько для !team[VIP]!y!" );
return PLUGIN_HANDLED;
}
if ( ! is_user_alive ( id ) )
{
ChatColor(id, "!team[!gRastaCS!team] !yТы !team[Мертв]!y!");
return PLUGIN_HANDLED;
}
if ( round_number <= 4 )
{
ChatColor ( id , "!team[!gRastaCS!team] !yДоступно с !team3 !yраунда!" );
return PLUGIN_HANDLED;
}
if (lock[id])
{
ChatColor ( id , "!team[!gRastaCS!team] !yДоступно !team1 !yраз за раунд!" );
return PLUGIN_HANDLED
}
drop_weapons(id, 1)
give_item( id, "weapon_awp" )
ExecuteHamB(Ham_GiveAmmo, id, 30, "338magnum", 30)
lock[id] = 1
return PLUGIN_CONTINUE;
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!team", "^3") // Team Color
replace_all(msg, 190, "!team2", "^0") // Team2 Color
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
stock drop_weapons(id, dropwhat)
{
static weapons[32], num, i, weaponid
num = 0
get_user_weapons(id, weapons, num)
for (i = 0; i < num; i++)
{
weaponid = weapons[i]
if ((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
|| (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
{
static wname[32]
get_weaponname(weaponid, wname, charsmax(wname))
engclient_cmd(id, "drop", wname)
}
}
}