Documentation

Config

Explanations and examples for the current shredder configuration.

Edit zyke_shredder/shared/unlocked/config.lua. Distances are metres, belt speeds are metres per second, and durations ending in Ms are milliseconds. Fuel amounts are litres.

Keybinds can be changed in GTA / FiveM settings. Framework, inventory, and webhook settings live in zyke_lib. Recipes are not part of the config; manage them in the Admin Panel.

#Full Default Config

#Config.Settings.shredder

#enabled

Enables the resource. When disabled, machines, the compact set, the buyer, and item registration do not load.

Example:

lua
enabled = true

#placement.command

Command that prints a ready coords line for a machine at the player's position and heading to the F8 console.

Example:

lua
command = "shredderpos"

#placement.permission

Permission checked by the placement 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"}

#interaction

How players use the spots on every machine and compact prop. "points" shows zyke_lib interaction markers, used with E while looking at them. "target" uses ox_target or qb-target through zyke_lib, with a box on each part of the machine.

Example:

lua
interaction = "points"

#admin.enabled

Enables the admin panel.

Example:

lua
enabled = true

#admin.command

Command that opens the admin panel.

Example:

lua
command = "shredderadmin"

#admin.permission

Permission checked on both client and server for the admin panel. Use one permission or a list; any match grants access. These are permission identifiers and groups, not job names.

Example:

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

#logs.enabled

Writes every shredder action to the zyke_shredder_logs table and sums it per day in zyke_shredder_stats for the admin panel. Discord logs are separate; see server/unlocked/hooks.lua and the zyke_lib webhooks.

Example:

lua
enabled = true

#logs.keepDays

Removes log rows older than this many days on start and once a day. 0 keeps every row. Daily statistics are always kept.

Example:

lua
keepDays = 90

#logs.refusals

Logs actions the server turned down. Set to false to leave them out.

Example:

lua
refusals = true

#speeds

Belt speeds in metres per second and the cutter shaft speed in RPM. At 0.3, a part takes about ten seconds to reach the hopper.

Example:

lua
speeds = {infeed = 0.3, outfeed = 0.25, shaftRpm = 24}

#feed.seconds

Duration of the loading animation in seconds. The part leaves the inventory when it is placed on the belt.

Example:

lua
seconds = 1.5

#feed.anim

Animation played while loading a part.

Example:

lua
anim = {dict = "mp_common", clip = "givetake1_a", flag = 48}

#feed.reach

Furthest distance from either side of the belt's lower end at which a player can load or unload parts.

Example:

lua
reach = 0.8

#maxLoads

Maximum parts on the infeed or in the cutters at once.

Example:

lua
maxLoads = 6

#idleStopSeconds

Seconds a running shredder waits without parts before stopping. 0 keeps it running.

Example:

lua
idleStopSeconds = 120

#overheat.enabled

Enables the thermal cutout. Each piece of scrap cut adds one heat. At the limit, the machine stops with its parts in place, the warning lamp lights, and smoke rises from the hopper.

Example:

lua
enabled = true

#overheat.limit

Heat at which the thermal cutout stops the machine. A full line trips it after about 130 pieces.

Example:

lua
limit = 100

#overheat.resumeAt

Heat the machine must cool to before it can start again.

Example:

lua
resumeAt = 40

#overheat.coolPerMinute

Heat lost per minute while running and while stopped. Heat is saved with the machine and cools at the stopped rate while the server is down.

Example:

lua
coolPerMinute = {running = 10, stopped = 30}

#jam.enabled

Enables jams. A jammed part stalls the shafts, which reverse briefly to free it and then continue cutting.

Example:

lua
enabled = true

#jam.chance

Share of parts that jam, from 0 to 1. 0.06 is about one part in sixteen.

Example:

lua
chance = 0.06

#jam.maxReversals

Maximum times one part can jam on its way through.

Example:

lua
maxReversals = 2

