Documentation

Config

Explanations and examples for the current dyno configuration.

Edit zyke_dyno/shared/config.lua. Distances are metres and durations are milliseconds. The screen, the sheet, and the Discord message show the units set under units; exports and events always use kW and Nm. Dynos that always stand are listed in zyke_dyno/shared/dynos.lua.

Framework, inventory, job, permission, notification, and language settings live in zyke_lib. The Discord webhook URL is a server convar, never a file; see webhook.

Rules of your own, such as only letting a job run the dyno while on duty, go in the hooks in client/can_checks.lua and server/can_checks.lua. See Can-Check Hooks.

#Full Default Config

#Config.Settings.dyno

#units

Units on the screen, the result sheet, the laptop app, and the Discord message. power is "hp", "ps", or "kw", torque is "nm" or "lbft", and speed is "kmh" or "mph".

Example:

lua
units = {power = "hp", torque = "nm", speed = "kmh"}

#formula.scale

One factor on every car's power. The default puts most vanilla cars near their real counterparts. Raise or lower it to move every car at once. See Formula & Calibration.

Example:

lua
scale = 0.004436

#formula.massExponent

Exponent on the car's fMass in the formula. Fitted to GTA's balancing; change scale, classScale, or models first.

Example:

lua
massExponent = 1.5

#formula.speedExponent

Exponent on the car's fInitialDriveMaxFlatVel in the formula. Fitted to GTA's balancing; change scale, classScale, or models first.

Example:

lua
speedExponent = 4.0

#formula.classScale

Power factors by vehicle class, from GetVehicleClass. The default lifts supercars, class 7, which GTA gives light masses. Classes not listed use 1.0.

Example:

lua
classScale = {[7] = 1.4}

#formula.models

Power factors for single models, by model name in lower case. Models not listed use 1.0.

Example:

lua
models = {sultan = 1.1} -- 10% more

#drivetrainLoss

Share of the engine's power lost before it reaches the rollers, by the wheels that drive. The drive is read from the car's powered wheels. Wheel figures are measured at the rollers, and the engine figure adds the loss back.

Example:

lua
drivetrainLoss = {FWD = 0.12, RWD = 0.15, AWD = 0.20}

#rpm.idle

Engine speed the car idles at on the rollers.

Example:

lua
idle = 850

#rpm.redline

Redline for classes and models without their own. The pull ends at the limiter on the redline.

Example:

lua
redline = 7000

#rpm.classes

Redlines by vehicle class, from GetVehicleClass.

Example:

lua
classes = {[0] = 6800, [4] = 6200, [7] = 8500, [9] = 5800, [10] = 4500, [11] = 4500, [12] = 5500, [20] = 4000}

#rpm.models

Redlines for single models, by model name in lower case. A model's redline wins over its class's.

Example:

lua
models = {sultan = 7500}

#gear

Gear the pull runs in, or the car's top gear when it has fewer. The rollers spin up as the car would gain speed on the road in that gear.

Example:

lua
gear = 4

#pull.inertia

Share of the car's mass the rollers feel. 1.0 pulls about as long as the car takes to gain the same speed on the road, which puts most cars at four to eight seconds in 4th. Lower values give shorter pulls with the same numbers.

Example:

lua
inertia = 1.0

#pull.maxMs

Milliseconds a run may take before it is stopped without a result.

Example:

lua
maxMs = 60000

#allowedClasses

Vehicle classes that may go on a dyno, from GetVehicleClass. Only regular automobiles fit the rollers; bikes, boats, helicopters, planes, and trains never do. The default allows compacts, sedans, SUVs, coupes, muscle, sports classics, sports, super, off-road, and vans.

Example:

lua
allowedClasses = {0, 1, 2, 3, 4, 5, 6, 7, 9, 12}

#minEngineHealth

Lowest engine health a run starts at. A running pull is stopped if the engine drops below it.

Example:

lua
minEngineHealth = 300.0

#lineUp

How far the car may stand from the rollers and still start: along and across are metres the front wheels may stand off the front rollers, and angle is degrees off straight.

Example:

lua
lineUp = {along = 0.18, across = 0.30, angle = 5.0}

#jobs

Jobs that may run every dyno, and connect to it in the laptop app. Use a job name or a list. nil lets anyone. A dyno with its own jobs uses those instead.

Example:

lua
jobs = {"mechanic"}

#historyPerPlate

Runs kept per plate in the database, oldest out first. The car's first run is always kept, since later runs are drawn over it. 0 keeps every run.

Example:

lua
historyPerPlate = 25

#printout.enabled

Lets the driver print the result as an item. With false, the print key is hidden and the item isn't usable.

Example:

lua
enabled = true

#printout.item

Item a printed sheet is given as. It has to exist in your inventory; using it shows the sheet. See Setup.

