How to check for vehicle passengers
#7

With the native functions it is not possible.

But you could do something like this: (not tested)

pawn Код:
GetVehiclePassengers(vehicleid, &passengers[4])
{
    for(new i = 0; i < 4; i ++)
        passengers[i] = -1;
    for(new i = 0; i < MAX_PLAYERS; i ++)
        if(GetPlayerVehicleID(i) == vehicleid)
            passengers[GetPlayerVehicleSeat(i)] = i;
}
it should fill an array with the players on the seat 0-3 of vehicleid. If a seat is unoccupied, it returns -1 for the seat id.

EDIT: Paladin was faster, his code should fit perfectly to your needs
Reply


Messages In This Thread
How to check for vehicle passengers - by Jochemd - 31.08.2010, 16:31
Re: How to check for vehicle passengers - by Peter_Corneile - 31.08.2010, 16:36
Re: How to check for vehicle passengers - by Jochemd - 31.08.2010, 16:39
Re: How to check for vehicle passengers - by Jochemd - 31.08.2010, 16:48
Re: How to check for vehicle passengers - by Paladin - 31.08.2010, 17:20
Re: How to check for vehicle passengers - by Jochemd - 31.08.2010, 17:20
Re: How to check for vehicle passengers - by Mauzen - 31.08.2010, 17:22
Re: How to check for vehicle passengers - by Jochemd - 31.08.2010, 17:29
Re: How to check for vehicle passengers - by Mauzen - 31.08.2010, 17:43
Re: How to check for vehicle passengers - by Jochemd - 31.08.2010, 17:53

Forum Jump:


Users browsing this thread: 1 Guest(s)