ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. createFire

Function

createFire

Server and clientFireModified from MTA:SA

Starts a fire. On the server every player sees it, including players who join later, and the function returns the fire's number. On the client the fire burns only in that one game.

Syntax

Server

createFire(x, y, z [, size = 2, duration = 0, dimension = 0])

Client

createFire(x, y, z [, size = 1.8])

Arguments

xfloat
X position.
yfloat
Y position.
zfloat
Z position.
sizefloat, optional = 2
Size from 1 to 5 (1.8 by default on the client).
durationint, optional = 0
Server only: burn time in ms, 0 = until put out.Not in MTA:SA
dimensionint, optional = 0
Server only: dimension.Not in MTA:SA

Differences from MTA:SA

  • In MTA:SA this function is client-side only.
  • Arguments in a different colour differ from MTA:SA.

In MTA:SA

createFire(float x, float y, float z, float size = 1.8)

Returns

Server: the fire number or false (e.g. when the fire limit is reached). Client: true or false.

Example

A campfire for 30 seconds where the player stands.

addCommandHandler("ognisko", function(player)
    local x, y, z = getElementPosition(player)
    local id = createFire(x + 2, y, z - 0.5, 2, 30000)
    if id then
        outputChatBox("Rozpalono ogień nr " .. id, player)
    end
end)

See also