SA-MP Forums Archive
Player loop doesnt work! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Player loop doesnt work! (/showthread.php?tid=362184)



Player loop doesnt work! - RedFusion - 23.07.2012

pawn Код:
public CWMessage(playerid)
{
    if(team1K == CwInfo[kill_limiter])
    {
        new string[64];
        format(string, sizeof(string),"* Team 1 Have Won With %i Kills! Team 2 had %i Kills.", team1K, team2K);
        SendClientMessageToAll(COLOR_ORANGE,string);
        SendClientMessageToAll(COLOR_ORANGE,"* The Kills for both teams have been reset automatically.");
        team1K = 0;
        team2K = 0;
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pCW] > 0)
            {
                TogglePlayerControllable(i, 0);
                SetTimer("Control", 7000, false);
                format(team1kills, sizeof(team1kills), "Team 1: %i / %i",team1K,CwInfo[kill_limiter]);
                format(team2kills, sizeof(team2kills), "Team 2: %i / %i",team2K,CwInfo[kill_limiter]);
                TextDrawSetString(TextdrawCW, team1kills);
                TextDrawSetString(TextdrawCW2, team2kills);
                TextDrawShowForPlayer(i, TextdrawCW);
                TextDrawShowForPlayer(i, TextdrawCW2);
            }
        }
    }
}
It's only freezing team 1!


Re: Player loop doesnt work! - leonardo1434 - 23.07.2012

pawn Код:
// how about this?
 if(team1K == CwInfo[kill_limiter])



Re: Player loop doesnt work! - RedFusion - 23.07.2012

That's exactly what i have..


Re: Player loop doesnt work! - Vince - 23.07.2012

pawn Код:
SetTimer("Control", 7000, false);
I suppose that should be SetTimerEx? Doesn't make much sense starting a bunch of timers in a loop.


Re: Player loop doesnt work! - RedFusion - 23.07.2012

Made some changes and now it doesnt freeze anyone..


Re: Player loop doesnt work! - leonardo1434 - 23.07.2012

Your code is quite confused, why don't post here the others functions that are interlinked with that?