Loop only works for ID 0.
#1

My title says everything. My loop only works for ID 0. I've never had this before, so I thought I am going to post this.

This is one of the loops I am using:
pawn Код:
public GameEnd2()
{
    new string[128];
    format(string, sizeof(string), "Next map: {A52A2A}%s", GetMapName());
    for(new i; i < MAX_PLAYERS; i++)
    {
        TextDrawShowForPlayer(i, Textdraw0);
        TextDrawShowForPlayer(i, Textdraw1); // 1
        TextDrawShowForPlayer(i, Textdraw2); // 2
        TextDrawShowForPlayer(i, Textdraw3); // 3
        TextDrawShowForPlayer(i, Textdraw4); // 4
        TextDrawShowForPlayer(i, Textdraw5); // 5
        TextDrawShowForPlayer(i, Textdraw6);
        TextDrawShowForPlayer(i, Textdraw7);
        TextDrawShowForPlayer(i, Textdraw8);
        TextDrawShowForPlayer(i, Textdraw9);
        TextDrawShowForPlayer(i, Textdraw10);
        TextDrawShowForPlayer(i, Textdraw11);
        TextDrawShowForPlayer(i, Textdraw12);
        TextDrawShowForPlayer(i, Textdraw13);
        TextDrawShowForPlayer(i, Textdraw14);
        TextDrawShowForPlayer(i, Textdraw15);
        TextDrawShowForPlayer(i, Textdraw16);
        TextDrawShowForPlayer(i, Textdraw17);
        TextDrawShowForPlayer(i, Textdraw18);
        TextDrawShowForPlayer(i, Textdraw19);
        GameTextForPlayer(i, "~b~Game ended!~n~ ~r~Time's up", 5000, 3);
        SendClientMessageToAll(COLOR_YELLOW, string);
        SetTimerEx("SpawnThePlayer", 10000, false, "i", i);
        break;
    }
    SetTimer("NextMap", 10000, false);
    return 1;
}
It doesn't show me the textdraws if I'm ID 1 or higher. It only sends the textdraw and gametext to players with the ID 0.

(I do not have IsPlayerConnected because if there aren't players in the game, it should still end the game. I also tried IsPlayerConnected, it also failed.)
Reply


Messages In This Thread
Loop only works for ID 0. - by Biesmen - 26.02.2011, 15:13
Re: Loop only works for ID 0. - by MP2 - 26.02.2011, 15:14
Re: Loop only works for ID 0. - by Biesmen - 26.02.2011, 15:17
Re: Loop only works for ID 0. - by MP2 - 26.02.2011, 15:21
Re: Loop only works for ID 0. - by Biesmen - 26.02.2011, 15:27
Re: Loop only works for ID 0. - by MP2 - 26.02.2011, 15:30
Re: Loop only works for ID 0. - by Biesmen - 26.02.2011, 15:32
Re: Loop only works for ID 0. - by MP2 - 26.02.2011, 15:59
Re: Loop only works for ID 0. - by Biesmen - 26.02.2011, 16:03
Re: Loop only works for ID 0. - by bigcomfycouch - 26.02.2011, 16:16

Forum Jump:


Users browsing this thread: 3 Guest(s)