Skip to content

Commit f1a0017

Browse files
committed
Fire functions
1 parent 270e1a3 commit f1a0017

File tree

5 files changed

+69
-4
lines changed

5 files changed

+69
-4
lines changed

assets/Fire.png

16.3 KB
Loading

functions/Fire/createFire.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/createFire
21
client:
32
name: createFire
4-
description: THIS FUNCTION NEEDS DOCUMENTATION
3+
description: Creates a patch of fire that will spread a bit and die out after a while. Because it's a client side only function, other players won't see it, so custom events or custom objects will be needed to make a fire visible to some players.
4+
parameters:
5+
- name: x
6+
type: float
7+
description: The X coordinate when the initial patch of fire will be created.
8+
- name: y
9+
type: float
10+
description: The Y coordinate when the initial patch of fire will be created.
11+
- name: z
12+
type: float
13+
description: The Z coordinate when the initial patch of fire will be created.
14+
- name: size
15+
type: float
16+
description: A float value indicating the size of the initial patch of fire, this value also affects the duration of how long the fire remains.
17+
default: '1.8'
18+
returns:
19+
values:
20+
- type: bool
21+
name: result
22+
description: Returns true if successful, false if bad arguments were passed or the limit of active fires was reached. There can be a maximum of 60 active fires.
23+
examples:
24+
- path: 'examples/createFire-1.lua'
25+
description: This example adds a `/fire` command, which creates a patch of fire in the position of the player that types it.
26+
preview_images:
27+
- path: '/assets/fire.png'
28+
description: Fire with default size (1.8)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
local function burn(commandName, theSize)
2+
if tonumber(theSize) then
3+
local x, y, z = getElementPosition(getLocalPlayer())
4+
createFire(x, y, z, tonumber(theSize))
5+
outputChatBox("Burn, buuuuurn >:]")
6+
else
7+
outputChatBox("Syntax: /fire <size>")
8+
end
9+
end
10+
addCommandHandler("fire", burn)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
local start = {0, 0, 4}
2+
3+
for i = 1, 10 do
4+
createFire(start[1] + i, start[2], start[3])
5+
end
6+
7+
extinguishFire(start[1], start[2], start[3], 10)

functions/Fire/extinguishFire.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
# Scraped from: https://wiki.multitheftauto.com/wiki/extinguishFire
21
client:
32
name: extinguishFire
4-
description: THIS FUNCTION NEEDS DOCUMENTATION
3+
description: This function is used to extinguish all spreading fire, or spreading fire at specified coordinates.
4+
parameters:
5+
- name: x
6+
type: float
7+
description: The X coordinate at which any fire will be extinguished.
8+
default: 'nil'
9+
- name: y
10+
type: float
11+
description: The Y coordinate at which any fire will be extinguished.
12+
default: 'nil'
13+
- name: z
14+
type: float
15+
description: The Z coordinate at which any fire will be extinguished.
16+
default: 'nil'
17+
- name: radius
18+
type: float
19+
description: A float value indicating the radius in which to extinguish fire.
20+
default: '1.0'
21+
returns:
22+
values:
23+
- type: bool
24+
name: result
25+
description: Always returns true.
26+
examples:
27+
- path: 'examples/extinguishFire-1.lua'
28+
description: This example creates 10 fires and then instantly extinguishes them.

0 commit comments

Comments
 (0)