Browse docs

Server: CreateFire(payload, creator)

Reference for Server: CreateFire(payload, creator) in firejob.

All exports

Call these exports from a server script in your own resource, with sky_firejob started. They create or remove an incident when called. Automatic oil leaks after collisions or from wear need Sky Mechanic or another resource that detects the condition and calls Firejob.

The return formats and IDs differ between fire and oil exports:

OperationReturn value on successID to keep
CreateFireOne table: { success = true, fireId = ..., type = ..., label = ... }result.fireId, a numeric fire ID
CreateVehicleFireOne table: { success = true, fireId = ... }Keep the vehicle network ID you supplied for RemoveVehicleFire; result.fireId identifies the fire
CreateOilSpillTwo values: true, spillspill.id, a string such as "17", for RemoveOilSpill
GetOilSpillsAn array of spill tablesEach entry's spill.id; the array index is not the spill ID

creator, where accepted, is a player's current server ID (source). Use 0 or omit it for server-created incidents. It is separate from the vehicle network ID, fire ID, and oil spill ID.

Server Exports

CreateFire(payload, creator)

Creates a regular synchronized fire with Firejob's normal spread, extinguishing, dispatch, effects, and lifecycle behavior.

Argument / payload fieldTypeRequired / defaultMeaning
payloadtableRequiredFire creation data
payload.coords{ x, y, z } or vector3RequiredWorld position with numeric coordinates
payload.typestring"trash"A configured fire profile or alias
payload.metadatatableOptionalOverrides for this fire, described below
creatornumber0Player server ID for creation/dispatch context, or 0 for a scripted incident

Common metadata fields are locationType ("interior" or "exterior"), sourceScale (scale multiplier), smokeDensity (0.0–1.0), material, scenePropsEnabled, and reignitable. Reignition overrides include reignitionEnabled, reignitionChancePercent, and reignitionDelaySeconds. Omitted settings follow the fire profile and Firejob configuration.

The export returns one table:

  • Success: success = true, fireId (number), type (string), and label (string).
  • Failure: success = false and error (string). Possible errors are invalid_payload, invalid_coords, invalid_fire_type, and create_failed.
-- server.lua; choose coordinates appropriate for your incident.
local result = exports["sky_firejob"]:CreateFire({
    type = "trash",
    coords = { x = 215.0, y = -810.0, z = 30.0 },
    metadata = {
        locationType = "exterior",
        sourceScale = 1.0,
        smokeDensity = 0.8,
        scenePropsEnabled = false
    }
}, 0)

if not result.success then
    print(("Could not create fire: %s"):format(result.error))
    return
end

local fire_id = result.fireId
print(("Created fire %s (%s)"):format(fire_id, result.type))

Creation notifications are silent by default. Set metadata.silent = false and supply a player creator to send the normal creation notification. fireId identifies a Firejob fire; it is not a vehicle network ID or an oil spill ID. Regular fires follow Firejob's extinguishing and configured expiry lifecycle; this page does not provide a RemoveFire export.