Browse docs
Server: CreateVehicleFire(payload, creator, options)
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
CreateVehicleFire(payload, creator, options)
Creates a fire associated with a vehicle, using Firejob's configured fire progression, vehicle state, and explosion behavior.
| Argument / payload field | Type | Required / default | Meaning |
|---|---|---|---|
payload | table | Required | Vehicle fire creation data |
payload.netId | number | Supply for an attached vehicle fire | Network ID of the existing vehicle, obtained by your vehicle integration; not an entity handle or plate |
payload.coords | { x, y, z } or vector3 | Optional when netId resolves to an existing vehicle | Fire position; otherwise the vehicle position is used |
payload.plate | string | Optional | Vehicle plate metadata; does not find or select a vehicle |
payload.source | string | Optional | Description of the origin, such as your resource name |
payload.initialStage | string | "smoke" | "smoke", "smallFire", or "fullFire", when progression is enabled |
payload.smokeDensity | number | Config/profile default | Smoke density; the selected progression stage can override it |
payload.explosionDelaySeconds | number | Config default | Explosion delay in seconds when explosions are enabled; progression can delay the start of this timer |
payload.engineHealth, bodyHealth, petrolTankHealth | number | Config defaults | Optional vehicle health overrides |
payload.effects | table | Profile defaults | Optional flame and smoke catalog IDs; unknown IDs return invalid_effect |
creator | number | 0 | Player server ID, or 0 for a server-created incident |
options | table | Optional | Creation context, described below |
For a normal integration, omit options or pass { reason = "my_resource" }. The reason is recorded as the fire's origin. When creator > 0, normal external creation checks the external-fire enable setting and player distance.
The optional context flags change behavior: manual = true applies manual ignition checks; accident = true uses accident scaling and context; scenario = true uses scenario context and permits payload.sourceScale, progressionEnabled, and explosionEnabled overrides. These are trusted server-side integration options, not permissions to forward from client input.
The export returns one table:
- Success:
{ success = true, fireId = <number> }. - Failure:
{ success = false, error = <string> }. Errors includedisabled,invalid_coords,already_burning,limit,external_disabled,too_far,invalid_effect, andcreate_failed. already_burningcan include the existingfireIdwhen the vehicle is already registered. A nearby-fire rejection need not include an ID.- Manual ignition can additionally return
not_on_duty,required_jobs,missing_item,invalid_player, orcooldown; a cooldown response includesremainingseconds.
-- server.lua; replace 123 with the existing vehicle's real network ID.
local vehicle_net_id = 123
local result = exports["sky_firejob"]:CreateVehicleFire({
netId = vehicle_net_id,
source = "my_incident_resource",
initialStage = "smoke"
}, 0)
if not result.success then
print(("Could not create vehicle fire: %s"):format(result.error))
return
end
print(("Created fire %s on vehicle %s"):format(result.fireId, vehicle_net_id))
-- Keep vehicle_net_id in your incident state for RemoveVehicleFire.
Creation accepts coordinates without a resolvable vehicle, but such a fire is not necessarily tied to an existing vehicle. Supply a valid vehicle network ID when you need vehicle attachment and later removal with RemoveVehicleFire.