Skip to content

createFire

Shared
NEON EXTENSIONManaged fire

A standard MTA API with Neon behavior

Creates a managed fire element when given an options table, or the original native GTA fire otherwise.

Syntax

fire|bool createFire(float x, float y, float z [, table options])

Arguments

xfloat

World X.

yfloat

World Y.

zfloat

World Z.

optionstableoptional

Optional table of duration, strength, damage, damageTargets, spread, maxGenerations, source and target. Passing it is what makes the fire managed.

Table keys

durationintoptional · default 5000

Total lifetime in milliseconds.

strengthfloatoptional · default 1.0

Size multiplier. Around 1, 2 and 3 select GTA's small, medium and large fire effects.

damagebooloptional · default true

Whether the fire damages anything at all.

damageTargetstableoptional

Mask of players, peds, vehicles and objects booleans. Omitted keys default to true.

spreadbooloptional · default false

Whether the fire can spawn further fires.

maxGenerationsintoptional · default 0

Generation limit for spreading, 0 through 255.

sourceelementoptional

Element blamed for the damage, reported as responsibleElement in onClientFireDamage.

targetelementoptional

Element the fire follows. The fire rides it wherever it goes.

Returns

A fire element for the managed form; a boolean for the legacy native form; false on failure.

Ownership and lifecycle

A managed fire is an element owned by the resource that created it, so stopping that resource extinguishes its fires. Server-created fires are synchronized to every client, and lifetime is tracked as relative remaining time so a client joining mid-burn receives what is left.

Important behavior
  • Passing a table as the fourth argument is the switch: it returns a real element with a persistent identity that can be changed while it burns.
  • On the client, a number or omitted fourth argument keeps the original native GTA fire and still returns a boolean, so existing resources are unaffected.
  • On the server, a number fourth argument is read as strength and still creates a managed fire.
  • Defaults are duration 5000 ms, strength 1.0, damage on, spread off, maxGenerations 0, and all four damage targets enabled.
  • Server-created fires are synchronized to every client, and a player joining mid-burn receives the remaining lifetime rather than a restarted one.

Example

local fire = createFire(x, y, z, {
duration = 10000,
strength = 1.5,
damageTargets = { players = false, peds = true, vehicles = true, objects = true },
})

Where this comes from

RELATED NEON APIS

Continue exploring

Read the system guide →