Browse docs

Exports

Client and server exports provided by the Sky Mechanic Job resource.

This page documents supported public integration calls and usage examples. It does not expose or reproduce the resource's internal implementation.

Server Exports

All Advanced Pricing and Billing exports return a result table:

{
    success = true,
    data = {}
}

Rejected requests return success = false and a stable error code. Player identity, mechanic job, grade, permissions, vehicle distance, configured limits, quote state, invoice ownership, and monetary values are always resolved or validated on the server.

Advanced Pricing exports

ExportArgumentsPurpose
CreatePricingQuotesource, payloadCalculates a fresh server-authoritative quote for a nearby vehicle and configured tuning options
GetPricingQuotesource, orderIdReturns the saved quote data for an accessible workshop order
ValidatePricingQuotesource, orderId, vehicleNetIdValidates order state, expiry, proximity, procurement state, and quoted vehicle model
GetSupplierCatalogsourceReturns the authorized mechanic's current Dynasty catalog with server-calculated supplier prices
GetPricingAnalyticssource, periodDays?Returns workshop pricing analytics when the mechanic has billing-management permission

CreatePricingQuote(source, payload)

The caller supplies only the requested vehicle and tuning option identifiers. Client or integration values for vehicle price, supplier cost, labor, margin, tax, discount, grade, society, or final price are not accepted as authoritative.

server.lua
local result = exports["sky_mechanicjob"]:CreatePricingQuote(source, {
    vehicleNetId = NetworkGetNetworkIdFromEntity(vehicle),
    vehicleClass = 7,
    parts = {
        { id = "mod_11", value = 2 },
        { id = "mod_23", value = 4, wheelType = 7 }
    }
})

if result.success then
    print(("Server quote: $%s"):format(result.data.amount))
end

vehicleClass is only used as a validated compatibility fallback when the current server artifact cannot resolve the class from the networked vehicle. The server still validates the entity and the player's distance.

Reading and validating an order quote

server.lua
local quote = exports["sky_mechanicjob"]:GetPricingQuote(source, order_id)
if not quote.success then return end

local validation = exports["sky_mechanicjob"]:ValidatePricingQuote(
    source,
    order_id,
    vehicle_net_id
)

if validation.success then
    print("The quote is valid for this vehicle")
end

Only a mechanic belonging to the order's workshop can read or validate its quote.

Supplier catalog and analytics

server.lua
local catalog = exports["sky_mechanicjob"]:GetSupplierCatalog(source)
local analytics = exports["sky_mechanicjob"]:GetPricingAnalytics(source, 30)

The supplier catalog requires Parts Delivery access. Pricing analytics additionally require the billing-management permission and never accept a job name from the caller.

Advanced Billing exports

ExportArgumentsPurpose
CreateInvoicesource, payloadCreates a validated invoice for configured work, positions, or permitted manual lines
CreateEstimatesource, payloadCreates a time-limited estimate using the same validation and price boundaries
GetInvoicesource, invoiceIdReturns one invoice to its customer or an authorized workshop manager
GetPlayerInvoicessource, limit?Returns up to 100 invoices belonging to that player
PayInvoicesource, payloadPays the server-calculated balance or an allowed partial amount
RespondToEstimatesource, payloadAccepts or declines an estimate owned by the player
SendInvoiceRemindersource, payloadSends a permission- and cooldown-checked overdue reminder
CancelInvoicesource, payloadCancels an unpaid document when the mechanic grade permits it
GetBillingAnalyticssource, periodDays?Returns the authorized workshop's accounting summary

Creating an invoice or estimate

server.lua
local invoice = exports["sky_mechanicjob"]:CreateInvoice(source, {
    targetId = customer_source,
    plate = "ABC123",
    historyIds = { 481, 482 },
    customPositionKeys = { "diagnostics" },
    discountPercent = 5
})

