PHP Code:
#include <amxmodx>
#include <cstrike>
#include <colorchat>
#include <fun>
new const TAG[] = "[YourTag]"
public plugin_init() {
register_plugin("ammo", "1.0", "Asaf Mazon")
register_clcmd("say /ammo", "ammo");
}
public ammo(id) {
new menu = menu_create("Flashbang", "ammo3");
menu_additem(menu, "\wFlashbang", "1", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public ammo3(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, szName,63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
if( cs_get_user_bpammo(id, CSW_FLASHBANG) == 2) {
ColorChat(id, NORMAL, "%s You need to drop your^x04 1^x01 of your^x04 Flashbang's^x01 first.", TAG);
return PLUGIN_HANDLED;
}
else {
give_item( id, "weapon_flashbang" );
ColorChat(id, NORMAL, "%s You have bought^x04 Flashbang.", TAG);
}
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}