VehicleClient

getVehicleNumberOfPassengers

GET_VEHICLE_NUMBER_OF_PASSENGERS0x24CB2137731FFE89

The 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.

SignatureJavaScript
getVehicleNumberOfPassengers(
  vehicle: Vehicle,
  includeDriver: boolean,
  includeDeadOccupants: boolean
): number
SignatureLua
getVehicleNumberOfPassengers(
  vehicle: Vehicle,
  includeDriver: boolean,
  includeDeadOccupants: boolean
): integer

Usage

JavaScript
const result = getVehicleNumberOfPassengers(vehicle, includeDriver, includeDeadOccupants);
Lua
local result = getVehicleNumberOfPassengers(vehicle, includeDriver, includeDeadOccupants)

Parameters

ParameterTypeJavaScriptLua
vehicleVehiclenumberinteger
includeDriverBOOLbooleanboolean
includeDeadOccupantsBOOLbooleanboolean

Returns

int JavaScript number, Lua integer

Notes

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

Open in the interactive natives reference