local estimate = exports["sky_mechanicjob"]:CreateEstimate(source, {
    targetId = customer_source,
    manualItems = {
        {
            label = "Custom fabrication",
            category = "bodywork",
            costType = "labor",
            quantity = 2,
            unitPrice = 750
        }
    }
})

Manual positions, custom prices, discounts, document totals, and estimates must be enabled for the mechanic's grade. The customer must be online and within eight meters when targetId is used.

Reading and paying invoices

server.lua
local invoice = exports["sky_mechanicjob"]:GetInvoice(source, invoice_id)
local invoices = exports["sky_mechanicjob"]:GetPlayerInvoices(source, 25)

local payment = exports["sky_mechanicjob"]:PayInvoice(
    source,
    {
        invoiceId = invoice_id,
        paymentMethod = "card",
        amount = 500
    }
)

The server loads the invoice owner and outstanding balance, enforces the deposit and minimum partial payment, removes the money, deposits workshop funds, records the payment, and updates the status. Supplying a larger amount cannot overpay the invoice.

Estimate and management actions

server.lua
exports["sky_mechanicjob"]:RespondToEstimate(customer_source, {
    invoiceId = estimate_id,
    accepted = true
})
exports["sky_mechanicjob"]:SendInvoiceReminder(mechanic_source, {
    invoiceId = invoice_id
})
exports["sky_mechanicjob"]:CancelInvoice(mechanic_source, {
    invoiceId = invoice_id,
    reason = "Created by mistake"
})

local analytics = exports["sky_mechanicjob"]:GetBillingAnalytics(mechanic_source, 30)
These are server exports. Do not proxy them through an unvalidated RegisterNetEvent. If a client UI needs an action, let the existing Mechanic callbacks perform the server-side validation.

RepairVehicle(netId, reason?)

  • Purpose: Fully repairs a networked vehicle, realistic wheel damage, and all diagnostic wear.
  • Arguments:
    • netId (number) - FiveM network ID of the vehicle. Required.
    • reason (string?) - optional integration reason included in history and event payloads.
  • Returns:
    • boolean - true when the repair was accepted.
    • table | string - repair result on success or an error code on failure.

Saved vehicle properties, Stance, custom engine sound, Nitro, and other tuning are preserved.

server.lua
local success, result = exports["sky_mechanicjob"]:RepairVehicle(vehicle_net_id, "garage_service")

if not success then
    print(("Vehicle repair failed: %s"):format(result))
end

RepairWheelDamage(netId, reason?)

  • Purpose: Repairs only realistic wheel damage for a networked vehicle.
  • Arguments:
    • netId (number) - FiveM network ID of the vehicle. Required.
    • reason (string?) - optional integration reason returned in the result.
  • Returns:
    • boolean - true when the repair was accepted.
    • table | string - repair result on success or an error code on failure.
server.lua
local success, result = exports["sky_mechanicjob"]:RepairWheelDamage(
    vehicle_net_id,
    "roadside_assistance"
)

if not success then
    print(("Wheel repair failed: %s"):format(result))
end

GetVehicleCondition(plate)

  • Purpose: Returns the saved mileage and all diagnostic wear values for a vehicle.
  • Arguments:
    • plate (string) - vehicle plate text. Required.
  • Returns: table | nil - a table containing plate, mileage, and wear, or nil for invalid input or a database failure.
server.lua
local condition = exports["sky_mechanicjob"]:GetVehicleCondition("ABC123")

if condition then
    print(("Mileage: %s, engine oil: %.1f%%"):format(
        condition.mileage,
        condition.wear.engine_oil
    ))
end

GetVehicleWear(plate)

  • Purpose: Returns all saved diagnostic wear values for a vehicle.
  • Arguments:
    • plate (string) - vehicle plate text. Required.
  • Returns: table | nil - the wear table, or nil for invalid input or a database failure.
server.lua
local wear = exports["sky_mechanicjob"]:GetVehicleWear("ABC123")

if wear then
    print(("Brake pads: %.1f%%"):format(wear.brake_pads))
end

