getVehicleNumberOfPassengers
GET_VEHICLE_NUMBER_OF_PASSENGERS0x24CB2137731FFE89The GTA V native GET_VEHICLE_NUMBER_OF_PASSENGERS of the VEHICLE namespace, as LS:MP client scripts call it: the global function getVehicleNumberOfPassengers, in JavaScript and in Lua.
getVehicleNumberOfPassengers(
vehicle: Vehicle,
includeDriver: boolean,
includeDeadOccupants: boolean
): numbergetVehicleNumberOfPassengers(
vehicle: Vehicle,
includeDriver: boolean,
includeDeadOccupants: boolean
): integerUsage
JavaScript
const result = getVehicleNumberOfPassengers(vehicle, includeDriver, includeDeadOccupants);Lua
local result = getVehicleNumberOfPassengers(vehicle, includeDriver, includeDeadOccupants)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
vehicle | Vehicle | number | integer |
includeDriver | BOOL | boolean | boolean |
includeDeadOccupants | BOOL | boolean | boolean |
Returns
int JavaScript number, Lua integerNotes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Gets the number of passengers.
This native was modified in b2545 to take two additional parameters, allowing you to include the driver or exclude dead passengers.
To keep it working like before b2545, set includeDriver to false and includeDeadOccupants to true.
Reference
- Namespace
- Vehicle VEHICLE
- In the game
int GET_VEHICLE_NUMBER_OF_PASSENGERS(Vehicle vehicle, BOOL includeDriver, BOOL includeDeadOccupants)- Hash
0x24CB2137731FFE89