First of all, I don't know how to explain. So I'll try.
PHP Code:
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <cstrike>
public plugin_init() {
register_plugin("Weapon Menu", "1.0", "? ?")
register_clcmd("say /weapon","cmdWeaponMenu") ,
register_clcmd("say_team /weapon","cmdWeaponMenu")
}
public cmdWeaponMenu( id ) {
return;
new menu = menu_create("\rSelect Weapon:", "menu_handler");
menu_additem(menu, "Golden AK", "1", 0)
menu_additem(menu, "Golden DE", "2", 0)
menu_display(id, menu, 0)
}
public handleWeaponMenu(id, menu, item) {
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch( key)
{
case 1:
{
client_print(id, print_chat, "You've just bought a Golden AK.")
}
case 2:
{
client_print(id, print_chat, "You've just bought a Golden DE.")
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
So, when a player click "1" he will bought the Golden AK. So as the "2" which is for Golden DE. The buy command for golden ak is /goldenak and for golden de is /goldende. So I don't know what's the code for it. So I hope you could help me. There is a blank line on case 1 and case 2.
So, please help :')
__________________