RepairVehicleWear(plate, parts?, reason?)

  • Purpose: Repairs all or selected diagnostic wear without changing physical vehicle damage or tuning.
  • Arguments:
    • plate (string) - vehicle plate text. Required.
    • parts (table?) - optional list or keyed table of wear part IDs. Omit it to repair every part.
    • reason (string?) - optional integration reason included in history and event payloads.
  • Returns:
    • boolean - true when the wear values were saved.
    • table | string - repair result on success or an error code on failure.
server.lua
local success, result = exports["sky_mechanicjob"]:RepairVehicleWear("ABC123", {
    "engine_oil",
    "brake_pads"
}, "service_invoice")

if not success then
    print(("Wear repair failed: %s"):format(result))
end

Supported wear part IDs are tyres, brake_pads, suspension, spark_plugs, engine_oil, coolant, brake_fluid, transmission_fluid, clutch, air_filter, traction_battery, inverter, and catalytic_converter.

IsVehicleModified(plate)

  • Purpose: Checks whether saved mechanic tuning properties exist for a vehicle.
  • Arguments:
    • plate (string) - vehicle plate text. Required.
  • Returns: boolean - true when saved tuning properties exist.
server.lua
local modified = exports["sky_mechanicjob"]:IsVehicleModified("ABC123")

if modified then
    print("Vehicle has saved mechanic tuning")
end

GetVehicleTuning(plate)

  • Purpose: Returns the saved vehicle tuning properties for the supplied plate.
  • Arguments:
    • plate (string) - vehicle plate text. Required.
  • Returns: table | nil - the decoded tuning properties, or nil if no record exists.
local tuning = exports["sky_mechanicjob"]:GetVehicleTuning("ABC123")

if tuning then
    print(json.encode(tuning))
end

GetVehicleMileage(plate)

  • Purpose: Returns the saved vehicle mileage for the supplied plate.
  • Arguments:
    • plate (string) - vehicle plate text. Required.
  • Returns: number | nil - the saved mileage, or nil if no mileage record exists.
local mileage = exports["sky_mechanicjob"]:GetVehicleMileage("ABC123")

if mileage then
    print(("Mileage: %s"):format(mileage))
end

Fake plate server exports

These calls let server-side garage and Police integrations resolve, clear, persist, and restore fake-plate state:

ExportArgumentsReturnsPurpose
GetFakePlateStatenetIdtable | nilReturns the current vehicle fake-plate statebag data
ResolveRealPlateForPolicenetId, officerSource?, shouldAudit?table | nilReturns real/display identity and optionally writes the VIN-check audit
ClearFakePlatenetId, reason?booleanRemoves the fake plate and restores the real plate
RestoreFakePlateStatenetId, state, reason?boolean, table | stringValidates and restores persisted fake-plate state
ResolveRealPlateForGarageStorenetIdtable | nilReturns the real/display plate and configured garage-reset policy
local resolved = exports["sky_mechanicjob"]:ResolveRealPlateForGarageStore(net_id)

if resolved then
    print(("Store vehicle under real plate %s"):format(resolved.realPlate))
end

See Fake Plate Integration for the required consumer fxmanifest.lua, the native/helper alternatives, and the complete garage storage and restore lifecycle.

Carry-item server exports

The physical carry-item integration exposes these server calls:

ExportArgumentsReturnsPurpose
ShouldCarryStorageItemitemNamebooleanChecks whether an item uses the physical carry workflow
CanReceiveCarryItemsource, itemNamebooleanChecks whether a player can receive that carried item
GiveCarryItemFromStoragesource, itemName, metadatabooleanPlaces a configured carry item in the player's carry state
ConsumeCarryItemsource, itemNamebooleanConsumes the matching carried state after installation or deposit
HasCarryItemsource, itemNamebooleanChecks whether the player currently carries the matching item
if exports["sky_mechanicjob"]:CanReceiveCarryItem(source, "engine") then
    exports["sky_mechanicjob"]:GiveCarryItemFromStorage(source, "engine", {})
end

Client Exports

