Documentation

Config

Explanations for all config values.

View on Store

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.

#Full Default Config

Values under handling and most under chains can also be tuned in game with /snowconfig. Saved values override the config; settings nobody tuned keep following it. See Commands.

#Config.Settings

All basic resource settings.

#debug

Prints the weather the script sees and whether it counts as snow, the handling it writes on the vehicle you drive, how much the chains count, and the chain wear it reports, to the F8 console. 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", "SNOW_HALLOWEEN"}

#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 power they take, wear and sparks.

#recovery

Share of the grip snow takes away that chains on every wheel give back. drivenWheels decides how it is spread 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

#drivenWheels

How much of a chain's grip depends on it sitting on a wheel the engine drives, from 0 to 1. The drive type is read from each vehicle's handling. At 0.8, a front wheel drive car gets 90% of the full chain grip with chains on its front wheels only, and 10% with them on the rear only. 0 counts every wheel alike. Only chains on driven wheels stop wheelspin, while chains on any wheel help braking.

Example:

lua
drivenWheels = 0.8

#dryTraction

Grip multiplier with chains on the hard ground in hardSurfaces. Steel on tarmac grips a little worse than rubber.

Example:

lua
dryTraction = 0.92

#hardSurfaces

Ground materials a chain grinds on: roads and paving. Only there chains grip worse, throw sparks and wear fast. On any other ground that is not snow, such as dirt, sand, gravel, grass and rock, they lose no grip, throw no sparks and wear as slowly as on snow.

Example:

lua
hardSurfaces = {
    "DEFAULT", "CONCRETE", "CONCRETE_POTHOLE", "CONCRETE_DUSTY", "TARMAC", "TARMAC_PAINTED", "TARMAC_POTHOLE",
    "RUMBLE_STRIP", "STONE", "COBBLESTONE", "BRICK", "MARBLE", "PAVING_SLAB",
}

#power

Share of its engine power and top speed a vehicle keeps with chains on every wheel. The loss is split evenly over the wheels. 1.0 takes nothing; at 0.6 a car that reaches 150 km/h tops out near 90 and pulls away slower. There is no fixed speed limit. Needs handling.enabled.

Example:

lua
power = 0.6

#wear.enabled

Whether chains wear as they are driven.

Example:

lua
enabled = true

#wear.lifetime

The one number to change how long chains last. 2.0 makes every chain last twice as far, 0.5 half as far.

Example:

lua
lifetime = 1.0

#wear.snowPerKm / wear.dryPerKm

Chain health lost per kilometre driven on snow and soft ground, and on the hard ground in hardSurfaces. A new chain has 100 health. At lifetime 1.0 a chain lasts about 1670 km on snow and 167 km on dry roads, up to fastAbove km/h.

Example:

lua
snowPerKm = 0.06,
dryPerKm = 0.6,

#wear.fastAbove / wear.fastPerKm

Extra wear per kilometre for every 10 km/h driven above fastAbove. At lifetime 1.0 a chain lasts about 217 km on snow at 80 km/h.

Example:

lua
fastAbove = 60,
fastPerKm = 0.2,

#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

Chains size themselves to each tyre, also on custom wheels and wheels a stance script resized. Use this for models whose tyres the chain still doesn't sit right on, by spawn name. Empty by default. radius and width multiply the measured tyre size, and offset moves the chain along the axle in metres, outward positive.

Example:

lua
Config.WheelOverrides = {
    dune = {radius = 1.05, width = 1.1, offset = 0.02},
}