Exports

This page documents the available exports for interacting with the kartik-mechanic system from other scripts.


Client-Side Exports

GetMileage

Returns the current accumulated mileage of the player's vehicle in the current unit (Miles or KM).

local mileage = exports['kartik-mechanic']:GetMileage()
print("Current Mileage: " .. mileage)

ToggleHUD

Toggles the visibility of the mechanic HUD elements (Mileage, Gears, Nitro).

-- Hide HUD
exports['kartik-mechanic']:ToggleHUD(false)

-- Show HUD
exports['kartik-mechanic']:ToggleHUD(true)

OpenTuningTablet

Opens the Tuning Chip interface for the current vehicle (requires a Tuning Chip to be installed).


Server-Side Exports

GetVehicleMileage

Retrieves the mileage for a specific vehicle plate. Use a callback to receive the value.

SetVehicleMileage

Updates the mileage for a specific vehicle plate.

GetVehiclePartsWear

Retrieves current wear levels (0.0 to 1.0) for vehicle parts.

SetVehiclePartsWear

Updates wear levels for vehicle parts.

GetVehicleLastPartsChange

Retrieves the mileage at which parts were last replaced.

LogTransaction

Logs a shop transaction to the database for the management history.

GetShopData

Retrieves configuration and balance data for a specific mechanic shop.

Last updated