Hello!
I got a zombie mod server and i am working on a menu so the human can choose between 6 models.
Can someone fix it and so only humans can open it not zombies and so the models work and the print_chat works.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#define PLUGIN "Model Changer"
#define AUTHOR "Ludacriss"
#define VERSION "1.0"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /menu","PlayerMenu");
}
public PlayerMenu(id)
{
new menu = menu_create("\r Choose your player model:", "menu_handler");
menu_additem(menu, "\yZoey", "\r1", 0);
menu_additem(menu, "\yFrancis", "\r2", 0);
menu_additem(menu, "\yBill", "\r3", 0);
menu_additem(menu, "\yLouis", "\r4", 0);
menu_additem(menu, "\yEllis", "\r5", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public menu_handler(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 selected Zoey as your player model!");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 2:
{
client_print(id, print_chat, "You selected Francis as your player model!");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 3:
{
client_print(id, print_chat, "You selected Bill as your player model!");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 4:
{
client_print(id, print_chat, "You selected Louis as your player model!");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 5:
{
client_print(id, print_chat, "You selected Ellis as your player model!");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}