21.07.2011, 04:17
I forgot to add the setting of the variable.
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))
{
lastvehicle[playerid] = GetPlayerVehicleID(playerid);
//Different vehicle
}
}
return 1;
}