08.06.2012, 13:36
Quote:
Oh forgot to mention i need to check if the player is not in vehicle but checking last vehicle he entered
|
pawn Code:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT ) // when player exits the vehicle
{
SetPVarInt( playerid, "LASTVEHICLE", GetVehicleModel( GetPlayerVehicleID( playerid ) ) );
}
return 1;
}
// now the following code wherever you want:-
if( GetPvarInt( playerid, "LASTVEHICLE" ) == 411 ) // MODEL_ID can be replaced with your own vehicle model like "411" is infernus
{
SendClientMessage( playerid, -1, "You are in infernus, enjoy!" );
}