Skip to content

Commit 6c9f32f

Browse files
Merge branch 'main' of github.com:multitheftauto/mtasa-wiki
2 parents e37c16b + 2edde00 commit 6c9f32f

File tree

3 files changed

+61
-16
lines changed

3 files changed

+61
-16
lines changed

functions/Element/getElementHealth.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ shared: &shared
1313
values:
1414
- type: 'float'
1515
name: 'health'
16-
examples:
17-
- path: 'examples/getElementHealth-1.lua'
18-
description: |
19-
This example outputs the player and vehicle health (if player is in a vehicle) to chatbox using /health command:
20-
- path: 'examples/getElementHealth-2.lua'
21-
description: |
22-
This example heals the player to 100 HP using /healme command if he's at 50 HP or lower:
2316
issues:
2417
- id: 3791
2518
description: 'setPedArmor and setElementHealth synchronization problems from Client to Server'
@@ -32,4 +25,11 @@ server:
3225
<<: *shared
3326

3427
client:
35-
<<: *shared
28+
<<: *shared
29+
examples:
30+
- path: 'examples/getElementHealth-1.lua'
31+
description: |
32+
This example outputs the player and vehicle health (if player is in a vehicle) to chatbox using /health command:
33+
- path: 'examples/getElementHealth-2.lua'
34+
description: |
35+
This example heals the player to 100 HP using /healme command if he's at 50 HP or lower:

functions/Element/setElementHealth.yaml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ shared: &shared
1515
- *450:* white steam 100%, black smoke 50%
1616
- *250:* white steam 0%, black smoke 100%
1717
- *249:* fire with big black smoke
18+
parameters:
19+
- name: 'theElement'
20+
type: 'element'
21+
description: 'The player, ped, vehicle or object element whose health you want to set.'
22+
- name: 'newHealth'
23+
type: 'float'
24+
description: 'A float indicating the new health to set for the element.'
1825
returns:
1926
description: |
2027
Returns *true* if the new health was set successfully, *false* otherwise.
2128
values:
2229
- type: 'bool'
2330
name: 'result'
24-
examples:
25-
- path: 'examples/setElementHealth-1.lua'
26-
description: |
27-
This example changes the player health to new specified value using /sethealth <value> command:
28-
- path: 'examples/setElementHealth-2.lua'
29-
description: |
30-
This example heals the player vehicle using the command /repairvehicle if it's below 1000 HP:
3131
issues:
3232
- id: 3807
3333
description: 'hpbar on hud is not compatible visually with MAX_HEALTH stat'
@@ -42,6 +42,14 @@ shared: &shared
4242

4343
server:
4444
<<: *shared
45+
examples:
46+
- path: 'examples/setElementHealth-1.lua'
47+
description: |
48+
This example changes the player health to new specified value using /sethealth <value> command:
4549
4650
client:
47-
<<: *shared
51+
<<: *shared
52+
examples:
53+
- path: 'examples/setElementHealth-2.lua'
54+
description: |
55+
This example heals the player vehicle using the command /repairvehicle if it's below 1000 HP:

web/resources/function.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,43 @@ <h1 style="border-bottom: 3px solid #FF7F00; margin-bottom: 0.1em;">{{ function.
1313
<p style="margin-top: 1em;">{{ function['server'].description }}</p>
1414
{% endif %}
1515

16+
<!-- Syntax -->
17+
{% for type_name in ['shared', 'client', 'server'] %}
18+
{% if function[type_name] %}
19+
{% if function[type_name].parameters %}
20+
<h2>Syntax</h2>
21+
<p>{{ function[type_name].parameters.description }}</p>
22+
23+
<pre><code class="language-lua"> {{ function[type_name].name }}(todo :mreow:)</code></pre>
24+
25+
<ul>
26+
{% for item in function[type_name].parameters %}
27+
<li style="margin-bottom: 1em;">
28+
<p>{{ item.name }} : {{ item.description }}</p>
29+
</li>
30+
{% endfor %}
31+
</ul>
32+
{% endif %}
33+
{% endif %}
34+
{% endfor %}
35+
36+
<!-- Returns -->
37+
{% for type_name in ['shared', 'client', 'server'] %}
38+
{% if function[type_name] %}
39+
{% if function[type_name].returns %}
40+
<h2>Returns</h2>
41+
<p>{{ function[type_name].returns.description }}</p>
42+
<ul>
43+
{% for item in function[type_name].returns["values"] %}
44+
<li style="margin-bottom: 1em;">
45+
<p>{{ item.type }} {{ item.name }}</p>
46+
</li>
47+
{% endfor %}
48+
</ul>
49+
{% endif %}
50+
{% endif %}
51+
{% endfor %}
52+
1653
<!-- Preview Images -->
1754
{% for type_name in ['shared', 'client', 'server'] %}
1855
{% if function[type_name] %}

0 commit comments

Comments
 (0)