API ReferenceGE Extensionscareermodules
Loaner Vehicles
M.dependencies = {"util_stepHandler"}
Dependencies
M.dependencies = {"util_stepHandler"}Manages loaner (rental) vehicles from organizations. Handles spawning loaned vehicles at facilities, tracking walk-away timeouts, returning vehicles with reputation penalties for damage, and formatting UI data.
Internal State
| Field | Type | Description |
|---|---|---|
M.spawnAndLoanVehicle | varies | Assigned as spawnAndLoanVehicle |
Public API
| Function | Signature | Description |
|---|---|---|
M.markForSpawning | (offer) | Toggle-mark a loaner offer for batch spawning |
M.unmarkAllForSpawning | () | Clear all marked loaner offers |
M.spawnAllOffers | () | Spawn all marked loaners with fade sequence |
M.returnVehicle | (inventoryId, callback) | Return loaned vehicle, apply damage reputation penalty |
M.getLoanedVehiclesByOrg | (organizationId) → table | Get loaned vehicles for an organization |
M.getLoaningOrgsOfVehicle | (vehId) → table | Get organizations that own a vehicle/trailer |
M.formatLoanerOfferForUi | (facility) → table | Format available loaner offers for UI |
M.formatSpawnedLoanersForUi | () → table | Format currently spawned loaners for UI |
Hook Handlers
| Hook | Purpose |
|---|---|
M.onUpdate | Monitor walk-away distance from loaned vehicles |
M.onVehicleAdded | Track vehicle addition during spawn sequence |
Walk-Away Timer
When a player moves >100m from a loaned work vehicle:
- Warning message shown immediately
- 300-second countdown starts
- At 60 seconds remaining, second warning shown
- At 0 seconds, vehicle auto-returned to owner
- Coming within 95m cancels the timer
Loaner Offer Disable Reasons
| Reason | Description |
|---|---|
noSpace | No free parking spots at facility |
limit | Already have a loaned non-trailer from this org |
locked (reputation) | Requires higher reputation level |
locked (delivery) | Requires higher delivery skill level |