Всем привет есть плагин VIP чуть изменил ну вот не могу сделать чтобы когда выдавало дигл второй пистолет убирался, так же и с оружием...
Код:
#define DAMAGE_RECIEVED
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#define VIP_FLAG ADMIN_LEVEL_H
new a
new round_number
public plugin_init()
{
register_plugin("VIP Privileges", "1.1", "Kent-4");
register_event("ResetHUD", "ResetHUD", "be");
register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
register_clcmd("say /adminka", "adminka");
register_clcmd("say /vip","ShowMotd");
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MEN
U_KEY_7
register_menucmd(register_menuid("Выберите оружие?"), keys, "giveWeapon");
register_clcmd("vipmenu", "showWeaponMenu");
}
public client_authorized(id)
{
client_cmd(id, "bind ^"F5^" ^"vipmenu^"")
}
public showWeaponMenu(id)
{
new menu[192]
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MEN
U_KEY_7
format(menu, 191, "Выберите оружие?^n^n1. \r[\yDeagle\r]\w^n2. \r[\yUSP\r]\w^n3. \r[\yAk47\r]\w^n4. \r[\yM4a1\r]\w^n5. \r[\yFAMAS\r]\w^n6. \r[\yAWP\r]\w^n7. \r[\ySCOUT\r]")
show_menu(id, keys, menu)
return PLUGIN_HANDLED
}
public giveWeapon(id, key)
{
if ( ! ( get_user_flags ( id ) & VIP_FLAG ) )
{
ChatColor ( id , "!g|+18>>Сервер!y ТОЛЬКО ДЛЯ !teamVIP!" );
return PLUGIN_HANDLED;
}
if ( ! is_user_alive ( id ) )
{
ChatColor(id, "!g|+18>>Сервер!y Вы!team мертвы!");
return PLUGIN_HANDLED;
}
if (a > 1 )
{
ChatColor(id, "!g|+18>>Сервер!y НЕЛЬЗЯ ВЗЯТЬ!team БОЛЬШЕ!");
return PLUGIN_HANDLED;
}
if ( round_number <= 3 )
{
ChatColor ( id , "!g|+18>>Сервер!y Доступно со 2 раунда!" );
return PLUGIN_HANDLED;
}
if (key == 0)
{
give_item(id, "weapon_deagle")
cs_set_user_bpammo( id , CSW_DEAGLE, 35 )
a++
} else if (key == 1) {
give_item(id, "weapon_usp")
cs_set_user_bpammo( id , CSW_USP, 100 )
a++
} else if (key == 2) {
give_item(id, "weapon_ak47")
cs_set_user_bpammo( id , CSW_AK47, 90 )
a++
} else if (key == 3) {
give_item(id, "weapon_m4a1")
cs_set_user_bpammo( id , CSW_M4A1, 90 )
a++
} else if (key == 4) {
give_item(id, "weapon_famas")
cs_set_user_bpammo( id , CSW_FAMAS, 90 )
a++
} else if (key == 5) {
give_item(id, "weapon_awp")
cs_set_user_bpammo( id , CSW_AWP, 30 )
a++
} else if (key == 6) {
give_item(id, "weapon_scout")
cs_set_user_bpammo( id , CSW_SCOUT, 90 )
}
}
public adminka(id)
{
show_motd(id, "adminka.txt")
}
public PrintText(id)
{
client_print(id, print_chat, "")
}
public ResetHUD(id)
{
set_task(0.5, "VIP", id + 6910)
}
public VIP(TaskID)
{
new id = TaskID - 6910
if ( get_user_flags ( id ) & VIP_FLAG )
{
message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
write_byte(id)
write_byte(4)
message_end()
give_item(id,"weapon_hegrenade")
give_item(id,"weapon_flashbang")
give_item(id,"weapon_flashbang")
give_item(id,"weapon_smokegrenade")
give_item(id,"item_assaultsuit")
give_item( id, "item_thighpack" )
}
return PLUGIN_HANDLED
}
public ShowMotd(id)
{
show_motd(id, "vip.txt")
}
public event_round_start ( )
{
round_number++
a--
}
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();
}
}
}
}