How do I do this?
#1

How do I do this
Example: Check when everybody is gTeam[playerid] == TEAM_ZOMBIE
Then will auto restart round:
pawn Код:
SendRconCommand("gmx");
Not very good at this.

Thanks
Reply
#2

Can you elaborate a bit more please?

You want the server to restart IF there's a zombie online?
Reply
#3

Means like when everybody is infected. No more humans left. And it will auto restart.
Reply
#4

pawn Код:
stock NewRound()
{
    new count, count2;
    for (new i = 0; i < MAX_PLAYERS; i ++)
    {
        if (IsPlayerConnected(i)) count++;
        if (gTeam[i] == TEAM_ZOMBIE) count2++;
    }
    if (count1 == count2)
    {
        SendRconCommand("gmx");
    }
    return 1;
}
That's a function. Add it into the bottom of your script. Then you can do something like this:

pawn Код:
CMD:newround(playerid, params[])
{
    NewRound();
    return 1;
}
Reply
#5

Edited
Reply
#6

Shit. Try this:

pawn Код:
stock NewRound()
{
    new count, count2;
    for (new i = 0; i < MAX_PLAYERS; i ++)
    {
        if (IsPlayerConnected(i) && gTeam[i] != TEAM_ZOMBIE) count++;
    }
    for (new i = 0; i < MAX_PLAYERS; i ++)
    {
        if (IsPlayerConnected(i) && gTeam[i] == TEAM_ZOMBIE) count2++;
    }
    if (count == count2)
    {
        SendRconCommand("gmx");
    }
    return 1;
}
Reply
#7

^^

Dude there is no count1 in the stock

Change count1 to count.
Reply
#8

Thanks for reminding me!

TAKE THESE!

*throws 7 rep points at Romel*
Reply
#9

Can I add to OnGameModeInit?
Reply
#10

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Thanks for reminding me!

TAKE THESE!

*throws 7 rep points at Romel*
Thanks bro.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)