30.06.2012, 01:46
I'm not going to tell you to change your code to a different callback or w/e, but here is what is going wrong.
For this example I have a 0 wanted level.
You need to return after each statement to stop the code from running to the next check.
You should still move it to a different callback because you wouldn't want the OnPlayerUpdate code to stop before important code.
For this example I have a 0 wanted level.
pawn Код:
if(GetPlayerWantedLevel(playerid) <= 0)
{
// this code will be ran since I have
// a zero wanted level
SetPlayerColor(playerid, COLOR_WHITE);
}
else if(GetPlayerWantedLevel(playerid) <= 3)
{
// this code will ALSO be ran because
// the wanted level is still less than
// or equal to 3
SetPlayerColor(playerid, COLOR_YELLOW);
}
You should still move it to a different callback because you wouldn't want the OnPlayerUpdate code to stop before important code.