PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>
#define PLUGIN "Ammo"
#define VERSION "1.0"
#define AUTHOR "Asaf Mazon"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /ammo", "ammo");
}
public ammo(id)
{
new menu = menu_create("Awp", "ammo2");
menu_additem(menu, "\wAwp 1 Bullet", "1", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public ammo2(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:
{
new awp = fm_give_item(id, "weapon_awp");
cs_set_weapon_ammo(awp, 1);
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
__________________