SA-MP Forums Archive
GetLastPlayerVehicle - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetLastPlayerVehicle (/showthread.php?tid=196332)



GetLastPlayerVehicle - ajwar - 05.12.2010

Any one have idea's how to make such function?


Re: GetLastPlayerVehicle - woot - 05.12.2010

pawn Код:
// Note: Doesn't work when falling off a bike (-> wiki)
//
// Somewhere before OnPlayerExitVehicle & outside functions / callbacks
new
    last_vehicle [ MAX_PLAYERS ]
    ;
   
// Add / edit the callback
public OnPlayerExitVehicle(playerid, vehicleid)
{
    last_vehicle [ playerid ] = vehicleid;
    return 1;
}

// The function.
stock GetLastPlayerVehicle( playerID )
{
    return last_vehicle [ playerid ];
}