Server
Server-sided exports
TrimPlate
Trims leading and trailing spaces from a plate string. Ensures plate numbers are formatted correctly to prevent inconsistencies in database lookups.
exports["t1ger_tuning"]:TrimPlate(plate)Parameters
plate (string) – The plate string to be trimmed.
Returns
string – The trimmed plate.
GetVehicleEngineSwap
Returns cached engine swap data for a plate, loading from the database on first access. Acts as a fallback for entries not yet preloaded (e.g. created after the last resource start).
exports["t1ger_tuning"]:GetVehicleEngineSwap(plate)Parameters
plate (string) – The vehicle plate.
Returns
table|nil –
{ vehicle, engine }, ornilif no engine swap data exists for this plate.
SetVehicleEngineSwap
Saves engine swap data for a plate — updates cache, database and vehicle statebag. Only persists to the database if the vehicle is actually owned, to avoid orphaned rows for test/NPC vehicles. Still applies visually/in-memory regardless.
Parameters
netId (number) – Network ID of the vehicle.
plate (string) – The vehicle plate.
data (table) –
{ vehicle = modelName, engine = soundName }.
GetModOrders
Returns all currently tracked mod orders.
Returns
table – All mod orders, keyed by plate.
GetModOrder
Returns the mod order for a specific plate.
Parameters
plate (string) – The vehicle plate.
Returns
table|nil – The mod order data, or
nilif no active order exists for this plate.
GetCombinedShops
Returns the slim shop data cache used for combined (mechanic + tuning) shops, so other resources can read it without listening for events.
Returns
table – All combined shops, keyed by shop ID.
SetCombinedOwner
Sets or clears the owner of a combined shop in the slim cache.
Parameters
target (integer) – Player ID, or
-1to broadcast to everyone.shopId (integer) – The shop ID.
newOwner (string|nil) – The new owner's identifier, or
nilto clear the owner.
AddCombinedEmployee
Adds an employee to a combined shop's slim cache.
Parameters
target (integer) – Player ID, or
-1to broadcast to everyone.shopId (integer) – The shop ID.
employee (table) – Employee data
{ identifier, grade, label? }.
UpdateCombinedEmployee
Updates an employee's data in the slim cache.
Parameters
target (integer) – Player ID, or
-1to broadcast to everyone.shopId (integer) – The shop ID.
employee (table) – The updated employee data.
RemoveCombinedEmployee
Removes an employee by identifier from the slim cache.
Parameters
target (integer) – Player ID, or
-1to broadcast to everyone.shopId (integer) – The shop ID.
identifier (string) – The employee identifier to remove.
IsPlayerEmployee
Checks if a player is an employee of a specific shop, or any shop.
Parameters
src (number) – The player's server ID.
shopId (number, optional) – The shop ID to check. If omitted, checks all shops.
Returns
boolean –
trueif the player is an employee, otherwisefalse.number|nil – The ID of the shop the player is employed at, or
nilif not found.
IsPlayerTunerBoss
Checks if a player's job is boss-grade at a specific tuner shop, or any shop.
Parameters
src (number) – The player's server ID.
shopId (number, optional) – The shop ID to check. If omitted, checks all shops.
Returns
boolean –
trueif the player is a boss-grade tuner, otherwisefalse.number|nil – The ID of the shop where the player is boss, or
nilif not found.
IsPlayerShopOwner
Checks if a player is the owner of a specific shop, or any shop.
Parameters
src (number) – The player's server ID.
shopId (number, optional) – The shop ID to check. If omitted, checks all shops.
Returns
boolean –
trueif the player owns the shop, otherwisefalse.number|nil – The ID of the owned shop, or
nilif not found.
AddEmployee
Adds an employee to a shop.
Parameters
shopId (number) – The shop ID.
jobGrade (number) – The job grade to assign.
setJob (boolean|nil) – Whether to set the player's job.
srcOrIdentifier (number|string) – Player source or identifier.
Returns
boolean –
trueon success.
RemoveEmployee
Removes an employee from a shop.
Parameters
shopId (number) – The shop ID.
setJob (boolean|nil) – Whether to reset the player's job.
srcOrIdentifier (number|string) – Player source or identifier.
Returns
boolean –
trueon success.
UpdateEmployee
Updates an employee's job grade in a shop.
Parameters
shopId (number) – The shop ID.
jobGrade (number) – The new job grade.
setJob (boolean|nil) – Whether to set the player's job.
srcOrIdentifier (number|string) – Player source or identifier.
Returns
boolean –
trueon success.
GetVehicleNitrous
Returns cached nitrous data for a plate. Purely an in-memory lookup — the cache is fully populated at startup and kept up to date on every install, so there's nothing left to fall back to a database query for.
Parameters
plate (string) – The vehicle plate.
Returns
table|nil –
{ size, shots, burst, color }, ornilif no nitrous data exists for this plate.
TrySaveVehicleNitrous
Saves a vehicle's current nitrous data, read live from its statebag. Stateless — most vehicles never have nitrous data at all, so this bails out on a single free table read for the vast majority of calls.
Parameters
vehicle (number) – The vehicle entity handle.
GetVehicleDyno
Returns cached dyno data for a plate. Purely an in-memory lookup — the cache is fully populated at startup and kept up to date on every save, so there's nothing left to fall back to a database query for.
Parameters
plate (string) – The vehicle plate.
Returns
table|nil –
{ torque, power, brakes }, ornilif no dyno data exists for this plate.
SetVehicleDyno
Saves dyno data for a plate — updates cache, database and vehicle statebag. Values are clamped to the configured slider ranges regardless of what's sent, since this feature has no payment gate to naturally limit abuse.
Parameters
netId (number) – Network ID of the vehicle.
plate (string) – The vehicle plate.
data (table) –
{ torque, power, brakes }.
Returns
boolean –
trueon success.
Last updated