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.