API ​
See the resource's docs/API.md for full argument and error details.
| Export | Caller | Purpose |
|---|---|---|
| RegisterVehicle(owner, plate, props, garageId) | vehicle owner resource | Create or refresh the garage assignment after the ESX ownership row exists. Does not spawn or transfer ownership. |
| AddVehicle(owner, { plate, model, garage, vehicleClass }) | configured np_dealership only | Assign a newly purchased vehicle to a compatible garage. If no compatible garage has room, the row stays delivery_pending. |
| RegisterOutVehicle(owner, plate, entity, vehicleClass, props) | configured np_dealership only | Adopt an already spawned pickup into np_vehiclehandler and mark it out. |
| GetVehicleStatus(plate) | read-only consumers | Return status, assigned garage, optional physical stall ID, and an optional custody display projection. |
| CanAccess(src, garageId, plate?, action?) | server integrations | Check a garage ACL and vehicle permission; action may be store or retrieve (default retrieve). This is a UI/availability check; the garage operation repeats all authorization and custody checks. |
| SetCustodyProjection(plate, projection) | np_impound only | Publish or clear display state. Does not release, charge, or change ownership. |
| MarkCustodySyncComplete() | np_impound only | Mark active custody records synchronized after startup. |
SetCustodyProjection requires a stable custodyId. Clear a projection with the exact released ID. A missing or stale ID cannot clear a newer hold. Garage client events are UI transport and are not a server integration API.
Missing-vehicle event ​
np_garages consumes the server-local np_vehiclehandler:entityLost event. After a delayed recheck of the handler record,
canonical ESX owner, sidecar transition, active custody, title reservation, indexed records, and live entities with the
plate, it marks an eligible out or parked vehicle missing. It removes the orphaned handler record through
np_vehiclehandler, frees any physical stall, preserves a last-known transform, keeps ESX stored false, and audits the
transition. It does not infer destroyed, create impound custody, or automatically respawn the vehicle.
Server resources may subscribe to the local event:
AddEventHandler('np_garages:vehicleMissing', function(data)
-- { plate, owner, status='missing', previousStatus, garageId,
-- reason='entity_lost', lastKnown={ x, y, z, heading, bucket }? }
end)
Pending reconciliation is persisted in np_garages_missing_events and retried after resource restarts. Startup remains
unavailable until the full queue is loaded. Per-plate writes and exact event tokens prevent an older retry from
replacing or deleting a newer event. Events stay queued while a dealership ownership reservation is active. The retry
queue also works when static-stall migration 005 is absent; only that migration adds the stall column. The garage
list and track action expose the missing status and last-known location. The vehicle remains unavailable until an
explicit recovery workflow is implemented by an authorized owner or provider. Startup creates the retry table from
sql/install.sql and upgrades a prior table without tokens; manually managed DDL uses migrations 006 and 007.
Static physical stalls ​
Configure a static garage with mode = 'stall' and stalls = { [id] = { x, y, z, radius } }. The server chooses the nearest configured stall containing the vehicle's live position. A successful park stores the stall ID and actual transform in the sidecar, reserves (garageId, stallId) uniquely, and updates the same persistent, always-present np_vehiclehandler record. Taking the vehicle out reuses that entity and requires valid location access, matching vehicle class and routing bucket, and the player within 8 meters of the car.
Stall retrieval skips the virtual spawn-point proximity check. Physical stalls do not accept garage transfers or phone valet delivery. Missing migration 005 or its unique index disables stall actions while virtual garages remain available. If np_impound requests custody, the stall stays reserved until handler suppression succeeds; a missing handler record plus a matching world entity returns an error until reconciled.
Optional housing provider v1 ​
Only np_housing registers registerGarageProvider('housing', provider). The provider supplies version=1, an exact compat table matching Config.Database, and server callbacks list(src), canUse(src, propertyId), and get(propertyId). The location is virtual and resolves to housing:<propertyId>; it does not provide spawn or despawn functions. np_housing calls PropertyGarage(src, 'list'|'store'|'take', propertyId, plate). Store resolves the driver's entity server-side. Every move checks property access, vehicle ownership/share rights, capacity, class, distance, active custody, reservation state and np_vehiclehandler readiness. A missing or non-nullable canonical garage column disables property movement.
Faction fleet visibility ​
When np_faction is running, the server may call GetFleetVehicles(src) to obtain display rows { id, faction, plate, label, model, state, class } scoped from that player's active or probation memberships. Holder and take-home character identifiers are omitted. The Fleet UI labels reported status and exposes no garage movement action. This export does not constitute an impound custody summary or grant store, checkout, transfer or release authority.
Dealer ownership receipts ​
The restricted dealer API includes BeginOwnershipTransfer, CommitOwnershipTransfer, and CancelOwnershipTransfer. Commit updates the sidecar owner and writes an exact-token receipt atomically. Replaying the same token, plate and new owner is safe after the reservation clears, including after a later hold arrives. Existing databases must apply 002_ownership_transfer_guard.sql and 003_ownership_transfer_receipts.sql before using the revised dealer recovery path.