CyberM.vehicles.all()
Lists every vehicle currently streamed to this client.
Requires vehicles.read. Returns an empty array when permission or the projection backend is unavailable. Every entry has the exact shape returned by CyberM.vehicles.get; server vehicles outside the client's streaming interest set are intentionally absent.
Returns
- array of vehicle snapshots
Registered in ResourceHost.cpp as LuaVehiclesAll (line 6691).
CyberM.vehicles.get(id)
Reads one streamed server-owned vehicle.
Client read-only API requiring vehicles.read. The snapshot contains durable state (health, flags, six door bits, four open-window bits, tyre/glass/light masks and the 30-cell body grid), authority and occupants, an ephemeral generation-checked local entity handle, plus the latest drivetrain and wheel telemetry. Open windows and broken glass are separate states. Creation, repair and arbitrary mutation are server-only; the complete 43-method server surface is documented in wiki/vehicles.md.
Returns
- table { id, record, entity, engineEntity, revision, physicsOwner, authorityEpoch, flags, health, doors, windows, tires, bodyDamage, brokenGlass, brokenLights, damage, speed, rpm, rpmMax, throttle, brake, steering, wheelRotation, suspensionLongitudinal, suspensionTransversal, burnout, gear, onGround, reversing, streamed, locallyOwned, occupants }, or nil
Registered in ResourceHost.cpp as LuaVehicleGet (line 6690).
CyberM.vehicles.isDoorOpen(id, door)
Reads a canonical vehicle door, trunk, or hood state.
Client read-only API requiring vehicles.read. Accepts index 0..5, a standard camelCase/snake_case name, or a CyberM.vehicles.doors constant. This reads the replicated reversible opening mask.
Parameters
- idintegerrequired
- doorinteger|stringrequired
Returns
- boolean, or nil when denied, unavailable, or unknown
Registered in ResourceHost.cpp as LuaVehicleIsDoorOpen (line 6692).
CyberM.vehicles.isWindowOpen(id, window)
Reads a canonical openable side-window state.
Client read-only API requiring vehicles.read. Windows use indexes 0..3 and names frontLeft, frontRight, backLeft, and backRight. This does not report shattered glass; inspect brokenGlass or damage.glass in the vehicle snapshot for that.
Parameters
- idintegerrequired
- windowinteger|stringrequired
Returns
- boolean, or nil when denied, unavailable, or unknown
Registered in ResourceHost.cpp as LuaVehicleIsWindowOpen (line 6693).
CyberM.vehicles.taskPlayerEnterVehicle(playerId, vehicleId, seat)
Reserved animated presentation path for a replicated occupant.
Requires vehicles.presentation and an already-authorized occupancy tuple. The first native NPC MountAIEvent implementation could dereference an absent workspot object on remote player proxies, so this method currently fails closed with animated_entry_unsupported. Use warpPlayerIntoVehicle until the staged door/workspot implementation is validated on two clients.
Parameters
- playerIdinteger|stringrequired
- vehicleIdinteger|stringrequired
- seatstring|integerrequired
Returns
- false
- animated_entry_unsupported or another validation reason
Registered in ResourceHost.cpp as LuaVehicleTaskPlayerEnter (line 6695).
CyberM.vehicles.warpPlayerIntoVehicle(playerId, vehicleId, seat)
Presents a replicated player instantly in an authoritative vehicle seat.
Requires vehicles.presentation. This is a visual client operation for an existing server-owned vehicle and occupancy assignment; it does not claim the seat or physics authority. The exact (player, vehicle, seat) tuple must already exist in the replicated ledger or the call fails with occupancy_mismatch. Seats accept canonical names, common aliases, or FiveM-compatible -1..2 indices.
Parameters
- playerIdinteger|stringrequired
- vehicleIdinteger|stringrequired
- seatstring|integerrequired
Returns
- true on success, otherwise false
- reason
Registered in ResourceHost.cpp as LuaVehicleWarpPlayer (line 6694).