API ReferenceGE Extensionscareermodules
Vehicle Shopping
M.dependencies = {'career_career', 'util_configListGenerator'}
Dependencies
M.dependencies = {'career_career', 'util_configListGenerator'}Full vehicle marketplace for career mode. Generates dealership and private seller inventories, handles purchasing, trade-ins, insurance, vehicle spawning, and delivery.
Public API
| Function | Signature | Returns | Description |
|---|---|---|---|
M.openShop | (seller, originComputerId, screenTag) | nil | Opens the vehicle shopping UI |
M.endShopping | () | nil | Closes all shopping menus |
M.cancelShopping | () | nil | Returns to computer menu or closes |
M.showVehicle | (shopId) | nil | Inspects a vehicle from the shop |
M.quickTravelToVehicle | (shopId) | nil | Teleports to and inspects a vehicle |
M.navigateToPos | (pos) | nil | Sets ground marker navigation to position |
M.getShoppingData | () | table | Full shop data for UI (vehicles, dealerships, player attrs) |
M.getVehicleInfoByShopId | (shopId) | table/nil | Vehicle info by shop ID |
M.getVehiclesInShop | () | table | All vehicles currently in the shop |
M.updateVehicleList | (fromScratch) | nil | Regenerates shop inventory (expiry + new stock) |
M.getCurrentSellerId | () | string/nil | Currently active seller/dealership ID |
M.getVisualValueFromMileage | (mileage) | number | Visual condition multiplier (0.75–1.0) from mileage |
M.openPurchaseMenu | (purchaseType, shopId, insuranceId) | nil | Opens purchase confirmation UI |
M.buyFromPurchaseMenu | (purchaseType, options) | nil | Executes vehicle purchase |
M.cancelPurchase | (purchaseType) | nil | Cancels purchase flow |
M.updateInsuranceSelection | (insuranceId) | nil | Updates insurance choice in purchase flow |
M.sendPurchaseDataToUi | () | nil | Pushes purchase data to UI |
M.openInventoryMenuForTradeIn | () | nil | Opens inventory picker for trade-in selection |
M.removeTradeInVehicle | () | nil | Removes trade-in from current purchase |
M.buySpawnedVehicle | (buyVehicleOptions) | nil | Buys an already-spawned inspection vehicle |
M.getEligibleVehiclesWithoutDealershipVehicles | (eligible, seller) | table | Filters out vehicles already in dealership |
Hooks
| Hook | Purpose |
|---|---|
M.onVehicleSpawnFinished | Adds spawned vehicle to inventory |
M.onAddedVehiclePartsToInventory | Sets year, original parts, finalizes purchase |
M.onEnterVehicleFinished | Removes unused player vehicles after purchase |
M.onExtensionLoaded | Loads saved shop data from save slot |
M.onSaveCurrentSaveSlot | Persists shop data to save file |
M.onShoppingMenuClosed | Removes tether on menu close |
M.onComputerAddFunctions | Adds "Vehicle Marketplace" to computer |
M.onUpdate | Watches for expiring watched vehicles |
M.onUiChangedState | Tracks UI state for update gating |
M.onClientStartMission | Clears shop on mission start |
Key Constants
| Constant | Value | Description |
|---|---|---|
vehicleDeliveryDelay | 60s | Delivery time for distant purchases |
vehicleOfferTimeToLive | 600s | How long a vehicle stays in shop |
dealershipTimeBetweenOffers | 60s | Base interval for new stock |
salesTax | 7% | Tax rate applied to purchases |
customLicensePlatePrice | $300 | Cost of custom plate |
Price Rounding
| Type | Rule |
|---|---|
prestige | Round up to xxx495 or xxx995 |
private | Round up to nearest 100 |
dealer | Round up to nearest 20 |
| default | Round up to nearest 10 |
Usage Examples
-- Open the shop from a dealership
career_modules_vehicleShopping.openShop("usedCars_01")
-- Open from a computer terminal
career_modules_vehicleShopping.openShop(nil, computerId)
-- Get all vehicles currently for sale
local vehicles = career_modules_vehicleShopping.getVehiclesInShop()
for _, v in ipairs(vehicles) do
print(v.Brand, v.Name, v.Value)
endVehicle Performance
Runs the vehicle performance certification test (drag strip + skidpad). Records acceleration, braking, and lateral G data. Manages cinematic camera sequences during testing.
Career Branches Landing Page
Builds UI data for the career progress landing page - domain selection, branch skill cards, mission lists, facility data, and breadcrumb navigation.