Hello, i wanted to ask for help, i dont know how to do that player cant go bigger than 200 armor , and in one round cant buy more than 600... I have the last thing i mentioned in my script but the first one i dont know how to do it without making that ItemCount trigger...
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <cc>
new const g_item_name[] = { "Anti-Infection Armor" }
const g_item_cost = 14
new const g_sound_buyarmor[] = { "items/tr_kevlar.wav" }
const g_armor_amount = 100
const g_armor_limit = 200
new g_ItemCount[33]
new g_itemid_armor
public plugin_precache()
{
precache_sound(g_sound_buyarmor)
}
public plugin_init()
{
register_plugin("[ZP] Extra: Anti-Infection Armor", "1.0", "MeRcyLeZZ")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
g_itemid_armor = zp_register_extra_item(g_item_name, g_item_cost, ZP_TEAM_HUMAN)
}
public event_round_start(id)
{
arrayset(g_ItemCount, 0, sizeof g_ItemCount)
}
// Human buys our upgrade, give him some armor
public zp_extra_item_selected(player, itemid)
{
if (itemid == g_itemid_armor)
{
if(g_ItemCount[player] >= 6)
{
client_print_color(player, print_chat, "^4[^1ZP^4] ^1Max armor limit to buy in one round is^4 600^1!")
zp_set_user_ammo_packs(player, zp_get_user_ammo_packs(player) + g_item_cost)
}
else
{
set_pev(player, pev_armorvalue, float(min(pev(player, pev_armorvalue)+g_armor_amount, g_armor_limit)))
engfunc(EngFunc_EmitSound, player, CHAN_BODY, g_sound_buyarmor, 1.0, ATTN_NORM, 0, PITCH_NORM)
g_ItemCount[player] ++
}
}
}