Get the vehicle ID the player was last in?
#3

pawn Код:
//Above your script:
new LastPlayerInVec[MAX_VEHICLES] = (-1);

//Callback OnPlayerExitVehicle:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(GetPlayerState(playerid) == 2) // Is he/she the driver?
        LastPlayerInVec[vehicleid] = playerid;
    return 1;
}

//The function
stock GetLastPlayerInVehicle(vehicleid)
{
    if(LastPlayerInVec[vehicleid] != -1) //Did someone entered it?
        return LastPlayerInVec[vehicleid];
    return 0;
}
Try this ^^

[EDIT]
Damn bmuk was faster
Reply


Messages In This Thread
Get the vehicle ID the player was last in? - by TheHoodRat - 22.11.2010, 18:59
Re: Get the vehicle ID the player was last in? - by BMUK - 22.11.2010, 19:02
Re: Get the vehicle ID the player was last in? - by Kwarde - 22.11.2010, 19:03
Re: Get the vehicle ID the player was last in? - by TheHoodRat - 22.11.2010, 19:05

Forum Jump:


Users browsing this thread: 2 Guest(s)