Server
Server-sided exports
TrimPlate
Trims a given plate.
exports["t1ger_mechanic"]:TrimPlate(plate)Parameters
plate(string) – The vehicle number plate.
Returns
string– The trimmed plate.
IsPlayerEmployee
Checks if player is an employee of a specific shop or any shop.
exports["t1ger_mechanic"]:IsPlayerEmployee(src, shopId)Parameters
src(number) – The player source.shopId?(number) – The ID of the shop you check for. If shopId is nil, it checks all shops.
Returns
boolean–trueif employee, otherwisefalse.number|nil– If employee, then Shop ID is also returne, otherwisenil.
IsPlayerMechanicBoss
Checks whether a player is a boss-grade mechanic in a specific mechanic shop or any shop.
Parameters
src(number) – The player's source ID.shopId(number|nil) – (Optional) Specific shop ID to check. If omitted, all shops are checked.
Returns
boolean–trueif the player is a boss-grade mechanic, otherwisefalse.number|nil– Shop ID where the player is a boss, ornilif not applicable.
IsPlayerShopOwner
Checks whether a player is the owner of a specific mechanic shop or any shop.
Parameters
src(number) – The player's source ID.shopId(number|nil) – (Optional) Specific shop ID to check. If omitted, all shops are checked.
Returns
boolean–trueif the player is the owner of a shop, otherwisefalse.number|nil– Shop ID the player owns, ornilif not applicable.
RegisterVehicleData
Registers mileage, core- and service-parts data to database in t1ger_vehicledata table for a given plate. This can be used when purchasing a car from vehicleshop or using command to turn a vehicle into an owned one.
Parameters
plate(string) – The plate of the vehicle.
SaveVehicleData
Saves the vehicle's vehicle-data for given vehicle entity in t1ger_vehicledata table in database. Useful if u want to force save a vehicle's vehicle-data.
Parameters
vehicle(integer) – The vehicle entity handle
Returns
boolean–trueif saved succesfully, otherwisefalse.
UpdateVehicleDataPlate
Updates a given plate in the t1ger_vehicledata table to a new plate. Usefull if using fake plates or plate changer scripts and so on.
Parameters
currentPlate(string) – The current plate to be replaced bynewPlatenewPlate(string) – The new plate to replace with thecurrentPlate
Returns
boolean–trueif updated succesfully, otherwisefalse.
AddServiceHistory
Adds a new service history entry to the t1ger_servicehistory table in the database for a given vehicle plate.
This should be used whenever a mechanic performs service on a part and you want to log the action along with mileage, mechanic, and shop data.
Parameters
plate(string) – The plate of the vehicle.part(string) – The label of the part that was serviced.mileage(number) – The vehicle's mileage at the time of service.mechanic(string) – Identifier of the mechanic who performed the service.shop(string) – Label of the shop or job where the service took place.
Returns
boolean–trueif the history entry was successfully inserted, otherwisefalse.
Only works on vehicles that are already registered (owned).
Automatically adds the current date (
YYYY-MM-DD) to the entry.
GetVehicleServiceHistory
Retrieves all recorded service history entries for a specific vehicle plate from the t1ger_servicehistory table.
Only works on owned vehicles and returns entries in reverse chronological order.
Parameters
plate(string) – The plate of the vehicle.
Returns
table|nil– A table of service history entries if found, otherwisenil.
Each entry contains:
Last updated