This is my first plugin and i tried to make it to work with Zombie-Plague
but i couldn't
Code:
#include <amxmodx>
#include <fun>
#include <zombieplague>
#define PLUGIN "Buy Health Points"
#define VERSION "1.0"
#define AUTHOR "The-Disaster"
new g_itemid_buyhp
new g_item_name
new on_off
new price
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /buyhp", "addhp")
on_off = register_cvar("zp_buyhp", "1")
price = register_cvar("zp_buyhp_price", "5")
g_itemid_buyhp = zp_register_extra_item(g_item_name, get_pcvar_num(price), ZP_TEAM_ANY = 0)
}
public addhp(id)
{
new price_ap = zp_get_user_ammo_packs(id)
zp_set_user_ammo_packs(id, price_ap - get_pcvar_num(price))
if (get_pcvar_num(on_off) == 1)
{
if (price_ap >= get_pcvar_num(price))
{
set_user_health(id, ( get_user_health(id)+1000 ))
client_print(id, print_chat,"[ZP] You Gained 1000HP!")
}
else
{
client_print(id, print_chat,"[ZP] Not enough Ammopacks!")
}
}
}
Could some one help me please to fix this plugin
__________________