21.07.2011, 01:49
(
Последний раз редактировалось [HiC]TheKiller; 21.07.2011 в 04:16.
)
You could just use a basic variable to save the players last car. I take it you are doing this for a police car and a civilian is entering it for the second time.
pawn Код:
new lastvehicle[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
lastvehicle[playerid] = -1;
return 1;
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == 2)
{
if(lastvehicle[playerid] == GetPlayerVehicleID(playerid))
{
//Same vehicle
}
if(lastvehicle[playerid] != GetPlayerVehicleID(playerid))
{
//Different vehicle.
lastvehicle[playerid] = GetPlayerVehicleID(playerid);
if(GetVehicleModel(GetPlayerVehicleID(playerid) == /*Certain vehicle model*/)
{
//Set the player's wanted level!
}
}
}
return 1;
}