I am not sure if he wants to use a beta version of amxx. Anyway, took some time searching the damn menuid name, but here you go:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#define VERSION "0.0.1"
new price = 300
public plugin_init() {
register_plugin("SmokeGrenade Price Change", VERSION, "Jhob94")
register_clcmd("sgren", "Buy_Smoke", 0) // VGUI Menu
register_menucmd(register_menuid("BuyItem"),(1<<4),"OS_Smoke") // Old-Style Menu
}
public OS_Smoke(id, key)
{
if(key == 4)
Buy_Smoke(id, 1)
}
public Buy_Smoke(id, OS)
{
new cur_money = cs_get_user_money(id)
if(cur_money < price)
client_print(id, print_center, "#Not_Enough_Money")
else
{
if(user_has_weapon(id, CSW_SMOKEGRENADE))
client_print(id, print_center, "#Cannot_Carry_Anymore")
else
{
give_item(id, "weapon_smokegrenade")
cs_set_user_money(id, cur_money - price, 1)
}
}
if(OS)
engclient_cmd(id, "menuselect" ,"10")
return PLUGIN_HANDLED
}
Edit:
Will add the task for check about buy time. But, i need to know one thing. The buy time starts at same time as freeze time or when freeze time ends? (cant test since haven't cs at this pc)
__________________