15.07.2010, 16:25
Save the vehicle ID & seat when the player exits the vehicle, and put him back in the vehicle when the state changes to PLAYER_STATE_ONFOOT.
pawn Код:
new veh_id[MAX_PLAYERS],
veh_seat[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_ONFOOT)
{
if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
{
PutPlayerInVehicle(playerid, veh_id[playerid], veh_seat[playerid]);
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
veh_id[playerid] = vehicleid;
veh_seat[playerid] = GetPlayerVehicleSeat(playerid);
return 1;
}