Voting problem
#7

Quote:
Originally Posted by Hijolion
Посмотреть сообщение
It's very radical in my mind, why isn't this working like it supposed to ?
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.
Reply


Messages In This Thread
Voting problem - by Hijolion - 01.10.2010, 00:26
Re: Voting problem - by Kitten - 01.10.2010, 01:16
Re: Voting problem - by Hijolion - 01.10.2010, 02:07
Re: Voting problem - by Kitten - 01.10.2010, 03:47
Re: Voting problem - by Toni - 01.10.2010, 04:05
Re: Voting problem - by Hijolion - 02.10.2010, 17:06
Re: Voting problem - by samgreen - 02.10.2010, 17:15
Re: Voting problem - by Hijolion - 02.10.2010, 23:54
Re: Voting problem - by Hijolion - 03.10.2010, 17:22
Re: Voting problem - by Conroy - 03.10.2010, 17:32

Forum Jump:


Users browsing this thread: 1 Guest(s)