Wanted level colors
#10

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.

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 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.
Reply


Messages In This Thread
Wanted level colors - by SnG.Scot_MisCuDI - 26.06.2012, 01:27
Re: Wanted level colors - by Dan_Barocu - 26.06.2012, 01:36
Respuesta: Wanted level colors - by Chris1337 - 26.06.2012, 01:39
Re: Wanted level colors - by MP2 - 26.06.2012, 02:36
Re: Wanted level colors - by SnG.Scot_MisCuDI - 26.06.2012, 05:00
Re: Wanted level colors - by Rokzlive - 26.06.2012, 06:18
Re: Wanted level colors - by SnG.Scot_MisCuDI - 29.06.2012, 02:04
Re: Wanted level colors - by Chris1337 - 29.06.2012, 02:48
Re: Wanted level colors - by SnG.Scot_MisCuDI - 30.06.2012, 01:05
Re: Wanted level colors - by ReneG - 30.06.2012, 01:46

Forum Jump:


Users browsing this thread: 1 Guest(s)