31.08.2010, 16:31
Hello,
Is it possible to check for vehicle passengers?
Regards, Jochem
Is it possible to check for vehicle passengers?
Regards, Jochem
for(new i = 0; i < MAX_PLAYERS; i++) // Scans from 1-Max player slots { if(IsPlayerConnected(i)) // Checks for all connected IDs { if(GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid) && i != playerid) // Makes sure the connected IDs are in the car and is not the person that typed /park { SetPlayerInterior(i, [INTERIOR]); // Sets interior of the player found in the vehicle } } }
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;
}