Example:

lua
item = "dyno_sheet"

#showDistance

Metres around the driver in which Show nearby sends the sheet to other players.

Example:

lua
showDistance = 5.0

#webhook

Posts each finished run to Discord with the car, plate, peak power, peak torque, and gain. name is the webhook's username and colour the embed's colour as a decimal number. The URL is read from the zyke_dyno_webhook server convar, so it never sits in a file. Without it, nothing is sent.

cfg
set zyke_dyno_webhook "https://discord.com/api/webhooks/..."

Example:

lua
webhook = {enabled = true, name = "Zyke Dyno", colour = 1668818}

#screen

The screen on its pillar beside a dyno: its model, the metres its origin stands off the floor, and the corners of its picture in the model's frame, top left, top right, bottom right, and bottom left as seen from the front. Only change face for a screen model of your own.

Example:

lua
screen = {
    model = "zyke_dyno_screen",
    height = 0.0,
    face = {vec3(0.32, 0.1537, 1.6363), vec3(-0.32, 0.1537, 1.6363), vec3(-0.32, 0.2286, 1.2841), vec3(0.32, 0.2286, 1.2841)},
}

#streamDistance

Metres from a dyno its props stand within. Runs play for players within this distance.

Example:

lua
streamDistance = 80.0

#screenDistance

Metres from a dyno its screen is drawn within. Only the nearest screen in reach is lit.

Example:

lua
screenDistance = 30.0

#calibrate.command

Command that prints the formula's inputs for the car you sit in and the power they give. See Formula & Calibration.

Example:

lua
command = "dynocalibrate"

#calibrate.permission

Permission checked by the calibrate command through zyke_lib. Use one permission or a list; any match grants access. command is the ACE permission, and the remaining defaults are the ESX admin groups.

Example:

lua
permission = {"command", "admin", "superadmin", "owner"}

#laptop.enabled

Adds the Dyno app to zyke_laptop while it runs. See Laptop App.

Example:

lua
enabled = true

#laptop.range

Metres the player at the laptop may stand from a dyno to connect to it. nil allows any distance. Dynos out of range are listed but can't be connected to.

Example:

lua
range = nil

#admin.enabled

Enables the placing tool's command.

Example:

lua
enabled = true

#admin.command

Command that takes out the placing tool, which places dynos where you aim and removes the ones it placed. See Placing Dynos.

Example:

lua
command = "dynos"

#admin.permission

Permission checked by the placing tool through zyke_lib, on the command and on every dyno placed or removed. Use one permission or a list; any match grants access. command is the ACE permission, and the remaining defaults are the ESX admin groups.

Example:

lua
permission = {"command", "admin", "superadmin", "owner"}

#admin.screen

Where a placed dyno's screen stands when on the left, in the dyno's frame as in shared/dynos.lua. The tool mirrors it for the right, or leaves it out.

Example:

lua
screen = {offset = vec3(-2.3, 0.6, 0.0), heading = 225.0}

#Dynos

Dynos in shared/dynos.lua stand for as long as the resource runs. The list is empty by default. Dynos placed with /dynos are saved in the database instead, and other resources place dynos with CreateDyno; see Placing Dynos.

The bed needs 2.6 metres of room across and 7.2 metres along, ramps included. The car drives on from behind.

#Config.Dynos.<dyno>.coords

Point on the floor under the middle of the front rollers.

Example:

lua
coords = vec3(-1352.0, -3020.0, 12.94)

#Config.Dynos.<dyno>.heading

Heading in degrees, the way a car's nose points on the dyno. Defaults to 0.0.

Example:

lua
heading = 240.0

#Config.Dynos.<dyno>.screen

The screen pillar beside the dyno. offset is metres from coords, with x across to the right and y along toward the nose, and heading is degrees turned from the dyno's. Left out, the dyno has no screen.

Example:

lua
screen = {offset = vec3(-2.3, 0.6, 0.0), heading = 225.0}

#Config.Dynos.<dyno>.jobs

Jobs that may run this dyno, instead of Config.Settings.dyno.jobs. Use a job name or a list.

Example:

lua
jobs = {"mechanic"}

#Config.Dynos.<dyno>.label

Name of the dyno in the laptop app, up to 48 characters. Defaults to Dyno 1 and so on.

Example:

lua
label = "Benny's Rolling Road"

#Full Dyno Entry

A complete shared/dynos.lua with one dyno.

Example:

lua
Config.Dynos = {
    {
        coords = vec3(-1352.0, -3020.0, 12.94),
        heading = 240.0,
        screen = {offset = vec3(-2.3, 0.6, 0.0), heading = 225.0},
        jobs = {"mechanic"},
        label = "Benny's Rolling Road",
    },
}