Browse docs
Server: CreateFire(payload, creator)
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:
| Operation | Return value on success | ID to keep |
|---|---|---|
CreateFire | One table: { success = true, fireId = ..., type = ..., label = ... } | result.fireId, a numeric fire ID |
CreateVehicleFire | One table: { success = true, fireId = ... } | Keep the vehicle network ID you supplied for RemoveVehicleFire; result.fireId identifies the fire |
CreateOilSpill | Two values: true, spill | spill.id, a string such as "17", for RemoveOilSpill |
GetOilSpills | An array of spill tables | Each 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 field | Type | Required / default | Meaning |
|---|---|---|---|
payload | table | Required | Fire creation data |
payload.coords | { x, y, z } or vector3 | Required | World position with numeric coordinates |
payload.type | string | "trash" | A configured fire profile or alias |
payload.metadata | table | Optional | Overrides for this fire, described below |
creator | number | 0 | Player 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), andlabel(string). - Failure:
success = falseanderror(string). Possible errors areinvalid_payload,invalid_coords,invalid_fire_type, andcreate_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.