Fake plate client exports

ExportArgumentsReturnsPurpose
GetDisplayPlatevehiclestringReturns the normalized plate displayed on the vehicle
GetRealPlatevehiclestringReturns the normalized persistent real plate
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local real_plate = exports["sky_mechanicjob"]:GetRealPlate(vehicle)
local display_plate = exports["sky_mechanicjob"]:GetDisplayPlate(vehicle)

Police-facing interfaces normally use display_plate; ownership and garage lookups use real_plate.

Nitro HUD exports

The Nitro runtime exposes these client calls for external HUDs and vehicle scripts:

ExportArgumentsReturnsPurpose
GetNitroStatevehicle?tableReturns the complete Nitro state for the supplied vehicle or the player's current vehicle
HasNitrovehicle?booleanChecks whether usable Nitro is installed
IsNitroActivevehicle?booleanChecks whether Nitro is currently boosting and consuming
local nitro = exports["sky_mechanicjob"]:GetNitroState()

if nitro.installed then
    print(("Nitro: %.1f%%"):format(nitro.percent))
end

For live updates, listen to the local sky_mechanicjob:nitroStateChanged client event. See External Nitro HUD for all payload fields and a complete NUI example.

GetVehicleMileage(vehicleOrPlate)

  • Purpose: Returns the saved vehicle mileage for the supplied vehicle or plate.
  • Arguments:
    • vehicleOrPlate (number | string) - vehicle entity handle or vehicle plate text. Required.
  • Returns: number | nil - the saved mileage, or nil if no mileage record exists.
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local mileage = exports["sky_mechanicjob"]:GetVehicleMileage(vehicle)

if mileage then
    print(("Mileage: %s"):format(mileage))
end

getRadialActions()

  • Purpose: Returns the currently available mechanic radial actions for the active install flow.
  • Returns: table[] - radial action definitions used by sky_jobs_base.

Typical action IDs include:

  • access_lift
  • open_hood
  • take_engine_hoist
  • attach_engine_hoist
  • engine_swap
  • install_order_part
  • sand_vehicle
  • paint_vehicle
  • car_jack
  • detach_wheel
  • attach_wheel
  • remove_car_jack
local actions = exports["sky_mechanicjob"]:getRadialActions()

triggerRadialMenuAction(actionId)

  • Purpose: Executes a supported mechanic radial action programmatically.
  • Arguments:
    • actionId (string) - one of the radial action IDs exposed by getRadialActions().
  • Returns:
    • boolean - true on success, false on failure.
    • table? - optional error payload with key and fallback.
local ok, err = exports["sky_mechanicjob"]:triggerRadialMenuAction("access_lift")

if not ok and err then
    print(err.fallback)
end

TryDepositCarryItemToStorage(stationId)

Attempts to deposit the currently carried mechanic item or nearby delivery pallet into the selected workshop storage. Returns true when the export handled a matching carry/delivery state and false when there was nothing to deposit.

local handled = exports["sky_mechanicjob"]:TryDepositCarryItemToStorage(stationId)

SetFluidLeakProvider(resourceName, serverEvent)

Overrides the configured vehicle-fluid provider for the current client. The provider resource must be started, and its server event must accept the documented vehicle-fluid payload. Returns false when either argument is empty.

local success = exports["sky_mechanicjob"]:SetFluidLeakProvider(
    GetCurrentResourceName(),
    "my_spill_resource:createFromVehicle"
)

ResetFluidLeakProvider()

Clears the runtime override and restores Config.OilLeaks.integration.

exports["sky_mechanicjob"]:ResetFluidLeakProvider()

See Vehicle Fluid Leaks for the provider payload and complete setup.

The mechanic script also depends heavily on sky_jobs_base and inherits its shared systems for creator placement, garages, storage, dispatch, and salary controls.

See the Sky Jobs Base Server Exports page for shared integrations like dispatch creation, external garage registration, and salary pause/resume.

Support

Need help? Our support team is always ready to assist

Join Discord