Add if use custom zp classes like dragon and assassin....
#include <zombieplague>
Use This:
// 2. Extra Items if (LibraryExists(LIBRARY_ITEMS, LibType_Library) && is_user_alive(id) && zp_has_round_started() && zp_is_assassin_round() && zp_is_nemesis_round()) len += formatex(menu[len], charsmax(menu) - len, "\r2.\w %L^n", id, "MENU_EXTRABUY") else len += formatex(menu[len], charsmax(menu) - len, "\d2. %L^n", id, "MENU_EXTRABUY")
And copy this:
case 1: // Extra Items { // Items enabled? if (LibraryExists(LIBRARY_ITEMS, LibType_Library)) { // Check whether the player is able to buy anything if (is_user_alive(id) && zp_has_round_started() && zp_is_assassin_round() && zp_is_nemesis_round()) zp_items_show_menu(id) else if(!zp_has_round_started()) zp_colored_print(id, "You can't buy extra items when round not started!") else if(!zp_is_assassin_round()) zp_colored_print(id, "You can't buy extra items on assassin round!") else if(!zp_is_nemesis_round()) zp_colored_print(id, "You can't buy extra items on nemesis round!") else if(!is_user_alive(id)) zp_colored_print(id, "%L", id, "CANT_BUY_ITEMS_DEAD")
// 2. Extra Items if (LibraryExists(LIBRARY_ITEMS, LibType_Library) && is_user_alive(id) && zp_has_round_started() && AssassinMode && Nemesis Mode) len += formatex(menu[len], charsmax(menu) - len, "\r2.\w %L^n", id, "MENU_EXTRABUY") else len += formatex(menu[len], charsmax(menu) - len, "\d2. %L^n", id, "MENU_EXTRABUY")
search again to case 1: //Extra Items
change full code to this:
case 1: // Extra Items { // Items enabled? if (LibraryExists(LIBRARY_ITEMS, LibType_Library)) { // Check whether the player is able to buy anything if (is_user_alive(id) && zp_has_round_started() && AssassinMode() && NemesisMode()) zp_items_show_menu(id) else if(!zp_has_round_started()) zp_colored_print(id, "You can't buy extra items when round not started!") else if(!AssassinMode) zp_colored_print(id, "You can't buy extra items on assassin round!") else if(!NemesisMode) zp_colored_print(id, "You can't buy extra items on nemesis round!") else if(!is_user_alive(id)) zp_colored_print(id, "%L", id, "CANT_BUY_ITEMS_DEAD")
Compiled + work but if the round is normal infection or any other gamemode it show "you can't open extra item menu in assassin round", i only want to block assassin and nemesis round.
Compiled + work but if the round is normal infection or any other gamemode it show "you can't open extra item menu in assassin round", i only want to block assassin and nemesis round.
Excuse him, here's a correct edit. Zp 5.0: case 1: // Extra Items { // Items enabled? if (LibraryExists(LIBRARY_ITEMS, LibType_Library)) { if(zp_gamemodes_get_current() == ZP_NO_GAME_MODE) { zp_colored_print(id, "You can't buy extra items when round not started!") return; } if(zp_gamemodes_get_current() == AssassinMode) { zp_colored_print(id, "You can't buy extra items on assassin round!") return; } if(zp_gamemodes_get_current() == NemesisMode) { zp_colored_print(id, "You can't buy extra items on nemesis round!") return; } if(!is_user_alive(id)) { zp_colored_print(id, "%L", id, "CANT_BUY_ITEMS_DEAD") return; } zp_items_show_menu(id) } else zp_colored_print(id, "%L", id, "CMD_NOT_EXTRAS") } zp 4.3: case 1: // Extra Items { // Items enabled? if (LibraryExists(LIBRARY_ITEMS, LibType_Library)) { if(!zp_has_round_started()) { zp_colored_print(id, "You can't buy extra items when round not started!") return; } if(zp_is_assassin_round() || zp_is_nemesis_round()) { if(zp_is_assassin_round()) zp_colored_print(id, "You can't buy extra items on assassin round!") else zp_colored_print(id, "You can't buy extra items on nemesis round!")
Compiled + work but if the round is normal infection or any other gamemode it show "you can't open extra item menu in assassin round", i only want to block assassin and nemesis round.
Excuse him, here's a correct edit. Zp 5.0: case 1: // Extra Items { // Items enabled? if (LibraryExists(LIBRARY_ITEMS, LibType_Library)) { if(zp_gamemodes_get_current() == ZP_NO_GAME_MODE) { zp_colored_print(id, "You can't buy extra items when round not started!") return; } if(zp_gamemodes_get_current() == AssassinMode) { zp_colored_print(id, "You can't buy extra items on assassin round!") return; } if(zp_gamemodes_get_current() == NemesisMode) { zp_colored_print(id, "You can't buy extra items on nemesis round!") return; } if(!is_user_alive(id)) { zp_colored_print(id, "%L", id, "CANT_BUY_ITEMS_DEAD") return; } zp_items_show_menu(id) } else zp_colored_print(id, "%L", id, "CMD_NOT_EXTRAS") } zp 4.3: case 1: // Extra Items { // Items enabled? if (LibraryExists(LIBRARY_ITEMS, LibType_Library)) { if(!zp_has_round_started()) { zp_colored_print(id, "You can't buy extra items when round not started!") return; } if(zp_is_assassin_round() || zp_is_nemesis_round()) { if(zp_is_assassin_round()) zp_colored_print(id, "You can't buy extra items on assassin round!") else zp_colored_print(id, "You can't buy extra items on nemesis round!")
} else zp_colored_print(id, "%L", id, "CMD_NOT_EXTRAS") } zp50_main_menu.sma(32) : warning 201: redefinition of constant/macro (symbol "ZP_PREFIX") zp50_main_menu.sma(224) : warning 209: function "menu_main" should return a value zp50_main_menu.sma(226) : error 076: syntax error in the expression, or invalid function call zp50_main_menu.sma(229) : warning 209: function "menu_main" should return a value zp50_main_menu.sma(231) : error 076: syntax error in the expression, or invalid function call zp50_main_menu.sma(234) : warning 209: function "menu_main" should return a value zp50_main_menu.sma(239) : warning 209: function "menu_main" should return a value zp50_main_menu.sma(290) : error 078: function uses both "return" and "return <value>"
3 Errors.
Idk why the erros because i changed AssassinMode, NemesisMode to zp_is_assassin_round, zp_is_nemesis_round?
// Event Round Start public event_round_start() { // Show main menu message remove_task(TASK_WELCOMEMSG) set_task(2.0, "task_welcome_msg", TASK_WELCOMEMSG) }
// Welcome Message Task public task_welcome_msg() { client_print(0, print_chat, "[ZoD*|] Welcome To ZoD*| Zombie Plague", ZP_VERSION_STR_LONG) }
public clcmd_chooseteam(id) { if (flag_get(g_ChooseTeamOverrideActive, id)) { show_menu_main(id) return PLUGIN_HANDLED; }
// Event Round Start public event_round_start() { // Show main menu message remove_task(TASK_WELCOMEMSG) set_task(2.0, "task_welcome_msg", TASK_WELCOMEMSG) }
// Welcome Message Task public task_welcome_msg() { client_print(0, print_chat, "[ZoD*|] Welcome To ZoD*| Zombie Plague", ZP_VERSION_STR_LONG) }
public clcmd_chooseteam(id) { if (flag_get(g_ChooseTeamOverrideActive, id)) { show_menu_main(id) return PLUGIN_HANDLED; }
that one will work fine but it's easy to avoid by writing /items to open the extra items, to solve it just remove those edits from the zp50_main_menu.sma go to zp50_items.sma add the include #include <zp50_gamemodes>
add x new variables for your modes new Mode1, Mode2 // and so on find public plugin_cfg(), if there is no one create it yourself and add the 2 lines, if there is one just add the 2 lines under whatever is there. public plugin_cfg() { Mode1 = zp_gamemodes_get_id("Nemesis Mode") Mode2 = zp_gamemodes_get_id("Assassin Mode") }
look for the public clcmd_items(id), it should look like this: public clcmd_items(id) { // Player dead if (!is_user_alive(id)) return; show_items_menu(id) }
change it to this: public clcmd_items(id) { // Player dead if (!is_user_alive(id)) return; if(zp_gamemodes_get_current() == ZP_NO_GAME_MODE) { client_print(id, print_chat, "[ZoD*|] You can't buy extra items when round not started!") return; } if(zp_gamemodes_get_current() == Mode1) { client_print(id, print_chat, "[ZoD*|] You can't buy extra items on Nemesis round!") return; } if(zp_gamemodes_get_current() == Mode2) { client_print(id, print_chat, "[ZoD*|] You can't buy extra items on Assassin round!") return; } show_items_menu(id) }
Now players can't abuse /items. you can keep the menu as it is with the edits and remove the client_print from the edits above.