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
–true
if 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.
exports["t1ger_mechanic"]:IsPlayerMechanicBoss(src, shopId)
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
–true
if the player is a boss-grade mechanic, otherwisefalse
.number|nil
– Shop ID where the player is a boss, ornil
if not applicable.
IsPlayerShopOwner
Checks whether a player is the owner of a specific mechanic shop or any shop.
exports["t1ger_mechanic"]:IsPlayerShopOwner(src, shopId)
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
–true
if the player is the owner of a shop, otherwisefalse
.number|nil
– Shop ID the player owns, ornil
if 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.
exports["t1ger_mechanic"]:RegisterVehicleData(plate)
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.
exports["t1ger_mechanic"]:SaveVehicleData(vehicle)
Parameters
vehicle
(integer) – The vehicle entity handle
Returns
boolean
–true
if 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.
exports["t1ger_mechanic"]:UpdateVehicleDataPlate(currentPlate, newPlate)
Parameters
currentPlate
(string) – The current plate to be replaced bynewPlate
newPlate
(string) – The new plate to replace with thecurrentPlate
Returns
boolean
–true
if 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.
exports["t1ger_mechanic"]:AddServiceHistory(plate, part, mileage, mechanic, shop)
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
–true
if the history entry was successfully inserted, otherwisefalse
.
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.
exports["t1ger_mechanic"]:GetVehicleServiceHistory(plate)
Parameters
plate
(string
) – The plate of the vehicle.
Returns
table|nil
– A table of service history entries if found, otherwisenil
.
Each entry contains:
{
id = number,
part = string,
mileage = number,
mechanic = string,
shop = string,
date = string -- format: YYYY-MM-DD
}
Last updated