JCKSDocs
JCKS JobsV2Reference

Fire department

How server owned fires start, spread and go out, and every option of settings/config.fire.lua.

Fires are started and stopped only by the server: random fires in zones, test fires from /jobadmin, Fires and fires from other resources through StartFire. Firefighters are the jobs in Config.Dispatch.fire. The Fire Department template adds its job there by itself. The bridge permission jobs.fire opens the Fires page without the rest of the admin panel.

How a fire works

A fire has up to maxSpots burning spots with an intensity of 0 to 100 kept on the server. Every spreadInterval seconds untouched spots grow by growth and a strong spot (50 or more) may get a new one spreadDistance metres away. Clients light game fires only for spots within streamDistance. The state is GlobalState['jcks:fires'].

Firefighters use the hand tool (WEAPON_FIREEXTINGUISHER) or drive a vehicle from extinguish.vehicles. The client reports that a spot went out, the server checks job, duty, distance, tool and interval, then lowers the intensity. A fire without spots is out.

A new fire sends a fire call (10-70). On the call, Extinguished closes the fire for a firefighter within clear.radius when at most clear.maxLeft intensity is left. A put out fire writes a filed incident report to the MDT. Rewards are paid per spot, never for fires that burnt out or that an admin stopped.

With gear.fireProof, on duty firefighters near a fire do not catch fire. GTA smoke does not hurt, so there is no smoke protection. Firefighters can also force locked doors near a fire, see Doors.

Options

All keys are under Config.Fire.

Key Type Default What it changes
enabled boolean true false starts no fires, hides the page and refuses fire requests
requireDuty boolean true Only firefighters on duty put out fires and get rewards
streamDistance number 150.0 Metres in which clients light game fires (50 to 300)
maxActive number 6 Fires at once on the server (1 to 20)
maxSpots number 12 Spots per fire (1 to 25)
spreadInterval number 10 Seconds between spread steps
spreadChance number 35 % per step for a new spot
spreadDistance number 4.0 Metres from the parent spot
growth number 5 Intensity gained per step
startIntensity number 60 Intensity of new spots
maxChildren number 6 Game fire children at full intensity
gasFire boolean false Spots burn as gas fires
maxMinutes number 30 Minutes until an untouched fire burns out, 0 = never
smoke.enabled, dict, name, scale, minSpots true, 'core', 'ent_amb_smoke_foundry', 1.5, 3 Smoke plume
random.enabled boolean true Random fires
random.interval number 20 Minutes between rolls
random.chance number 40 % per roll
random.maxActive number 2 Random fires at once
random.minFirefighters number 2 Firefighters on duty before a random fire starts, 0 = always
zones table Grapeseed farmland, Paleto Forest, Grand Senora Desert label, coords, radius, size, weight, enabled. Edited in /jobadmin, Fires
extinguish.weapon string 'WEAPON_FIREEXTINGUISHER' Hand tool
extinguish.weaponRange, weaponPower number 9.0, 20 Range and power of the hand tool
extinguish.vehicles table { 'firetruk' } Vehicles with a water cannon
extinguish.vehicleRange, vehiclePower number 35.0, 35 Range and power of the vehicle
extinguish.interval number 700 ms between two hits of one player
clear.radius, clear.maxLeft number 40.0, 40 Extinguished button rules
reward.payTo string 'player' player or society
reward.account string 'bank' bank or money
reward.perSpot number 150 Money per spot put out
reward.maxPerFire number 1500 Most per firefighter per fire
reward.hourlyCap number 6000 Most per firefighter per hour, 0 = no cap
reward.society number 500 Bonus to the job that did most of the work
dispatch.enabled, code, priority true, '10-70', 2 Fire call
report.enabled boolean true Incident report in the MDT
gear.fireProof boolean true Firefighters near a fire do not catch fire
gear.item string '' Item needed for the protection, for example scba
gear.radius number 60.0 Metres around a burning spot

Exports

lua
local id, err = exports.jcks_jobs:StartFire(vector3(x, y, z), 4, {
    label = 'Gas station',
    cause = 'vehicle',
    reward = true,
    dispatch = true,
    report = true,
    ground = true,
})
exports.jcks_jobs:StopFire(id)
local fires = exports.jcks_jobs:GetFires()
local fireId = exports.jcks_jobs:IsFireNear(coords, 30.0)

cause is script, arson, vehicle, explosion or electrical. ground = true means the z is not on the ground and the client looks for it. StopFire puts a fire out without reward and report. IsFireNear returns a fire id or false.

StartFire returns nil, 'fire_limit' when maxActive fires burn. Server events: jcks_jobs:fireStarted (id, coords, cause) and jcks_jobs:fireStopped (id, reason).