Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_TW_MAPS 28
- #define SendRconCommandF(%0,%1); UseBrackets\
- {\
- new formatstring[512];\
- format(formatstring,sizeof(formatstring),%0,%1);\
- SendRconCommand(formatstring);\
- }
- stock SetMostVotedMap()
- {
- new getVotes[MAX_TW_MAPS], mostVotes, pendingvotes = 1, storemapsarray[MAX_TW_MAPS];
- for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) if(GetPVarInt(playerid, "HasVoted") == 1) getVotes[GetPVarInt(playerid, "VoteMapID")]++;
- for(new i = 0; i < MAX_TW_MAPS; i++)
- {
- if(mostvotes < getVotes[i])
- {
- pendingvotes = 1;
- mostvotes = getVotes[i];
- storemapsarray[0] = i;
- for(new j = 1; j < MAX_TW_MAPS; j++) storemapsarray[j] = 0;
- }
- else if(mostvotes == getVotes[i])
- {
- storemapsarray[pendingvotes] = i;
- pendingvotes++;
- }
- }
- SendRconCommandF("changemode %s", MissionNames[storemapsarray[random(pendingvotes)]]};
- }
- MissionNames[][32] = {
- {"MorningSun"},
- {"2060"},
- {"Oil"},
- {"CJ"},
- {"Area69"},
- {"TunnelFighting"},
- {"StairFight"},
- {"CellWars"},
- {"AttackTheOutpost"},
- {"BeatTheCock"},
- {"NarrowBattle"},
- {"AvenueRide"},
- {"BackyardCombat"},
- {"Fire"},
- {"FasterThenFastest"},
- {"FasterThenFastest 2"},
- {"GunGame"},
- {"LoveForTheHood"},
- {"TeritorryWar4"},
- {"TeritorryWar"},
- {"PrisonBreak"},
- {"Maps"},
- {"PrisonBreak2"},
- {"TheAttack"},
- {"SkyLift"},
- {"BusinessTown"},
- {"ContainerWars"},
- {"OperationX"}
- };
Advertisement
Add Comment
Please, Sign In to add comment