PHP Code:
#include <amxmodx>
#include <engine>
new gBuyCommands[][] =
{
"usp", "glock", "deagle", "p228", "elites", "fn57", "m3", "xm1014", "mp5", "tmp", "p90", "mac10", "ump45", "ak47",
"galil", "famas", "sg552", "m4a1", "aug", "scout", "awp", "g3sg1", "sg550", "m249", "vest", "vesthelm", "flash", "hegren",
"sgren", "defuser", "nvgs", "shield", "primammo", "secammo", "km45", "9x19mm", "nighthawk", "228compact", "12gauge",
"autoshotgun", "smg", "mp", "c90", "cv47", "defender", "clarion", "krieg552", "bullpup", "magnum", "d3au1", "krieg550",
"buyammo1", "buyammo2"
}
new gCvarPluginToggle
public plugin_precache() {
disable_buyzone();
}
public plugin_init()
{
gCvarPluginToggle = register_cvar("amx_block_buy", "1")
for (new i; i < sizeof gBuyCommands; i++)
register_clcmd(gBuyCommands[i], "BlockBuyCommands")
}
public disable_buyzone() {
new ent = find_ent_by_class(-1,"info_map_parameters");
if(!ent) {
ent = create_entity("info_map_parameters");
}
DispatchKeyValue(ent,"buying","3");
DispatchSpawn(ent);
}
public BlockBuyCommands(id)
{
if (!get_pcvar_num(gCvarPluginToggle))
return PLUGIN_CONTINUE;
return PLUGIN_HANDLED;
}