Loop Problem
#1

Hi,

I have several loops in my script and have never had a problem with any of them before. I have since added a new loop which is exactly the same as the others besides the name. This loop just doesn't seem to be getting called at all.

Код:
//The cmd:
if (strcmp("/test", cmdtext, true, 5) == 0) {
    SetPlayerWantedLevel(playerid, 5);
    return 1;
}

//The forward:
forward WantedLevel();

//The timer:
SetTimer("WantedLevel", 500, 1);

//The loop:
public WantedLevel()
{
    for(new i=0; i<MAX_PLAYERS; i++)
	{
        if(IsPlayerConnected(i) && IsPlayerSpawned[i] == 1)
        {
	new wantedlevel = GetPlayerWantedLevel(i);

	if(wantedlevel == 0) SetPlayerToTeamColour(i);

	if(wantedlevel >= 1) SetPlayerColor(i, COLOR_WANTED);

        }
    }
}
I can't see a problem with that at all yet the loop never gets called for some reason. If anyone has any ideas it would be appreciated.

Thanks, Infamous.
Reply


Messages In This Thread
Loop Problem - by Infamous - 09.12.2010, 16:11
Re: Loop Problem - by Ash. - 09.12.2010, 16:55
Re: Loop Problem - by Infamous - 09.12.2010, 17:05
Re: Loop Problem - by rjjj - 09.12.2010, 17:33

Forum Jump:


Users browsing this thread: 1 Guest(s)