Quote:
Originally Posted by samgreen
Try this:
pawn Код:
forward votedmode(playerid); public votedmode(playerid) { new mapWinner, mostVotes = -1; for(new i; i < sizeof maps; i++) { if(maps[i] > mostVotes) { mapWinner = i; mostVotes = maps[i]; } }
switch (mapWinner) { case 0: { SendRconCommand("changemode wwx"); } case 1: { SendRconCommand("changemode jailbreak"); } case 2: { SendRconCommand("changemode mallmilitia"); } case 3: { SendRconCommand("changemode holywarfare"); } case 4: { SendRconCommand("changemode cstyles"); } case 5: { SendRconCommand("changemode killemall"); } case 6: { SendRconCommand("changemode factory"); } case 7: { SendRconCommand("changemode elitefighter"); } case 8: { SendRconCommand("changemode lssubway"); } case 9: { SendRconCommand("changemode dspeeders"); } case 10: { SendRconCommand("changemode mafiawar"); } case 11: { SendRconCommand("changemode pirateisland"); } case 12: { SendRconCommand("changemode boattheft"); } } print("Voted Mode Was Successfully Executed."); return 1; }
Also we probably need to see more code that involves the maps array.
|
That works, but when my timer calls the function, the mode changes to the first map. Is there way to ignore it?