Documentation

Config

Explanations for all config values.

General Information

The editable configuration is located in shared/unlocked/config.lua.

Additional Settings
If there is a feature within the script that you can't find in the script's config, there is a chance that the configuration lies within zyke-lib.

Keymapping
The keys under keys are defaults. Players can rebind them in their GTA / FiveM keybinds.

Multipliers
Handling values multiply each vehicle's own handling. 1.0 changes nothing.

#Config.Settings

All basic resource settings.

#debug

Prints chain, handling and wear details to the F8 console and draws the chained wheels. Keep this disabled during normal production use.

Example:

lua
debug = false

#items.chain

Name of the snow chain item. One item is one chain for one wheel. It must match the item you added to your inventory.

Example:

lua
items = {
    chain = "snow_chain",
}

#command

Lets players fit chains without an item through a command, for admins or servers without the item. permission is the zyke_lib permission the command needs; false lets everyone use it.

Example:

lua
command = {
    enabled = false,
    name = "snowchain",
    permission = "command",
}

#jobs

Only these jobs may fit and remove chains. Use a job name, or {name = "mechanic", rank = 2} for a minimum grade. false lets everyone.

Example:

lua
jobs = false

-- Only mechanics of grade 2 and up
jobs = {name = "mechanic", rank = 2}

#blockedClasses

Vehicle classes chains can't be fitted to. The defaults block motorcycles (8), cycles (13), boats (14), helicopters (15), planes (16), trains (21) and open wheel vehicles (22). Class ids can be found here.

Example:

lua
blockedClasses = {8, 13, 14, 15, 16, 21, 22}

#blockedModels

Models chains can't be fitted to on top of the blocked classes, by spawn name.

Example:

lua
blockedModels = {"monster", "rhino"}

#keys

Default keys. interact fits or removes a chain at the wheel you aim at, putAway puts the carried chain away, pullLeft and pullRight work the chain round the tyre, and tighten works the tensioner.

Example:

lua
keys = {
    interact = "E",
    putAway = "X",
    pullLeft = "A",
    pullRight = "D",
    tighten = "SPACE",
}

#Config.Settings.fitting

How fitting and removing a chain works.

#markerDistance

Metres from the wheel the markers show within.

Example:

lua
markerDistance = 8.0

#reach

Metres from the hub the player may stand while working on the wheel.

Example:

lua
reach = 1.6

#pulls

Pulls needed to work the chain round the tyre. Pulling with the same hand twice slips one back.

Example:

lua
pulls = 6

#turns

Tensioner turns needed to tighten the chain.

Example:

lua
turns = 3

#removeTurns / removePulls

Steps needed to take a chain off: tensioner turns first, then pulls.

Example:

lua
removeTurns = 2,
removePulls = 4,

#slipAfter

Seconds without pulling before the chain slips back one pull.

Example:

lua
slipAfter = 2.5

#minimumSeconds

Seconds the server waits at least between the start and the end of a fit, so a macro can't skip it.

Example:

lua
minimumSeconds = 3.0

#maxVehicleSpeed

Metres per second the vehicle may still be rolling at while a chain is fitted or removed.

Example:

lua
maxVehicleSpeed = 0.5

#Config.Settings.snow

Where the snow handling applies.

#weathers

Weather types that make roads slippery.

Example:

lua
weathers = {"XMAS", "SNOW", "SNOWLIGHT", "BLIZZARD"}

#surfaces

Ground materials that count as snow in any weather, for snow maps and ice.

Example:

lua
surfaces = {"SNOW_LOOSE", "SNOW_COMPACT", "SNOW_DEEP", "SNOW_TARMAC", "ICE", "ICE_TARMAC"}

#Config.Settings.handling

How slippery snow is, as multipliers on each vehicle's own handling. Lower traction slides more, a higher low speed loss spins the wheels when pulling away, and a lower brake force stops later, which grows with speed.

#enabled

Turns the snow handling on or off. Chains can still be fitted with it off.

Example:

lua
enabled = true

#traction.max

Grip at the limit of a turn.

Example:

lua
max = 0.62

#traction.min

Grip once the tyres slide.

Example:

lua
min = 0.55

#traction.lowSpeedLoss

Wheelspin when pulling away.

Example:

lua
lowSpeedLoss = 1.8

#brakeForce

Brake force on snow.

Example:

lua
brakeForce = 0.65

#Config.Settings.chains

The grip chains give back, their dry road grip, the speed limit, wear and sparks.

#recovery

Share of the grip snow takes away that chains on every wheel give back, split evenly over the wheels. It covers the game's own slippery roads in XMAS weather too. 1.0 drives like a dry road, lower stays slippery.

Example:

lua
recovery = 0.75

#dryTraction

Grip multiplier with chains on dry roads. Steel on tarmac grips a little worse than rubber.

Example:

lua
dryTraction = 0.92

#maxSpeed

km/h a vehicle with chains may drive at most. 0 for no limit.

Example:

lua
maxSpeed = 80

#wear.enabled

Whether chains wear as they are driven.

Example:

lua
enabled = true

#wear.snowPerKm / wear.dryPerKm

Chain health lost per kilometre driven on snow and on dry roads. A new chain has 100 health.

Example:

lua
snowPerKm = 0.6,
dryPerKm = 6.0,

#wear.fastAbove / wear.fastPerKm

Extra wear per kilometre for every 10 km/h driven above fastAbove.

Example:

lua
fastAbove = 60,
fastPerKm = 2.0,

#wear.rattleBelow

Health below which a worn chain rattles before it snaps.

Example:

lua
rattleBelow = 15

#sparks

Sparks from chains on dry roads. minSpeed is the km/h the vehicle has to drive at least, and distance is the metres from the camera sparks show within.

Example:

lua
sparks = {
    enabled = true,
    minSpeed = 15,
    distance = 60.0,
}

#Config.Settings.props

How far away chains show.

#renderDistance

Metres from the camera chains on vehicles show within.

Example:

lua
renderDistance = 120.0

#scanInterval

Milliseconds between looking for vehicles with chains nearby.

Example:

lua
scanInterval = 1500

#Config.Settings.saving

Whether chains are kept on vehicles.

#enabled

Keeps chains on vehicles across garages and restarts, by plate.

Example:

lua
enabled = true

#ownedOnly

Only keeps chains for vehicles a player owns.

Example:

lua
ownedOnly = true

#Config.WheelOverrides

Fit adjustments for models whose tyres the chain doesn't sit right on, by spawn name. radius and width multiply the measured tyre size, and offset moves the chain along the axle in metres, outward positive.

Example:

lua
Config.WheelOverrides = {
    -- Its sidewall bulges past the tyre size the game reports
    ["panto"] = {radius = 1.06},
    ["mule"] = {width = 0.9, offset = 0.02},
}