This is my code:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "weapons shop"
#define VERSION "1.0"
#define AUTHOR "Ice-Action |#KeyBlade"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2
register_menucmd(register_menuid("choose weapons"), keys, "giveWeapon")
register_clcmd("say /bw", "showWeaponMenu")
}
public showWeaponMenu(id)
{
new menu[192]
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2
format(menu, 191, "choose weapons^n^n1-AK47^n2-M4A1^n3-AWP^n^n^n^n^n^n^n^n0-Exit")
show_menu(id, keys, menu)
return PLUGIN_HANDLED
}
public giveWeapon(id, key)
{
if (key == 0)
{
give_item(id, "weapon_ak47")
} else if (key == 1) {
give_item(id, "weapon_m4a1")
} else if (key == 2) {
give_item(id, "weapon_awp")
}
}
I press 3 in the game but I can't get AWP.What's wrong?
I'm a script beginner.Sorry for my bad english.