isVehicleSeatFree
IS_VEHICLE_SEAT_FREE0x22AC59A870E6A669The GTA V native IS_VEHICLE_SEAT_FREE of the VEHICLE namespace, as LS:MP client scripts call it: the global function isVehicleSeatFree, in JavaScript and in Lua.
isVehicleSeatFree(
vehicle: Vehicle,
seatIndex: number,
isTaskRunning: boolean
): booleanisVehicleSeatFree(
vehicle: Vehicle,
seatIndex: integer,
isTaskRunning: boolean
): booleanUsage
JavaScript
const result = isVehicleSeatFree(vehicle, seatIndex, isTaskRunning);Lua
local result = isVehicleSeatFree(vehicle, seatIndex, isTaskRunning)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
vehicle | Vehicle | number | integer |
seatIndex | int | number | integer |
isTaskRunning | BOOL | boolean | boolean |
Returns
BOOL JavaScript boolean, Lua booleanNotes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Check if a vehicle seat is free.
seatIndex = -1 being the driver seat.
Use getVehicleMaxNumberOfPassengers(vehicle) - 1 for last seat index.
isTaskRunning = on true the function returns already false while a task on the target seat is running (taskEnterVehicle/taskShuffleToNextVehicleSeat) - on false only when a ped is finally sitting in the seat.
Reference
- Namespace
- Vehicle VEHICLE
- In the game
BOOL IS_VEHICLE_SEAT_FREE(Vehicle vehicle, int seatIndex, BOOL isTaskRunning)- Hash
0x22AC59A870E6A669