new gMode_Swarm, gMode_Nemesis, gMode_Survivor, gMode_Sniper, gMode_Armageddon; new gMode_Dragon, gMode_Nightcrawler, gMode_Plague, gMode_Knifer, g_NormalID, g_MultiID, gMode_Plasma, gMode_Winos;
#if defined CUSTOM_MODS new gMode_Tag, gMode_Hunt, gMode_Canni, gMode_HotPotato, gMode_InfectionWar, gMode_DM #endif
new gVoteText[124], AdminName[32], ModeName[64], SelectedName[32], gParticipateText[128], gSelectedMode new gVoteIn[33], gVoteOut[33], gAlreadyVoted[33], iParticipating[33], iTotalParticipations, SelectedPlayer new gVoteYes[64], gVoteNo[64] new gYesCount, gNoCount, gVoteOnGoing, gSpecialRound, gNextRoundShouldBe, OldMode, iRandom, iPlayers new vMenu new iCount = 11; new Trie:g_tAuthIdBlackList // g means global; t means trie new AuthID[ 35 ] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_tAuthIdBlackList = TrieCreate( ) // Create the trie... register_clcmd("say /votemode", "Pre_AdminSelectMode") register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
if(gVoteOut[id] == 1) { format(gVoteYes, charsmax(gVoteYes), "Yes \y[%d]^n", gYesCount) format(gVoteNo, charsmax(gVoteNo), "No \y[%d] \r(Selected)^n", gNoCount) } if( !TrieKeyExists( g_tAuthIdBlackList, AuthID ) ) { if(iParticipating[id] == 0) format(gParticipateText, charsmax(gParticipateText), "Play as the \r%s Special \y[NO]\r^n^n\rCurrentlly \y%d Players \rparticipating^n", ModeName, iTotalParticipations) else
format(gParticipateText, charsmax(gParticipateText), "Play as the \y%s Special \r[YES]\r^n^n\rCurrentlly \y%d Players \rparticipating^n", ModeName, iTotalParticipations) } else format(gParticipateText, charsmax(gParticipateText), "\dPlay as the %s Special \y[NEXT MAP]\r^n^n\rCurrentlly \y%d Players \rparticipating^n", ModeName, iTotalParticipations)
} public Pre_AdminSelectMode(id) { zp_gamemodes_get_name(gSelectedMode, ModeName, charsmax(ModeName)) new get_cm = zp_gamemodes_get_current() if(get_user_flags(id) & ADMIN_KICK) { if(gSpecialRound == 0) { if(gVoteOnGoing == 0) { if(get_cm == g_MultiID || get_cm == g_NormalID) { AdminSelectMode(id) } else zp_colored_print(id, "You can only vote for a special round during an infecton round") } else zp_colored_print(id, "Please wait till the current vote ends") } else zp_colored_print(id, "Next round is voted to be %s. please try again later", ModeName) } else zp_colored_print(id, "Special Round Votes can be only started by admins and above") } public AdminSelectMode(id) { new Menu = menu_create(TITLE, "SelectedMode")
mod ids start with 0, below is -1 for ZP_INVALID_GAME_MODE, -2 for ZP_NO_GAME_MODE. anything below 0 and above your gamemode count is defined as error. you can do a simple fix: new ModeName[33] if(zp_gamemodes_get_chosen() < 0) return; zp_gamemodes_get_name(zp_gamemodes_get_chosen(), ModeName, 32)