If vehicle has passengers?
#2

Yes its possible, you should loop through all the connected players and check their vehicle ID

pawn Код:
stock IsVehiclePassengerOccupied(vehicleid)
{
    for(new i = 0: i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid && GetPlayerVehicleSeat(i) != 0)
            return true;
    }
    return false;
}
Thats function will return true there is a passenger in that vehicle, false otherwise
Reply


Messages In This Thread
If vehicle has passengers? - by ajwar - 16.06.2013, 20:34
Re: If vehicle has passengers? - by OrMisicL - 16.06.2013, 20:40
Re: If vehicle has passengers? - by ajwar - 16.06.2013, 20:47

Forum Jump:


Users browsing this thread: 1 Guest(s)