Author
|
Message
|
Junior Member
|
03-17-2024
, 13:26
After choosing the class zm only takes effect when reborn
|
#1
|
So I'm having a problem on my server, I want when the player chooses the zombie class it only comes into effect after his death as a zombie
I want to let him make his first choice after being infected, but the moment he opens the menu again, his selection will only take effect only when he revives
***CODE BELOW***
Spoiler
// menu class zombie
public show_menu_class_zombie(id)
{
if (!g_zombie[id]) return PLUGIN_HANDLED
// create menu wpn
new menuwpn_title[64]
format(menuwpn_title, 63, "[NST Zombie] %L:", LANG_PLAYER, "ZB3_MENU_CLASSZOMBIE_TITLE")
new mHandleID = menu_create(menuwpn_title, "select_class_zombie")
new class_name[32], class_id[32]
for (new i = 0; i < class_count; i++)
{
ArrayGetString(zombie_name, i, class_name, charsmax(class_name))
formatex(class_id, charsmax(class_name), "%i", i)
menu_additem(mHandleID, class_name, class_id, 0)
}
menu_display(id, mHandleID, 0)
return PLUGIN_HANDLED
}
public select_class_zombie(id, menu, item)
{
if (!g_zombie[id]) return PLUGIN_HANDLED
if (item == MENU_EXIT)
{
menu_destroy(menu)
give_zombiebom(id)
return PLUGIN_HANDLED
}
new idclass[32], name[32], access
menu_item_getinfo(menu, item, access, idclass, 31, name, 31, access)
// set class zombie
g_zombieclass[id] = str_to_num(idclass)
make_zombie(id)
give_zombiebom(id)
menu_destroy(menu)
//client_print(id, print_chat, "item: %i - id: %s", name, idclass)
return PLUGIN_HANDLED
}
Last edited by Noah BR; 03-19-2024 at 17:42.
|
|
|
|