Skip to content

@nextvm/vehicle

First-party vehicle module. Tracks owned vehicles per character and exposes RPC procedures for spawning, despawning, repairing, and listing.

Install

bash
pnpm add @nextvm/vehicle
typescript
modules: ['@nextvm/vehicle']

Dependencies

typescript
dependencies: ['player']

Config

FieldTypeDefaultDescription
maxOwnedVehiclesint (0–100)5Maximum vehicles a character can own

State

vehicleState:

FieldTypeDefault
ownedNetIdsnumber[][]

RPC procedures

ProcedureTypeInputDescription
spawnmutation{ modelHash, x, y, z, heading? }Spawns a vehicle, adds the netId to ownership
despawnmutation{ netId }Despawns an owned vehicle
repairmutation{ netId }Repairs an owned vehicle
getMyVehiclesqueryReturns the calling player's owned netIds

Server-authoritative ownership

All ownership checks happen server-side. The despawn and repair procedures verify that the calling character owns the netId before proceeding — clients can't despawn other players' cars.

See also

Released under the LGPL-3.0 License.