This won't work?
#7

That wouldn't work unfortunately, that if statement is basically saying if they were onfoot, and entered as a driver as a civilian, set their wanted level up. OR if they are a Gypsy, set their wanted level up no matter what.

The correct code would be:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) //They entered as driver
    {
        if(gTeam[playerid] == TEAM_CIVILIANS || gTeam[playerid] == TEAM_GYPSIES) //If they are Civ or Gyp
        {
            switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
            {
                case 427, 470, 490, 497, 523, 528, 597, 599, 601:
                {
                    new string[35];
                    SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+1);
                    new wantedlevel; wantedlevel = GetPlayerWantedLevel(playerid); //This line should be placed AFTER you set the wanted level, otherwise it will just read the original wanted level.
                    format(string, sizeof(string),"[WANTED] Your wanted is now %d.", wantedlevel);
                    SendClientMessage(playerid, COLOR_ACHIEVEMENT, string);
                }
            }
        }
    }
    return 1;
}
EDIT: Nevermind, just realised the bracket.
Reply


Messages In This Thread
This won't work? - by jNkk - 23.12.2012, 21:13
Re: This won't work? - by park4bmx - 23.12.2012, 21:23
Re: This won't work? - by jNkk - 23.12.2012, 21:29
Re: This won't work? - by park4bmx - 23.12.2012, 21:32
Re: This won't work? - by jNkk - 23.12.2012, 22:00
Re: This won't work? - by [HiC]TheKiller - 23.12.2012, 22:08
Re: This won't work? - by Threshold - 24.12.2012, 03:59

Forum Jump:


Users browsing this thread: 1 Guest(s)