#spawnDistance

Distance from a machine at which its props spawn.

Example:

lua
spawnDistance = 120.0

#animateDistance

Distance from a machine at which its moving parts are animated.

Example:

lua
animateDistance = 60.0

#reach

Furthest distance from the control pedestal or the bin at which a player can use them.

Example:

lua
reach = 2.0

#bin.capacity

Pieces of scrap the bin holds. A part only enters the cutters once the bin has room for its output; until then, the infeed holds it at the top and no more parts can be loaded.

Example:

lua
capacity = 60

#bin.shared

true lets anyone empty the whole bin and take any part back off the infeed. false keeps each character's output for themselves, while the heap in the bin still shows everyone's.

Example:

lua
shared = true

#bin.seconds

Duration of the collecting animation in seconds.

Example:

lua
seconds = 2.5

#bin.anim

Animation played while collecting from the bin.

Example:

lua
anim = {dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", flag = 1}

#outputModels

Model shown on the outfeed for each output item. Items without an entry show as steel scrap.

Example:

lua
outputModels = {
    scrap_steel = "zyke_shredder_scrap_steel",
    catalyst_powder = "zyke_shredder_scrap_fines",
}

#fallbackProp

Model used for parts whose own prop is not streamed, such as clamps without zyke_wheelclamp running.

Example:

lua
fallbackProp = "zyke_shredder_scrap_steel"

#sounds

Sounds files played at the machine, with volume and distance. A list of names plays one at random. Remove a line to leave that sound out. Keep the volumes of start, motor, jam, and stop together, and likewise the four generator sounds, since each group is mixed to the same level.

The compact set plays the key prefixed with compact when one exists, such as compactMotor or compactGeneratorLoop, and the scrapyard shredder's sound otherwise. plug is the cable going into or coming out of a socket.

Example:

lua
sounds = {
    motor = {name = "machines/shredder_motor.wav", volume = 0.35, distance = 40.0},
    pour = {name = "machines/diesel_pour.wav", volume = 0.14, distance = 3.0},
    compactMotor = {name = "machines/compact_motor.wav", volume = 0.2, distance = 18.0},
    plug = {name = "machines/cable_plug.wav", volume = 0.2, distance = 6.0},
}

#effects

Particles thrown from the hopper while parts are cut, repeated every intervalMs. color tints supported effects, 0 to 1 per channel. overheat is the smoke shown while cooling; remove it to leave the smoke out.

Example:

lua
effects = {
    sparks = {asset = "core", name = "ent_brk_sparking_wires", scale = 1.4, intervalMs = 300},
    dust = {asset = "scr_recartheft", name = "scr_wheel_burnout", scale = 0.3, intervalMs = 650, color = {0.55, 0.53, 0.5}},
}

#Machines

Each entry in Config.Settings.shredder.machines places one scrapyard shredder. In the paths below, <machine> means one entry. Compact shredders are set up by players and are not listed here; see Compact Set.

#machines.<machine>.id

Unique key for everything saved for the machine: its bin, tank, heat, and loaded parts. Keep it once the machine is in use.

Example:

lua
id = "sandy_scrapyard"

#machines.<machine>.label

Name shown for the machine.

Example:

lua
label = "Scrapyard Shredder"

#machines.<machine>.coords

Ground point under the cutting chamber, with w as the heading the infeed runs along. The loading end sits 3 metres behind, the pedestal beside it on the right, the bin 2.5 metres to the right, and the generator 2.4 metres to the left. Use /shredderpos to print a ready line.

Example:

lua
coords = vec4(2427.2236328125, 3129.0163574219, 48.175247192383, 200.0)

#machines.<machine>.snapToGround

Drops the machine onto the ground under coords.

Example:

lua
snapToGround = true

#machines.<machine>.blip

Map marker for the machine. Set enabled = false to hide it.

Example:

lua
blip = {enabled = true, sprite = 527, color = 17, scale = 0.7}

#Generator

The diesel generator beside the drive powers the scrapyard shredder. Starting the shredder cranks the generator first, and it runs along with it. The portable generator has its own settings under compact.generator.

#generator.requireFuel

true burns diesel while the shredder runs, stops the shredder when the tank is empty, and lets players fill it at the filler. false needs no fuel and the generator only starts and stops with the shredder.

Example:

lua
requireFuel = true

#generator.tank

Litres the tank holds.

Example:

lua
tank = 40.0

#generator.startFuel

Litres in the tank before anyone has filled it.

Example:

lua
startFuel = 0.0

#generator.burnPerMinute

Litres burned per minute while the shredder runs.

Example:

lua
burnPerMinute = 1.0

#generator.fuelItems

Usable can items and the litres each holds when full. A can keeps its remaining litres in metadata; pouring stops when the tank is full, and empty cans are kept.

Example:

lua
fuelItems = {
    diesel_can = 20.0,
}

#generator.litreWeight

Grams each litre adds on top of the empty can's item weight. Only inventories that weigh metadata use it, such as ox_inventory. The can's durability bar shows how full it is.

Example:

lua
litreWeight = 1000

#generator.can

Carry animation and prop. Using a can takes it out and carries it at the side until it is used again. A different model needs its own pos and rot.

Example:

lua
can = {
    anim = {dict = "move_weapon@jerrycan@generic", clip = "idle"},
    prop = {model = "w_am_jerrycan", bone = 28422, pos = vec3(0.2856, 0.0187, -0.0093), rot = vec3(-90.0, 0.0, 90.0)},
}

#generator.pour

Litres poured per second and the pouring animation.

Example:

lua
pour = {
    litresPerSecond = 3.5,
    anim = {dict = "weapon@w_sp_jerrycan", clip = "fire", flag = 1},
}

#generator.exhaust

Smoke from the stack: a burst of startPuffs dark puffs as the engine catches and a light haze every intervalMs while running. intervalMs = 0 leaves the haze out.

Example:

lua
exhaust = {asset = "scr_recartheft", name = "scr_wheel_burnout", scale = 0.08, intervalMs = 1200, color = {0.22, 0.21, 0.2}, startPuffs = 6, startColor = {0.08, 0.08, 0.08}}

#Compact Set

Settings under Config.Settings.shredder.compact cover the compact shredder, portable generator, power cable, and catch crate that players carry as items. See Compact Shredder for how the set is used.

#compact.enabled

Enables the compact set. When disabled, its items are not registered and no props load.

Example:

lua
enabled = true

#compact.items

Inventory items that set up each prop when used. The generator's item must not stack, since it stores the diesel left in its tank.

Example:

lua
items = {shredder = "shredder_compact", generator = "shredder_generator", box = "shredder_box"}

#compact.admin

Command and permission for setting up or removing compact props without the item or the wait. See Commands.

Example:

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

#compact.placement.maxDistance

Furthest distance from the player at which a prop can be set up.

Example:

lua
maxDistance = 3.0

#compact.placement.maxSlope

Steepest ground a prop can stand on, in degrees.

Example:

lua
maxSlope = 12.0

#compact.placement.maxPerPlayer

Most props of each kind one character can have set up at once. 0 removes the limit.

Example:

lua
maxPerPlayer = 2

#compact.placement.setupSeconds

Duration of the progress bar that sets a prop up.

Example:

lua
setupSeconds = 8.0

#compact.placement.packSeconds

Duration of the progress bar that packs a prop back into its item.

Example:

lua
packSeconds = 6.0

#compact.placement.pickupDelaySeconds

Seconds a prop must stand before it can be packed up again. 0 removes the wait.

Example:

lua
pickupDelaySeconds = 60

#compact.placement.anim

Animation played while setting up and packing up.

Example:

lua
anim = {dict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@", clip = "machinic_loop_mechandplayer", flag = 1}

#compact.placement.fuelOnPickup

What happens to the diesel in a generator that is packed up. "keep" stores it in the item and returns it to the tank when set up again, "lose" empties the tank, and "refuse" only lets an empty generator be packed up.

Example:

lua
fuelOnPickup = "keep"

#compact.access

Who may use a prop someone else set up, per action: "owner" for the character who set it up, or "anyone". Admins with compact.admin.permission always may. The rules are applied in server/unlocked/can_checks.lua; edit them there for jobs, gangs, or keys. See Can-Check Hooks.

Example:

lua
access = {
    load = "anyone",
    operate = "anyone",
    collect = "anyone",
    refuel = "anyone",
    link = "anyone",
    pickup = "owner",
}

#compact.cable

maxLength is the furthest the cable reaches between the generator's outlet and the shredder's inlet. Carrying it further puts it back. item is the inventory item a cable is: it leaves the inventory once plugged into a shredder, and whoever pulls it out at either end gets it back. item = false gives every generator a cable of its own.

Example:

lua
cable = {maxLength = 8.0, item = "shredder_cable"}

#compact.dockDistance

A catch crate set up this close to a shredder's outlet snaps into place and docks.

Example:

lua
dockDistance = 0.8

#compact.switchAnim

Animation for reaching down to the shredder's control panel, the generator's key switch, and its socket.

Example:

lua
switchAnim = {dict = "pickup_object", clip = "pickup_low", flag = 48}

#compact.shredTimeMultiplier

Every recipe's shred time is multiplied by this in the compact shredder.

Example:

lua
shredTimeMultiplier = 1.6

#compact.shaftRpm

Cutter shaft speed of the compact shredder in RPM.

Example:

lua
shaftRpm = 18

#compact.idleStopSeconds

Seconds a running compact shredder waits without a part before stopping. 0 keeps it running.

Example:

lua
idleStopSeconds = 60

#compact.overheat

The compact shredder's own thermal cutout, read like overheat. The small cutters trip after about 30 pieces cut back to back. It is enabled separately from the scrapyard shredder's; add enabled = false to turn it off.

Example:

lua
overheat = {
    limit = 30,
    resumeAt = 12,
    coolPerMinute = {running = 5, stopped = 15},
}

#compact.jam

The compact shredder's own jam settings, read like jam. By default it jams twice as often as the scrapyard shredder. It is enabled separately; add enabled = false to turn it off.

Example:

lua
jam = {
    chance = 0.12,
    maxReversals = 2,
}

#compact.effectScale

Size of the sparks and dust from the hopper, as a share of the scrapyard shredder's.

Example:

lua
effectScale = 0.5

#compact.box.capacity

Pieces the catch crate holds. A part only goes in the hopper while the docked crate has room for the most it can give. An empty crate takes any part.

Example:

lua
capacity = 12

#compact.box.shared

true lets anyone at the crate take what is in it. false keeps each character's output for themselves. A crate cannot be packed up while anything is in it.

Example:

lua
shared = true

#compact.generator

The portable generator, read like Generator. It has its own switch and burns diesel for as long as it runs, whether the shredder does or not. It takes the cans from generator.fuelItems.

Example:

lua
generator = {
    requireFuel = true,
    tank = 15.0,
    startFuel = 0.0,
    burnPerMinute = 0.35,
    exhaust = {asset = "scr_recartheft", name = "scr_wheel_burnout", scale = 0.04, intervalMs = 1500, color = {0.22, 0.21, 0.2}, startPuffs = 4, startColor = {0.08, 0.08, 0.08}},
}

#compact.fumes.enabled

Enables exhaust fumes from a portable generator running indoors. Outdoors, nothing builds up.

Example:

lua
enabled = true

#compact.fumes.bucketsAreIndoors

Counts every routing bucket other than 0 as indoors, for instanced apartments and shells. Props set up inside a game interior always count as indoors. Custom rules belong in the indoor Can-Check Hooks.

Example:

lua
bucketsAreIndoors = true

#compact.fumes.risePerMinute

Fume level gained per minute while an indoor generator runs. The level runs from 0 to 100.

Example:

lua
risePerMinute = 10.0

#compact.fumes.fallPerMinute

Fume level lost per minute while the generator is off.

Example:

lua
fallPerMinute = 15.0

#compact.fumes.thresholds

Levels at which each stage begins. At haze, smoke hangs around the generator. At cough, nearby players cough and their view dims. At damage, they lose health. At stall, the engine chokes and stops.

Example:

lua
thresholds = {haze = 25, cough = 50, damage = 75, stall = 100}

#compact.fumes.restartBelow

Level the fumes must fall below before a stalled generator can start again.

Example:

lua
restartBelow = 40

#compact.fumes.radius

Distance from the generator within which players are affected.

Example:

lua
radius = 10.0

#compact.fumes.damage

Health lost every intervalSeconds at the damage stage.

Example:

lua
damage = {amount = 4, intervalSeconds = 5}

#compact.fumes.haze

Smoke particles shown around the generator from the haze stage.

Example:

lua
haze = {asset = "scr_recartheft", name = "scr_wheel_burnout", scale = 0.6, intervalMs = 900, color = {0.35, 0.34, 0.33}}

#compact.fumes.cough

Cough animation and how often it plays.

Example:

lua
cough = {dict = "timetable@gardener@smoking_joint", clip = "idle_cough", flag = 49, intervalSeconds = 9}

#compact.fumes.screen

Timecycle modifier that dims the view, reaching strength once the level is at stall.

Example:

lua
screen = {modifier = "BarryFadeOut", strength = 0.5}

#Scrap Buyer

The scrap buyer pays for shredder output. See Scrap Buyer for how demand and orders work.

#buyer.enabled

Enables the scrap buyer.

Example:

lua
enabled = true

#buyer.payoutAccount

Account the buyer pays into, such as cash, bank, or black_money.

Example:

lua
payoutAccount = "cash"

#buyer.market.maxShare

Highest share of an item's price the buyer pays. Demand is shared by all players and saved in the database.

Example:

lua
maxShare = 0.4

#buyer.market.minShare

Once demand falls below this share, the buyer stops buying that item.

Example:

lua
minShare = 0.1

#buyer.market.reopenShare

Share demand must recover to before a closed item is bought again.

Example:

lua
reopenShare = 0.15

#buyer.market.dropPerSale

Share removed for every piece sold outside an order.

Example:

lua
dropPerSale = 0.002

#buyer.market.recoverPerHour

Share recovered per hour.

Example:

lua
recoverPerHour = 0.1

#buyer.rerollMinutes

Minutes before each character's order is replaced, whether or not it was delivered. Every character's timer runs separately.

Example:

lua
rerollMinutes = 45

#buyer.orderSize

Different items in one order. Pieces toward the order pay full price and do not affect demand.

Example:

lua
orderSize = 3

#buyer.items

Items the buyer accepts. price is the full price of one piece, wanted is the amount range an order asks for, and weight is how often orders pick the item. Leave wanted out to buy an item without ever ordering it.

Example:

lua
items = {
    scrap_steel = {price = 30, wanted = {min = 12, max = 20}, weight = 5},
    scrap_glass = {price = 6},
}

#buyer.positions

Buyer peds. coords is where the player stands to talk, with w as the ped's heading. Set blip.enabled = false to hide the map marker.

Example:

lua
positions = {
    {
        label = "Scrap Buyer",
        model = "s_m_y_dockwork_01",
        coords = vec4(2403.51, 3127.95, 48.15, 250.0),
        scenario = "WORLD_HUMAN_CLIPBOARD",
        blip = {enabled = true, sprite = 500, color = 17, scale = 0.7},
    },
}