Hello, modders !
So I have an armour free plugin it works fine, but if a VIP is zombie, die and then respawn it gives 200 armor to him (as a zombie), I tried to make it so if it has admin_level_G to give no armor but it didn't worked. What should I do ?
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <zombieplague>
#define ACCESS ADMIN_LEVEL_G
new cvar_armor_value, g_SayText
new sound_armor[] = { "items/tr_kevlar.wav" }
public plugin_init()
{
register_plugin("[CSO] Free Armor for Players", "1.0", "Carbon")
RegisterHam(Ham_Spawn, "player", "fw_Give_Armor", 1)
cvar_armor_value = register_cvar("zp_armor", "50")
g_SayText = get_user_msgid("SayText")
}
public fw_Give_Armor(id)
{
if (is_user_alive(id) && !zp_get_user_zombie(id))
{
if (get_user_flags(id) != ACCESS)
{
set_user_armor(id, get_pcvar_num(cvar_armor_value))
ColorPrint(id, "^x04[CSO]^x01 You got free 50 Armor!", get_pcvar_num(cvar_armor_value))
client_cmd(id, "spk %s", sound_armor)
}
}
}
stock ColorPrint(const id, const input[], any:...)
{
if( !is_user_connected( id ) )
return
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
message_begin(MSG_ONE_UNRELIABLE, g_SayText, _, id)
write_byte(id)
write_string(msg)
message_end()
}