PHP Code:
#include <amxmodx>
#include <cstrike>
#define PLUGIN "BuyZone Example"
#define AUTHOR "Alucard"
#define VERSION "1.0"
new p_BuyZone
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /buy", "BuySomething")
p_BuyZone = register_cvar("buy_zone", "1")
}
public BuySomething(id)
{
if(get_pcvar_num(p_BuyZone) && !cs_get_user_buyzone(id) )
{
client_print(id, print_chat, "You need to be in a buyzone to buy something")
return PLUGIN_HANDLED
}
client_print(id, print_chat, "Take this!")
return PLUGIN_HANDLED
}
Why dont work? o.o
I tried with "else"... i tried with "cs_get_user_buyzone(id) == 0" like other plugin... but is the same.
If i am in a buy zone i get this message:
Quote:
|
You need to be in a buyzone to buy something
|
If i am not in a buy zone i get the same message.
__________________