last vehicle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: last vehicle (
/showthread.php?tid=475175)
last vehicle -
AnonScripter - 11.11.2013
can somebody tell me how to make LastVehicle system ?
when a player enter a vehicle, this vehicle will be the last vehicle
ex:
PutPlayerInVehicle(playerid, LastVehicle);
Re: last vehicle -
Loot - 11.11.2013
pawn Код:
new lastVehicle[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) // If the player's state changes to a vehicle state we'll have to spec the vehicle.
{
lastVehicle[playerid] = GetPlayerVehicleID(playerid);
}
return 1;
}