Skip to content

Commit

Permalink
add syntax and return
Browse files Browse the repository at this point in the history
  • Loading branch information
ffsPLASMA committed Jan 22, 2025
1 parent a2da7ac commit 2edde00
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
7 changes: 7 additions & 0 deletions functions/Element/setElementHealth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ shared: &shared
- *450:* white steam 100%, black smoke 50%
- *250:* white steam 0%, black smoke 100%
- *249:* fire with big black smoke
parameters:
- name: 'theElement'
type: 'element'
description: 'The player, ped, vehicle or object element whose health you want to set.'
- name: 'newHealth'
type: 'float'
description: 'A float indicating the new health to set for the element.'
returns:
description: |
Returns *true* if the new health was set successfully, *false* otherwise.
Expand Down
37 changes: 37 additions & 0 deletions web/resources/function.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,43 @@ <h1 style="border-bottom: 3px solid #FF7F00; margin-bottom: 0.1em;">{{ function.
<p style="margin-top: 1em;">{{ function['server'].description }}</p>
{% endif %}

<!-- Syntax -->
{% for type_name in ['shared', 'client', 'server'] %}
{% if function[type_name] %}
{% if function[type_name].parameters %}
<h2>Syntax</h2>
<p>{{ function[type_name].parameters.description }}</p>

<pre><code class="language-lua"> {{ function[type_name].name }}(todo :mreow:)</code></pre>

<ul>
{% for item in function[type_name].parameters %}
<li style="margin-bottom: 1em;">
<p>{{ item.name }} : {{ item.description }}</p>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% endfor %}

<!-- Returns -->
{% for type_name in ['shared', 'client', 'server'] %}
{% if function[type_name] %}
{% if function[type_name].returns %}
<h2>Returns</h2>
<p>{{ function[type_name].returns.description }}</p>
<ul>
{% for item in function[type_name].returns["values"] %}
<li style="margin-bottom: 1em;">
<p>{{ item.type }} {{ item.name }}</p>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% endfor %}

<!-- Preview Images -->
{% for type_name in ['shared', 'client', 'server'] %}
{% if function[type_name] %}
Expand Down

0 comments on commit 2edde00

Please sign in to comment.