Browse docs

Server: CreateVehicleFire(payload, creator, options)

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

All exports

Optional developer integration. Call this export from a server script in your own resource after sky_firejob has started. For normal installation and gameplay, use Installation.

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 fieldTypeRequired / defaultMeaning
payloadtableRequiredVehicle fire creation data
payload.netIdnumberSupply for an attached vehicle fireNetwork ID of the existing vehicle, obtained by your vehicle integration; not an entity handle or plate
payload.coords{ x, y, z } or vector3Optional when netId resolves to an existing vehicleFire position; otherwise the vehicle position is used
payload.platestringOptionalVehicle plate metadata; does not find or select a vehicle
payload.sourcestringOptionalDescription of the origin, such as your resource name
payload.initialStagestring"smoke""smoke", "smallFire", or "fullFire", when progression is enabled
payload.smokeDensitynumberConfig/profile defaultSmoke density; the selected progression stage can override it
payload.explosionDelaySecondsnumberConfig defaultExplosion delay in seconds when explosions are enabled; progression can delay the start of this timer
payload.engineHealth, bodyHealth, petrolTankHealthnumberConfig defaultsOptional vehicle health overrides
payload.effectstableProfile defaultsOptional flame and smoke catalog IDs; unknown IDs return invalid_effect
creatornumber0Player server ID, or 0 for a server-created incident
optionstableOptionalCreation 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 include disabled, invalid_coords, already_burning, limit, external_disabled, too_far, invalid_effect, and create_failed.
  • already_burning can include the existing fireId when 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, or cooldown; a cooldown response includes remaining seconds.
-- 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.