When we are in round 2 we can take Deagle and Grenade from vip
When we are in round 3 we can take Deagle,Grenade and Weapons to chose
And if it possible to close menu for chosing after 10 second
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <reapi>
#include <fun>
const VIP_FLAG = ADMIN_LEVEL_C
const Float:VIP_HEALTH = 100.0
const Float:VIP_ARMOR = 100.0
new g_iMenu
new health_add
new health_hs_add
new health_max
new nKiller
new nKiller_hp
new nHp_add
new nHp_max
public plugin_init()
{
register_plugin("VIP Plugin", "1.0", "OciXCrom")
RegisterHookChain(RG_CBasePlayer_Spawn, "OnPlayerSpawn", 1)
register_event("DeathMsg", "hook_death", "a", "1>0")
health_add = register_cvar("amx_bonus_hp", "5")
health_hs_add = register_cvar("amx_bonus_hp_hs", "7")
health_max = register_cvar("amx_bonus_max_hp", "100")
g_iMenu = menu_create("\r[H3aD$h0T VIP] \yARME FALAS", "Menu_Handler")
menu_additem(g_iMenu, "Merr Ak47 + Deagle")
menu_additem(g_iMenu, "Merr M4a1 + Deagle")
menu_additem(g_iMenu, "Merr Famas + Deagle")
}
public hook_death(id)
{
if(is_user_vip(id))
{
nKiller = read_data(1)
if ( (read_data(3) == 1) && (read_data(5) == 0) )
{
nHp_add = get_pcvar_num (health_hs_add)
}
else
nHp_add = get_pcvar_num (health_add)
nHp_max = get_pcvar_num (health_max)
nKiller_hp = get_user_health(nKiller)
nKiller_hp += nHp_add
if (nKiller_hp > nHp_max) nKiller_hp = nHp_max
set_user_health(nKiller, nKiller_hp)
}
}
public OnPlayerSpawn(id)
{
if(is_user_alive(id) && is_user_vip(id))
{
set_entvar(id, var_health, VIP_HEALTH)
set_entvar(id, var_armorvalue, VIP_ARMOR)
menu_display(id, g_iMenu)
}
}
public Menu_Handler(id, iMenu, iItem)
{
switch(iItem)
{
case MENU_EXIT:
{
return
}
case 0:
{
rg_give_item(id, "weapon_ak47", GT_REPLACE)
rg_set_user_bpammo(id, WEAPON_AK47, 90)
}
case 1:
{
rg_give_item(id, "weapon_m4a1", GT_REPLACE)
rg_set_user_bpammo(id, WEAPON_M4A1, 90)
}
case 2:
{
rg_give_item(id, "weapon_famas", GT_REPLACE)
rg_set_user_bpammo(id, WEAPON_AWP, 90)
}
}
rg_give_item(id, "weapon_deagle", GT_REPLACE)
rg_give_item(id, "weapon_hegrenade")
rg_give_item(id, "weapon_flashbang")
}
bool:is_user_vip(id)
{
return bool:(get_user_flags(id) & VIP_FLAG)
}