# Welcome!

{% hint style="danger" %}
**Note:** Please be aware of scam shops.&#x20;

Our only official store is: <https://store.veryinsanee.space>
{% endhint %}

Welcome to our documentation page.

Please select a documentation for the following products:

{% content-ref url="/pages/c50Wf1a3jS5vv1WSBT1k" %}
[Advanced Roleplay Environment](/advanced-roleplay-environment/installation)
{% endcontent-ref %}

{% content-ref url="/pages/JJw4Vh5pywi44yFj8CqC" %}
[veryinsanee's Whitelist](/veryinsanees-whitelist/installation)
{% endcontent-ref %}


# Installation

{% hint style="info" %}
**Note:** This script can be used with any framework since it has no dependencies.
{% endhint %}

## General

### Basic Installation

1. Download the script from the [FiveM Asset Manager](https://keymaster.fivem.net/asset-grants).
2. Extract the <mark style="color:yellow;">`visn_are.pack.zip`</mark>-archive into your <mark style="color:yellow;">`resources`</mark> folder.
3. Rename <mark style="color:yellow;">`visn_are.pack`</mark> to <mark style="color:yellow;">`visn_are`</mark>.
4. Open the <mark style="color:yellow;">`configuration`</mark> folder inside the <mark style="color:yellow;">`visn_are`</mark>-folder.
5. Customize the <mark style="color:yellow;">`client_config.lua`</mark> and <mark style="color:yellow;">`server_config.lua`</mark> to your needs.
6. Start the script.

![The console output should look like this if you have done everything correct.](https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2F3sHRoauz4rI0UTA6n0wV%2Ffdabae87c6cd4f39a4726e6d3834261d.png?alt=media\&token=cda5c53e-a580-4372-9736-37dfdf71f28c)

## ESX Integration

### esx\_ambulancejob integration

If you are using esx\_ambulancejob go into <mark style="color:yellow;">`esx_ambulancejob/client/main.lua`</mark> and replace:

{% tabs %}
{% tab title="Old" %}
{% code title="esx\_ambulancejob\client\main.lua" %}

```lua
AddEventHandler('esx:onPlayerSpawn', function()
	isDead = false
	
	if firstSpawn then
		firstSpawn = false
	
		if Config.SaveDeathStatus then
			while not ESX.PlayerLoaded do
				Wait(1000)
			end
	
			ESX.TriggerServerCallback('esx_ambulancejob:getDeathStatus', function(shouldDie)
				if shouldDie then
					Wait(1000)
					SetEntityHealth(PlayerPedId(), 0)
				end
			end)
		end
	end
end)

function OnPlayerDeath()
    isDead = true
    ESX.UI.Menu.CloseAll()
    TriggerServerEvent('esx_ambulancejob:setDeathStatus', true)

    StartDeathTimer()
    StartDistressSignal()

    StartScreenEffect('DeathFailOut', 0, false)
end
```

{% endcode %}
{% endtab %}

{% tab title="New" %}
{% code title="esx\_ambulancejob\client\main.lua" %}

```lua
AddEventHandler('esx:onPlayerSpawn', function()
    isDead = false
end)

function OnPlayerDeath()
    ESX.UI.Menu.CloseAll()
end
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Command Implementation

{% tabs %}
{% tab title="Revive Command (esx\_ambulancejob)" %}
To integrate the revive command, please do the following:

1. Open the file <mark style="color:yellow;">`server/main.lua`</mark> inside the <mark style="color:yellow;">`esx_ambulancejob`</mark>-folder and search for the command "revive" and replace it with following code.

{% tabs %}
{% tab title="ESX 1.1 or older" %}
{% code title="server/main.lua" %}

```lua
TriggerEvent('es:addGroupCommand', 'revive', 'admin', function(source, args ,user)
    if args[1] ~= nil then
        if GetPlayerName(tonumber(args[1])) ~= nil then
            TriggerClientEvent('esx_ambulancejob:revive', tonumber(args[1]))
            TriggerClientEvent('visn_are:resetHealthBuffer', tonumber(args[1]))
        end
    else
        TriggerClientEvent('esx_ambulancejob:revive', source)
        TriggerClientEvent('visn_are:resetHealthBuffer', source)
    end
end, function(source, args, user)
    TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient permissions.'}})
end, { help = _U('revive_help'), params = {{ name = 'id'}}})
```

{% endcode %}
{% endtab %}

{% tab title="ESX 1.2, Legacy or newer" %}
{% code title="server/main.lua" %}

```lua
ESX.RegisterCommand('revive', 'admin', function(xPlayer, args, showError)
    args.playerId.triggerEvent('esx_ambulancejob:revive')
    args.playerId.triggerEvent('visn_are:resetHealthBuffer')
end, true, {help = _U('revive_help'), validate = true, arguments = { {name = 'playerId', help = 'The player id', type = 'player'} }})
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

## QBCore Integration

### qb-ambulancejob Integration

If you are using qb-ambulancejob go into <mark style="color:yellow;">`qb-ambulancejob/fxmanifest.lua`</mark> and remove the following lines from client\_scripts:

```lua
'client/wounding.lua'
'client/laststand.lua'
'client/dead.lua'
```

### Command Implementation

{% tabs %}
{% tab title="Revive Command (qb-ambulancejob)" %}
To integrate the revive command, please do the following:

1. Open the file <mark style="color:yellow;">`server/main.lua`</mark> inside the <mark style="color:yellow;">`qb-ambulancejob`</mark>-folder and search for the command "revive" and replace it with following code.

{% tabs %}
{% tab title="qb-ambulancejob 1.0.0" %}
{% code title="server/main.lua" %}

```lua

QBCore.Commands.Add("revive", Lang:t('info.revive_player_a'), {{name = "id", help = Lang:t('info.player_id')}}, false, function(source, args)
	local src = source
	if args[1] then
		local Player = QBCore.Functions.GetPlayer(tonumber(args[1]))
		if Player then
			TriggerClientEvent('hospital:client:Revive', Player.PlayerData.source)
			TriggerClientEvent('visn_are:resetHealthBuffer', Player.PlayerData.source)
		else
			TriggerClientEvent('QBCore:Notify', src, Lang:t('error.not_online'), "error")
		end
	else
		TriggerClientEvent('hospital:client:Revive', src)
		TriggerClientEvent('visn_are:resetHealthBuffer', src)
	end
end, "admin")
```

{% endcode %}
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

## Standalone Integration

This script works out of the box for standalone. If you want to integrate custom framework things, have a look inside <mark style="color:yellow;">`visn_are/script/helpers/s_functions.lua`</mark>.

### Revive Command

A revive command is included in the script. You can enable it in the Server Config. In order to customize the permissions for it have a look inside <mark style="color:yellow;">`visn_are/script/helpers/s_functions.lua`</mark>.


# Guides


# Basic Gameplay Guide


# Medications

## General Guidelines

Never administer any form of medication to either yourself or someone else without consulting a medic and receiving permission to do so.

## Medications

### Morphine

Morphine is a pain-suppressant that stays in a patient's system for a very long time (30 minutes) and reaches maximum effect after 30 seconds. Morphine also lowers the patient's heart rate by up to -35 BPM. Due to these factors, morphine should be avoided when possible as they may cause complications in the case of future injuries. Only administer morphine if the patient is unable to fight with their current level of pain.

### Epinephrine

Epinephrine is an alternate word for adrenaline and is used to raise a patient's pulse, often in response to morphine overdoses. Epinephrine also increases the spontaneous wake-up chance. Epinephrine raises the patient's pulse by upwards of +50 BPM over a period of 10 seconds and stays in the system for 2 minutes.

### Fentanyl

Fentanyl is also pain-suppressant that stays in a patient's system for a very long time (30 minutes) and reaches maximum effect after 30 seconds. Only administer fentanyl if the patient is unable to fight with their current level of pain.&#x20;


# Wounds & Bandages

## Injuries

Each limb on the body can receive different types of injury. Each injury has a different level of pain and bleeding that it will inflict.

Each injury type also has a set of treatment procedures that are best suited for it - these will be laid out in the subsequent chapter about rendering aid.

## Wounds

### Abrasions

Also called scrapes, abrasions are the result of friction against a rough surface. Typically caused by vehicle collisions and falling.

### Avulsions

Avulsions occur when a major structure is removed by force, such as larger types of gunshot wounds (GSW).

### Contusion

Contusions are the result of a forceful trauma that damages an internal structure without breaking the skin. Some causes include vehicle collisions and falling.

### Crush

Caused by falling or vehicle collisions, crush wounds are wounds where the skin has been split and tearing underlying structures or shattering them.

### Cuts

Cuts are slicing wounds that produce even edges and can be as minor as a paper cut or significant as a surgical incision. Primarily caused by shrapnel and explosions.

### Laceration

Lacerations are slicing wounds that produce ragged edges. Most often the result of vehicle collisions or falling.

### Velocity Wound

Caused by small objects entering the body at high speed, typically a bullet or small pieces of shrapnel.

### Puncture Wound

Deep, narrow wounds produced by sharp objects like knives or very small pieces of shrapnel.

## Bandages

### Field Dressing

Field dressing is average treatment, a jack of all trades, master of none.

### Packing bandages

Packing bandages have a higher re-opening chance than field dressings, but a longer reopening delay than other forms of treatment.

### Elastic bandages

Elastic bandages can treat any wound in just one bandage but have a much higher re-opening chance and shorter reopening delay compared to other bandages.

### QuikClot

QuikClot is a clotting agent that promotes the body's natural clotting process. It is a lot less effective than the other types of bandages, but have a significantly lower chance of reopening, and if they do re-open, they take a long time to do so.


# Blood Loss, IVs, Stabilzation

## Blood Loss

Blood loss is divided into 5 classes, 4 of which have a cautionary text accompanied with them:

| Class   | Description                  | Liters             |
| ------- | ---------------------------- | ------------------ |
| Class 1 | No warning text              | 6 liters (default) |
| Class 2 | Lost some blood              | 5.1 liters         |
| Class 3 | Lost a lot of blood          | 4.2 liters         |
| Class 4 | Lost a large amount of blood | 3.6 liters         |
| Class 5 | Lost a fatal amount of blood | 3 liters           |

Generally what we recommend to aspiring medics is to not treat class 5 blood loss as doing so would require over 2 liters of IV fluids to stabilize them. Class 4 blood loss should only be treated if the supply situation allows it.

## IVs

### Blood

A blood infusion will transfer blood into the system of the patient. Be careful with the amount of it.

### Propofol

A propofol infusion will cause anesthesia on a patient. The anesthesia will stop after the infusion has finished.

## Stabilization

A patient is considered stable when:

* Are bleeding at a rate slower than 1/4 of their cardiac output. (Pretty extensive to account for so just take this as saying the patient should preferentially have all wounds bandaged).
* Their pulse is above 40.
* Their blood pressure is above 50/60.
* They have class 1 or 2 blood loss.


# Surgical Kit & Emergency Revive Kit

## Surgical Kit

The surgical kit is part of the medic's specialized equipment and is used to stitch together bandaged wounds to remove the possibility of them reopening.

## Emergency Revive Kit

The Emergency revive kit serves only one purpose, reset a patient's status entirely. Regardless of what is wrong with them, a ERK will reset all conditions to default.


# Cardiac Arrest & CPR

Cardiac arrest is a very serious condition where a patient does not have any pulse. When you discover someone to be in cardiac arrest, it is crucial that you (1) apply tourniquets on any injured limbs, (2) bandage their head and torso, and (3) perform CPR until the patient regains a pulse or a medic relieves you.

It is recommended to control the patient's pulse after every 2 rounds of CPR to make sure you aren't performing CPR on a patient that already has a pulse.

Note: Checking a patient's pulse when someone is performing CPR will produce a false positive.


# Mass-Casualty Incidents & Triage

## Mass-Casualty Incident

A mass-casualty incident is an incident in which a significant amount of personnel have been injured and gone unconscious within the same general area. The priority during the initial response to a mass-casualty incident should be to triage the wounded and determine who needs what care, when.

## Triage

Triage is split into 4 classifications:

| Class     | Color  | Description                                                                       |
| --------- | ------ | --------------------------------------------------------------------------------- |
| Immediate | Red    | Needs immediate qualified medical care to prevent loss of life.                   |
| Delayed   | Yellow | Needs immediate qualified medical care to prevent loss of life.                   |
| Minor     | Green  | Personnel who need minimal care. Often class 3 can treat themselves if conscious. |
| Expectant | Black  | Treatment would be to the detriment of others. E.g. Class 5 blood loss.           |

Triage depends on several factors, such as the patient's role; medics are always prioritized above all others though.


# Heart Rate & Blood Pressure

## Heart Rate

The heart rate is the number of beats per minute (bpm) that the patient's heart makes.

We classify these into categories:

| Pulse category |        BPM        |   Condition  |
| :------------: | :---------------: | :----------: |
|      Green     |    46 - 119 BPM   | Normal Pulse |
|     Yellow     | 120 and above BPM |  High Pulse  |
|       Red      |       45 BPM      |   Low Pulse  |
|      Black     |       0 BPM       |   No Pulse   |

## Blood Pressure

Blood Pressure is measured by systolic and diastolic blood pressure - often expressed in the form ( systolic / diastolic)

You need to pay attention to the systolic and diastolic blood pressure to diagnose a condition. You can categorize blood pressure into categories as follows:&#x20;

<table><thead><tr><th align="center">Blood pressure category</th><th align="center">SYSTOLIC mm Hg </th><th width="90" align="center">and/or</th><th align="center">DIASTOLIC mm Hg</th></tr></thead><tbody><tr><td align="center">Normal</td><td align="center">Less than 120</td><td align="center">and</td><td align="center">Less than 80</td></tr><tr><td align="center">Elevated</td><td align="center">120 - 129</td><td align="center">and</td><td align="center">Less than 80</td></tr><tr><td align="center">High blood pressure (Stage 1)</td><td align="center">130 - 139</td><td align="center">or</td><td align="center">80-89</td></tr><tr><td align="center">High blood pressure (Hypertension) Stage 2 </td><td align="center">140 or higher</td><td align="center">or</td><td align="center">90 or higher</td></tr><tr><td align="center">Hypertensive crisis</td><td align="center">Higher than 180</td><td align="center">and/or</td><td align="center">Higher than 120</td></tr></tbody></table>

### Overview Image

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FjvLNYeckoKpng3VlRXBr%2F930706887_preview_Capture23.PNG?alt=media&amp;token=b4106f3b-5e3f-4db8-8990-9791b35cd954" alt=""><figcaption><p>Blood pressure sheet</p></figcaption></figure>


# Basic Configuration Guide


# Client Configuration

{% hint style="info" %}
**You aren't finding the config option? Try STRG + F.**
{% endhint %}

## Language System

<details>

<summary>m_languageCode</summary>

Translates all text messages to the specified language. File must be existent in languages folder.

Default: "en"

</details>

## General Settings

<details>

<summary>m_damageEnableCooldown</summary>

After this time in ms, the damage system will be enabled (useful when player dies on spawn for example)

Default: 7500

</details>

<details>

<summary>m_maxInteractionDistance</summary>

The distance that is needed to interact with people.

Default: 2

</details>

<details>

<summary>m_lastDamageCooldown</summary>

The cooldown when the next damage can be handled after damage has happended (recommend to leave it at default value. | also in \~ms)

Default: 210

</details>

<details>

<summary>m_vehicleScanRadius</summary>

The vehicle scan radius in gta units.

Default: 6

</details>

<details>

<summary>m_disabledWeapons</summary>

A table of weapons that will be ignored by the system.

Default: { GetHashKey("WEAPON\_PLASMAP") }

</details>

<details>

<summary>m_ox_target_support</summary>

If true, the ox target system will be enabled. (see: c\_functions.lua line 505)

Default: false

</details>

<details>

<summary>m_update_queue_interval</summary>

The interval in ms, when the health buffer update queue will be executed.

Default: 250

</details>

## Keys

<details>

<summary>m_configurableKeys</summary>

A config option for keys configuration.

</details>

## Menu Settings

<details>

<summary>m_onlyShowActionsIfPlayerHasRequiredItems</summary>

Set this to 'true' to only show actions, if the player has the required items. (could affect performance)

Default: true

</details>

## Feature Settings

<details>

<summary>m_enableSewings</summary>

Enable this to enable the sewing system.

Default: true

</details>

<details>

<summary>m_sewingBloodLoss</summary>

The amount of blood loss when having a sewed wound.

Default: 0.1

</details>

<details>

<summary>m_blurScreenOnHighBloodLoss</summary>

Enable this to blur the screen when high blood loss is detected. (bloodVolume <= 4200ml)

Default: true

</details>

<details>

<summary>m_allowManualRespawnWhileBeingUnconscious</summary>

Set this to 'true' to allow manual respawn after time has expired. (disables automatic respawn)

Default: false

</details>

<details>

<summary>m_limpingFeature</summary>

A config option for the limping feature.

</details>

<details>

<summary>m_showTriage3dMarkers</summary>

Enable this to show the triage markers in 3d.

Default: true

</details>

<details>

<summary>m_triage3dMarkersDistance</summary>

The distance in gta units, when the triage markers will be shown.

Default: 7

</details>

<details>

<summary>m_update_triage_info_interval</summary>

The interval in ms, when the triage info will be updated.

Default: 1000

</details>

<details>

<summary>m_respawnOnCriticalBloodVolume</summary>

Enable this to respawn the player when the blood volume is critical.

Default: true

</details>

<details>

<summary>m_bodybagUnconsciousTime</summary>

The time in seconds, when the player will be unconscious after being put in a bodybag.

Default: 300

</details>

<details>

<summary>m_enableWeaponAimShakeOnArmInjury</summary>

</details>

<details>

<summary>m_weaponDisableAfterBeingRevived</summary>

Disable weapons after being revived.

</details>

<details>

<summary>m_emergencyDispatch</summary>

Enable this to enable the emergency dispatch system. (Button press while being dead to alert emergency services)

</details>

<details>

<summary>m_spawnGameObjects</summary>

Enable this to enable the spawn game objects feature (bandages on ground etc).

</details>

## Beta Features

<details>

<summary>m_lowerHeartRatePerSecondOnUncounscious</summary>

The amount of the lowering heart rate per second, when the player is unconscious. | 0.0 to disable.

Default: 0.06

</details>

<details>

<summary>m_lowerHeartRatePerSecondOnUncounsciousNonRecoveryMode</summary>

The amount of the lowering heart rate per second, when the player is unconscious and non recovery mode. | 0.0 to disable

Default: 4.54

</details>

<details>

<summary>m_nonRecoveryModeOnZeroHeartRateSince</summary>

The time in ms, when the player will go into "non-recovery-mode" when the heart rate is 0. (After 3 minutes of zero heart rate player has a fatal brain function loss) | 0 to disable!

Default: 60000 \* 5

</details>

<details>

<summary>m_nonRecoveryModeOnFatalInjury</summary>

The non-recovery mode on injury settings.

</details>

## Screen Effects

<details>

<summary>m_enabledScreenEffects</summary>

The enabled screen effects. ("bleeding", "pain")

Default: { "bleeding", "pain" }

</details>

## Controls

<details>

<summary>m_enabledControlActionsWhenUnconscious</summary>

The enabled control actions when unconscious.

</details>

<details>

<summary>m_enabledControlActionsWhenCarrying</summary>

The enabled control actions when carrying.

</details>

<details>

<summary>m_disabledControlGroups</summary>

The disabled control groups.

</details>

## Respawn Settings

<details>

<summary>m_respawnConfiguration</summary>

Settings about the respawn. (WARNING: When m\_dependUnconsciousTimeOnMedicCount is enabled, the respawn time here will be overwritten. See: [here](/advanced-roleplay-environment/guides/basic-configuration-guide/server-configuration#m_dependunconscioustimeonmediccount))

</details>

## Default Settings

<details>

<summary>m_defaultValues</summary>

Settings about the default settings. (recommend to leave at default)

</details>


# Server Configuration

{% hint style="info" %}
**You aren't finding the config option? Try STRG + F.**
{% endhint %}

## General Settings

<details>

<summary>m_itemsNeeded</summary>

Set this 'true', if you want that players need items to perform actions.

Default: false

</details>

<details>

<summary>m_reviveCommand</summary>

Set this 'true', if you want to enable the integrated revive command. For permissions see s\_functions.lua (IsAllowedToUseReviveCommand)

Default: false

</details>

## Custom ESX Settings

<details>

<summary>m_esxSharedObject</summary>

Config option for esx settings

</details>

## Custom QBCore Settings

<details>

<summary>m_qbCoreResourceName</summary>

Set the resource name of the QBCore (needed for export)

Default: "qb-core"

</details>

## Inventory

<details>

<summary>m_customInventory</summary>

A config option for those who use a custom inventory

</details>

## Feature Settings

<details>

<summary>m_ignoreItemsNeededJobs</summary>

A table of jobs that ignore the that players need items to perform actions.

Default: { "ambulance" }

</details>

<details>

<summary>m_dependUnconsciousTimeOnMedicCount</summary>

Overwrites the default time configured in the client config ([here](/advanced-roleplay-environment/guides/basic-configuration-guide/client-configuration#m_respawnconfiguration)) and depends the time on the count of the medics that are online.

</details>

<details>

<summary>m_limitMenuToJobs</summary>

Limits the menu to certain jobs.

</details>

<details>

<summary>m_triageSystem</summary>

Find a detailed explanation about the triage system here: [Triage System](/advanced-roleplay-environment/guides/basic-gameplay-guide/mass-casualty-incidents-and-triage#triage)

</details>

<details>

<summary>m_stateSaving</summary>

This feature will save the state of the players (like injuries, blood pressure) to a file or mysql database.

</details>

<details>

<summary>m_discordLogging</summary>

This feature will log kill logs to discord.

</details>

## Menu Settings

<details>

<summary>m_showNameOfPlayerOnMenuTitle</summary>

Set this to 'true', if you want that the system will show the name of the player on the menu title. Set this to 'false', if you want that the system will not show the name of the player on the menu title.

Default: true

</details>

## Respawn Settings

<details>

<summary>m_respawnConfiguration</summary>

Server-side respawn configuration config option.

</details>


# Advanced Configuration Guide


# Adding injuries

*Advanced Roleplay Environment supports modular injuries. This means you can easily add injuries or edit them accordingly.*

## Adding injuries

In order to add an injury we just need to add the injury inside the injuries file and configure the properties accordingly.

### Adding the injury

Since all injuries are saved inside <mark style="color:yellow;">`script/entities/injuries.lua`</mark>, we will open this file. This should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FkEFkusnIOFc7T53q8i1K%2FAm7jl46.png?alt=media&amp;token=61154107-332d-4061-8602-c27cf8e5d25c" alt=""><figcaption><p>script/entities/injuries.lua</p></figcaption></figure>

We will scroll to the bottom of this file and we will just copy n' paste a injury from above and edit the copied injury. So it should like this now:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FVdu9I6tRryBrxYqKv4qJ%2FPgrLTyp.png?alt=media&amp;token=2f6f4855-5073-4f3e-8bd2-9de155b830c6" alt=""><figcaption><p>script/entities/injuries.lua</p></figcaption></figure>

### Configuring the injury

There are many options for the injury so that we can edit it perfectly for our needs.

Lets begin with explaining.

| Option              | Description                                                                                                                                                                                                                                                                                                                                                     | Example                                                                                                                                                                                                                                  |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| causes              | This property is a table that contains every [damage type](/advanced-roleplay-environment/guides/advanced-configuration-guide/adding-damage-types) the injury should be added on.                                                                                                                                                                               | <p><code>causes = { "falling" }</code><br>Using it like this, the injury will be added when the player receives fall damage (or the damage type "falling" is triggered).</p>                                                             |
| bleeding            | This property is a number which contains the intensity of the bleeding caused by the injury. Using a higher number the injury will bleed more and using a smaller number the injury will bleed less. There is neither a minimum or maximum.                                                                                                                     | <p><code>bleeding = 0.2</code><br>The injury has a bleeding intensity of 0.2.<br><em>An exact amount of the blood loss can't be given since it is calculated on where the injury is, what heart rate the player has and so on..</em></p> |
| pain                | <p>This property is a number which contains the intensity of the pain caused by the injury. Using a higher number the injury will cause  more pain and the player heart rate will rise and using a lower number the injury will cause a less pain and the heart rate won't grow as high as using a higher number.<br>There is neither a minimum or maximum.</p> | <p><code>pain = 0.3</code><br>The injury has a pain intensity of 0.3.</p>                                                                                                                                                                |
| minDamage           | This property is a number and contains the damage that have to be received as minimum in order that the system will consider this injury at the handling process.                                                                                                                                                                                               | <p><code>minDamage = 25</code><br>The player has to receive 25 damage at minimum otherwise this injury won't be considered in the adding process.</p>                                                                                    |
| maxDamage           | This property is a number and contains the maximum damage that can be achieved before the number is no longer considered in handling.                                                                                                                                                                                                                           | <p><code>maxDamage = 30</code><br>The player is not allowed to take more than 30 damage otherwise the injury isn't considered in the adding process anymore.<br></p>                                                                     |
| causeLimping        | This property is a boolean and contains the value if this injury will cause limping. (Only applies if the injury is a leg injury)                                                                                                                                                                                                                               | <p><code>causeLimping = true</code><br>Setting it to true the injury will cause limping now when it is a leg injury.</p>                                                                                                                 |
| causeFracture       | [Not implemented yet.](#user-content-fn-1)[^1]                                                                                                                                                                                                                                                                                                                  | Not implemented yet.                                                                                                                                                                                                                     |
| causeWeaponAimShake | This property is a boolean and contains the value if this injury will cause aim shake while aiming with a weapon. (Only applies if the injury is a arm injury)                                                                                                                                                                                                  | <p><code>causeWeaponAimShake = true</code><br>Setting it to true the injury will cause aim shake when aiming with a weapon if this injury is a arm injury.</p>                                                                           |
| needSewing          | This property is a boolean and contains the value if the wound need to be seewed. (Only if the conditions are met. Since the conditions are random it is a 40% chance)                                                                                                                                                                                          | <p><code>needSewing = true</code><br>Setting it to true the injury could cause a needed sew.</p>                                                                                                                                         |
| exclusiveBodyParts  | This property is a table and contains every body part which the injury can be applied on.                                                                                                                                                                                                                                                                       | <p>exclusiveBodyParts = { "head" }<br>Using it like this the injury will only be considered if the injury should be on the head. </p>                                                                                                    |
| timeout             | This property is a number and contains the value in seconds after the wound will be removed automatically.                                                                                                                                                                                                                                                      | <p><code>timeout = 100</code><br>Using it like this the injury will be removed after 100 seconds automatically.</p>                                                                                                                      |

### Adding the translation

Since the translation is missing it will look weird inside the ui. So we need to add it in our locale files. So we open our locale file (example: languages/en.json) and copy 'n' paste just an other entry and edit the values accordingly. So it should look like this if added like [above](#adding-the-injury):

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FcMIj1IyDAtWvcMNj3mZQ%2FeWPGvcz.png?alt=media&amp;token=314cd68b-4521-436b-893c-e7049381a9ed" alt=""><figcaption></figcaption></figure>

[^1]:


# Adding damage types

*Advanced Roleplay Environment supports modular damage types. This means you can easily add damage types or edit them accordingly.*

## Adding damage types

In order to add a damage type we need to add the damage type inside the damage types file and the according damage type hash and configure the properties accordingly.

### Adding the damage type

Since all damage types are saved inside <mark style="color:yellow;">`script/entities/damage_types.lua`</mark>, we will open this file. This should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FC4UvZm7N0HbHgr9pfR7s%2FjFS9Rml.png?alt=media&amp;token=804a42b4-fd40-441d-aefd-6f176a591f5a" alt=""><figcaption><p>script/entities/damage_types.lua</p></figcaption></figure>

Now we will scroll to the bottom and just copy a damage type from above and edit it to our needs so it should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FIL4FXi0OQVxneNeO2IH8%2FTm0khGA.png?alt=media&amp;token=42afe73c-f1fb-4d4e-a38f-4d489fc9e4eb" alt=""><figcaption><p>script/entities/damage_types.lua</p></figcaption></figure>

### Configuring the damage type

There are two options available for us to configure the damage type.

| Option            | Description                                                                                                                                                                                                                                                                                                                                                                                                       | Example                                                                                                                                                                                                                                  |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| thresholds        | <p>This property is a table and contains the damage thresholds of a received damage. <br>It works like this: If there is an entry with a damage of 1 this entry will cause <em>n</em> injuries (<em>n is defined by the amount property in the entry</em>). If there are two entries or more all entries will be executed if the damage is equal or higher than needed damage defined in the threshold entry.</p> | <p><code>thresholds = { { damage = 1, amount = 2 }, { damage = 15, amount = 3 } }</code><br>Using it like this the damage type will cause 2 injuries if the damage is >= 1. If the damage is >= 15 it will also add 3 injuries more.</p> |
| selectionSpecific | This property is a boolean and contains the value if the damage type should be selection specific. So when received a leg injury if it should apply on the leg or on a random body part.                                                                                                                                                                                                                          | <p><code>selectionSpecific = false</code><br>Using it like this the damage type will ignore where the player has been hit and choose a random body part. (Good for explosions maybe?)</p>                                                |

### Adding the damage type to a damage hash

In order that the damage type will be triggered we need to link it to a damage hash from the game. So lets do this.

We need to go the section ENUM\_DAMAGE\_HASHES and scroll down to the bottom of it and copy the last value and edit it to our needs, so it should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FJNF5eSo24ssnnZNk3gOR%2Fghjk.png?alt=media&amp;token=ab46562e-1bea-40d5-b319-c3e7f51c7701" alt=""><figcaption><p>script/entities/damage_types.lua</p></figcaption></figure>

As you can see we've edited the hash and the category. The category is defined above [here](#adding-the-damage-type). If we have added and configured everything properly and also a [injury for it](/advanced-roleplay-environment/guides/advanced-configuration-guide/adding-injuries), we should now receive an injury.


# Adding medications

*Advanced Roleplay Environment supports modular medications. This means you can easily add medications or edit them accordingly.*

## Adding medications

In order to add a medication we just need to add the medication inside the medications file and configure the properties accordingly.

### Adding the medication

Since all medications are saved inside <mark style="color:yellow;">`script/entities/medications.lua`</mark>, we will open this file. This should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FkOuCEYNEwClLBEtCiSDy%2F2BCQFyo.png?alt=media&amp;token=dc735a8a-0e85-4afe-ab76-227253966d23" alt=""><figcaption><p>script/entities/medications.lua</p></figcaption></figure>

Now we will scroll to the bottom and just copy a medication from above and edit it to our needs so it should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FRalyvO794ZXKiuPZlNvv%2FyZMEdHM.png?alt=media&amp;token=2252974d-e865-449a-bda8-b4e5ad940c0a" alt=""><figcaption><p>script/entities/medications.lua</p></figcaption></figure>

### Configuring the medication

There are many options available for us to configure the medication perfectly to our needs.

<table><thead><tr><th width="248.33333333333331">Option</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>painReduce</td><td>This property is a number and contains the value of how much the pain get reduced.</td><td><code>painReduce = 0.3</code><br>The pain get reduced by 0.3 * <code>effectRatio</code> per second.</td></tr><tr><td>hrIncreaseLow</td><td>This property is a table contains a table { minIncrease, maxIncrease } how much the heart rate will increase or decrease if the heart rate is below 55 bpm. </td><td><code>hrIncreaseLow = { -10, 10 }</code><br>The heart rate will in minimum decrease by 10 or in maximum increase by 10 if the heart rate is below 55 bpm.</td></tr><tr><td>hrIncreaseNormal</td><td>This property is a table contains a table { minIncrease, maxIncrease } how much the heart rate will increase or decrease if the heart rate is >= 55 bpm and &#x3C;= 110 bpm.</td><td><code>hrIncreaseNormal = { 5, 20 }</code> <br>The heart rate will in minimum increase by 5 and in maximum by 20 if the heart rate is >= 55 bpm and &#x3C;= 110 bpm.</td></tr><tr><td>hrIncreaseHigh</td><td>This property is a table contains a table { minIncrease, maxIncrease } how much the heart rate will increase or decrease if the heart rate is > 110 bpm</td><td><code>hrIncreaseHigh = { 2, 7 }</code><br>The heart rate will in minimum increase by 2 and in maximum by 7 if the heart rate is above 110 bpm.</td></tr><tr><td>timeInSystem (maxTimeInSystem)</td><td>This property is a number and contains the value how long a medication is kept in the system before removing it. Also it will be used to calculate the effect ratio. (in seconds)</td><td><code>timeInSystem = 1800</code><br>The medication is kept 1800 seconds in system before removing it.<br><br>Calculation for the effect ratio: <br><code>effectRatio = min((timeInSystem / timeTillMaxEffect) ^ 2, 1) * (maxTimeInSystem - timeInSystem) / maxTimeInSystem</code><br><br>To understand the effect ratio formula we need to define the values where:<br> - timeInSystem is variable and describes the current time in the system in seconds.<br> - timeTillMaxEffect is a constant and describes the time till the effect ratio reaches 1.<br> - maxTimeInSystem is a constant and describes how long the medication will stay in the system until it reaches 0.0 effect ratio at the end.<br> - min(valueA, valueB) will always return the lowest value of both so if valueA is 5 and valueB is 8 it will return 5. In our example it is a calculation and 1 so it will always be less &#x3C;= 1.</td></tr><tr><td>timeTillMaxEffect</td><td>This property is a number and contains the value when the max effect ratio is reached. (in seconds)</td><td><code>timeTillMaxEffect = 30</code><br>The medication will reach its max effect after 30 seconds so a effect ratio of 1.</td></tr><tr><td>maxDose</td><td>This property is a number and contains the value after how many medications in system the function <code>onOverDose</code> will be triggered.</td><td><code>maxDose = 5</code><br>The property onOverDose will be triggered after 5 times of injection of this medication.</td></tr><tr><td>onOverDose</td><td>This property is a function and will be triggered if the number of the same medication in the system is >= <code>maxDose</code></td><td><code>onOverDose = function()</code> <br>    <code>print("hello!")</code><br><code>end</code><br>The function will print "hello" after this function has been triggered.</td></tr><tr><td>viscosityChange</td><td>The viscosity of a fluid is a measure of its resistance to gradual deformation by shear stress or tensile stress. For liquids, it corresponds to the informal concept of "thickness". This value will increase/decrease the viscoty of the blood with the percentage given. Where 100 = max. Using the minus will decrease viscosity.</td><td><code>viscosityChange = -10</code><br>The peripheral resistance will reduce by maximum 10 and <code>viscosityChange * effectRatio</code> per second.</td></tr></tbody></table>


# Adding bandages

*Advanced Roleplay Environment supports modular bandages. This means you can easily add bandages or edit them accordingly.*

## Adding bandages

In order to add a bandage we just need to add the bandage inside the bandages file and configure the properties accordingly.

### Adding the bandage

Since all bandages are saved inside <mark style="color:yellow;">`script/entities/bandages.lua`</mark>, we will open this file. This should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FS0n44aD3CEZOXs8oKjsY%2FNGtiMMG.png?alt=media&amp;token=e2eae101-f592-4039-ba48-d576c52a1451" alt=""><figcaption><p>script/entities/bandages.lua</p></figcaption></figure>

Now we will scroll to the bottom and just copy a bandage from above and edit it to our needs so it should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2Fr8ZvBtbq7rd8h5l7yG1q%2FLWRPBiJ.png?alt=media&amp;token=97503dbf-2625-472c-a49c-8986abf3fcb2" alt=""><figcaption><p>script/entities/bandages.lua</p></figcaption></figure>

### Configuring the bandage

There are many options available for us to configure the bandage perfectly to our needs.

Basically all properties are default values but we can assign exact values for every injury (like in the example above we have configured some default properties and specific properties for the abrasion only) so that we can configure it perfectly.

<table><thead><tr><th width="248.33333333333331">Option</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>effectiveness</td><td>This property is a number and contains the value of how effective this bandage is by default.</td><td><code>effectiveness = 1</code><br>This bandage has a effectiveness by 1. If there is a injury configured with a effectiveness by 2 on it, this injury will be selected to heal first.</td></tr><tr><td>cooldown</td><td>This property is a number and contains the value of how long the action takes to apply this bandage via the ui. </td><td><code>cooldown = 10</code><br>The action has a duration of 10 seconds.</td></tr><tr><td>reopeningChance</td><td>This property is a number and contains the reopening chance (sewing needed) of a wound. From 0 to 1 in decimals.</td><td><code>reopeningChance = 0.3</code><br>The bandage has by default a reopening chance of 30 percent.</td></tr><tr><td>reopeningMinDelay</td><td>This property is a number and contains the min delay before a sewing needed wound reopens.</td><td><code>reopeningMinDelay = 30</code><br>If the wound is a sewing needed wound then in minimum it takes the wound 30 seconds to reopen.</td></tr><tr><td>reopeningMaxDelay</td><td>This property is a number and contains the max delay before a sewing needed wound reopens.</td><td><code>reopeningMaxDelay = 50</code><br>If the wound is a sewing needed wound then in maximum it takes the wound 50 seconds to reopen.</td></tr></tbody></table>

### Adding the translation

Since the translation is missing it will look weird inside the ui. So we need to add it in our locale files. So we open our locale file (example: languages/en.json) and copy 'n' paste just an other entry and edit the values accordingly. So it should look like this if added like [above](#adding-the-bandage):

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FSGXgeN1q5yFSU1ovHyPW%2Fe9zJ0S5.png?alt=media&amp;token=8ee6e2a0-f988-4172-95f1-f9145c661eb3" alt=""><figcaption></figcaption></figure>


# Adding infusions

*Advanced Roleplay Environment supports modular* infusion&#x73;*. This means you can easily add medications or edit them accordingly.*

## Adding infusions

In order to add a infusion we just need to add the infusion inside the infusions file and configure the properties accordingly.

### Adding the infusion

Since all infusion are saved inside <mark style="color:yellow;">`script/entities/infusions.lua`</mark>, we will open this file. This should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FYwsrmNPnllPeJCqIu5il%2FmsYLlkP.png?alt=media&amp;token=aa4dbfc6-5c09-4284-86be-612d5c5ba34a" alt=""><figcaption><p>script/entities/infusions.lua</p></figcaption></figure>

Now we will scroll to the bottom and just copy a infusion from above and edit it to our needs so it should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FyCd1L5dsn2rdVwWbC9zp%2FDIVfMYs%20(1).png?alt=media&amp;token=c03d9f36-308e-4502-8b41-b9f5e00c65e1" alt=""><figcaption><p>script/entities/infusions.lua</p></figcaption></figure>

### Configuring the infusion

There are many options available for us to configure the infusion perfectly to our needs.

<table><thead><tr><th width="248.33333333333331">Option</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>availableVolumes</td><td>This property is a table and contains all volumes that will be created and displayed in the ui.</td><td><code>availableVolumes = { 100, 200 }</code><br>Using it like this will produce two volumes: One with 100 milliliters and one with 200 milliliters.</td></tr><tr><td>cooldown</td><td>This property is a number and contains the value of how long the action takes to apply this infusion via the ui.  </td><td><code>cooldown = 10</code><br>The action has a duration of 10 seconds.</td></tr><tr><td>ivChangePerSecond</td><td>This property is a number and contains value of how much of the infusion will be removed/processed per second.</td><td><code>ivChangePerSecond = 3</code><br>The infusion will process 3 milliliter per second. So if 100 milliliters is our volume the infusion has gone trough after ~34 seconds (100ml / 3ml/s).</td></tr><tr><td>onTick</td><td>This property is a function and will be triggered every second.</td><td><code>onTick = function(clientData, healthBuffer, bodyPart, ivChange, totalVolume)</code><br><code>print("hello")</code><br><code>end</code><br>Using it like this the infusion would print "hello" every second in the console.</td></tr><tr><td>onFinish</td><td>This property is a function that will be executed when the infusion has gone trough.</td><td><code>onFinish = function(clientData, healthBuffer, bodyPart, ivChange, givenVolume)</code><br><code>print("finished")</code><br><code>end</code><br>Using it like this the infusion would print "finished" in the console when it has gone trough.</td></tr></tbody></table>

### Adding the translation

Since the translation is missing it will look weird inside the ui. So we need to add it in our locale files. So we open our locale file (example: languages/en.json) and copy 'n' paste just an other entry and edit the values accordingly. So it should look like this if added like [above](#adding-the-infusion):

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FXz3BTk6msvssajBBwsz5%2FtWXXctm.png?alt=media&amp;token=922b927b-676f-4af4-94af-e155bef7e98e" alt=""><figcaption></figcaption></figure>


# Adding menu actions

*Advanced Roleplay Environment supports modular* menu action&#x73;*. This means you can easily add* menu actions *or edit them accordingly.*

## Adding menu actions

In order to add a menu actionswe just need to add the menu action inside the menu actions file and configure the properties accordingly.

### Adding the action

Since all infusion are saved inside <mark style="color:yellow;">`script/entities/actions.lua`</mark>, we will open this file. This should look like this:

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FmnSVBJBNgqbL6ltuIbUT%2FRwOnwgh.png?alt=media&amp;token=fc0f8872-d136-4609-86a9-c31a4957838f" alt=""><figcaption><p>script/entities/actions.lua</p></figcaption></figure>

Now we will select our category and just copy a action from above and edit it to our needs so it should look like this (In this example I've selected the category "carry"):

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2Fsb1sOcwOlCLE7MEycJht%2F5V8QxQu.png?alt=media&amp;token=2066b5ed-0beb-45f5-85df-40ba91856e16" alt=""><figcaption><p>script/entities/infusions.lua</p></figcaption></figure>

### Configuring the menu action

There are many options available for us to configure the menu action perfectly to our needs.

<table><thead><tr><th width="248.33333333333331">Option</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>name</td><td>This property is a string and contains the unique name of the action which should be unique.</td><td><code>name = "TEST_ACTION"</code><br>The name of this action in the locales for example is "TEST_ACTION".</td></tr><tr><td>cooldown</td><td>This property is a number and contains the value of how long the action takes to perform this action via the ui.  </td><td><code>cooldown = 10</code><br>The action has a duration of 10 seconds.</td></tr><tr><td>animation</td><td>This property is a table and contains the animation that will be played upon executing the action.<br><code>structure = { lib = "YOUR_LIB", name = "YOUR_NAME" }</code></td><td><code>animation = { lib = "anim@heists@narcotics@funding@gang_idle", name = "gang_chatting_idle01" }</code><br>The animation defined above will be used.</td></tr><tr><td>hideOnSelf</td><td>This property is a boolean and sets if the action should be only shown on other players or should also be shown on the local player.</td><td><code>hideOnSelf = true</code><br>This action is only shown on other players.</td></tr><tr><td>exclusiveBodyParts</td><td>This property is a table that contains exclusive body parts the action should be shown on. (If not defined, the action will be shown on all body parts)</td><td><code>exclusiveBodyParts = { "HEAD" }</code><br>This action will be only shown on the head.</td></tr><tr><td>log</td><td>This property is a function that will be executed and the return value will be added to the log of the player. <strong>This function must return a string.</strong></td><td><code>log = function(bodyPart, result)</code><br>    <code>return "hello!"</code><br><code>end</code><br>Using it like this, it will add "hello" to the action log.</td></tr><tr><td>condition</td><td>This property is a function that will be executed to check if the function should be shown or not. <strong>This function must return true or false.</strong></td><td><code>condition = function(healthBuffer, bodyPart) return not healthBuffer.bodybag end</code><br>This action will only show if the player is not in a bodybag.</td></tr><tr><td>action</td><td>This property is a function that will be executed when the action has been clicked.<br><strong>The function must have call the callback function that will be passed to the log function.</strong></td><td><code>action = function(clientData, healthBuffer, bodyPart, callback)</code><br><code>print("done")</code><br><code>callback(true)</code><br><code>end</code><br>Using it like this the action will print "done" in the console on use.</td></tr></tbody></table>

### Adding the translation

Since the translation is missing it will look weird inside the ui. So we need to add it in our locale files. So we open our locale file (example: languages/en.json) and copy 'n' paste just an other entry and edit the values accordingly. So it should look like this if added like [above](#adding-the-action):

<figure><img src="https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FHYivFM1pHUq18nrO9Mow%2F8BY3Qn2.png?alt=media&amp;token=de1ee87a-71b5-43e0-971a-32283a8d541c" alt=""><figcaption></figcaption></figure>


# API Reference

## Client

To access functions use the following export: <mark style="color:yellow;">`exports["visn_are"]:GetSharedFunctions()`</mark>

To access fields use the following export: <mark style="color:yellow;">`exports["visn_are"]:GetSharedVariables()`</mark>

### Exports

* GetSharedFunctions()
* GetSharedVariables()
* GetHealthBuffer()
* SetDamageEnabled(damageEnabled)
* ShowPlayerMenu(player)
* ClosePlayerMenu(fromNui)
* GetRemainingUnconsciousSeconds()
* SetRemainingUnconsciousSecondsFunction

### Events

* visn\_are:resetHealthBuffer

## Server

To access functions use the following export: <mark style="color:yellow;">`exports["visn_are"]:GetSharedFunctions()`</mark>

To access fields use the following export: <mark style="color:yellow;">`exports["visn_are"]:GetSharedVariables()`</mark>

### Exports

### Events

## Functions & Tables

Inside your <mark style="color:yellow;">`documentation`</mark>-folder should be a <mark style="color:yellow;">`index.html`</mark> open it up.

Otherwise it is uploaded here: <https://veryinsanee.github.io/visn_are_docs/>


# Plugin Support

This script supports user-made plugins.

## How to create a custom plugin

### Basic Preparation

1. Open the root folder of <mark style="color:yellow;">`visn_are`</mark>, there should be a <mark style="color:yellow;">`plugins`</mark> folder, open it.
2. Download the [sample plugin](https://github.com/veryinsanee/visn_are_sample_plugin) from our github page.
3. Drag and drop the folder inside the plugins folder.
4. Now rename the folder to your custom name.
5. Open the <mark style="color:yellow;">`plugin_test_client.lua`</mark> and edit the <mark style="color:yellow;">`pluginData`</mark>.
6. Do the same for <mark style="color:yellow;">`plugin_test_server.lua`</mark>.
7. Now rename the two files to your custom name, but this format is important:
   1. <mark style="color:yellow;">`plugin_NAME_TYPE.lua`</mark>
   2. Type can be: 'server' or 'client' -> It will decide if it will execute on client or server.

### Let's create our own content!

Let's create a plugin that prints a message when our heart rate is below 80.

Since this will be a client-side-plugin, we will open our client-side plugin file. (In this case <mark style="color:yellow;">`plugin_test_client.lua`</mark>)

Inside of the <mark style="color:yellow;">`RegisterClientPlugin`</mark> function we will put our logic.

To permanently print a message when our heart rate is below 80, we need a <mark style="color:yellow;">`thread`</mark> and a <mark style="color:yellow;">`while-loop`</mark>.

![](https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2Fdh6W0D4Qz3od1hrh0At9%2Fdddb3339b6d25d962236e3da344315e9.png?alt=media\&token=064d71eb-d4ac-468d-af3c-77aee5c922a0)

After we implemented it, we will access the [client health buffer](/advanced-roleplay-environment/api-reference#client) and do a check if the heart rate is below 80.

![](https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FOYYp8y1IdDjhlqZmdcbt%2F6dce65845a3f1d1e5729ae40c5ea7068.png?alt=media\&token=0c681219-48d8-4c9a-b37a-971ac88b3423)

Since everything in the if-statement will only trigger when the heart rate is below 80 we will just print <mark style="color:yellow;">`"Low on health!"`</mark> inside the statement.

The basic logic is done, but we need to prevent a client-crash so let's implement a <mark style="color:yellow;">`Citizen.Wait`</mark>-call inside the <mark style="color:yellow;">`while-loop`</mark>.

![](https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FNHEkhUzMxBhdp63ImIiT%2F7f26696d0edd3068ca9babcf92bffeba.png?alt=media\&token=5ed53e0f-e5c1-4bb3-87cb-35378bad337c)

### **We are done!**&#x20;

After the resource has been started (or restarted) the plugin will load.

Now when are ingame and the heart rate is below 80, the console is getting spammed with <mark style="color:yellow;">`"Low on health!"`</mark>.

![](https://3719360761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fck7Fdkl3tw9GlGnkwHuu%2Fuploads%2FUi24f7rWC4AxRDZwyBpx%2F4e6a417f0aea925a25947db456f659de.png?alt=media\&token=fac9f4e3-7880-46eb-bb0f-8f7f902a230d)

## Questions

<details>

<summary>Which functions can I use?</summary>

Take a look at the [API Reference](/advanced-roleplay-environment/api-reference).

</details>


# Installation

{% hint style="warning" %}
**Note:** This script can only be used with ESX.
{% endhint %}

### Basic Installation

1. Download the script from the [FiveM Asset Manager](https://keymaster.fivem.net/asset-grants).
2. Move the folder <mark style="color:yellow;">`visn_whitelist`</mark> from the downloaded <mark style="color:yellow;">`visn_whitelist.pack.zip`</mark>-archive into your <mark style="color:yellow;">`resources`</mark> folder.
3. Customize the <mark style="color:yellow;">`config.lua`</mark> and <mark style="color:yellow;">`server_config.lua`</mark> to your needs.
4. Change the questions in <mark style="color:yellow;">`/shared/nui/questions.json`</mark><mark style="color:purple;">.</mark>
5. Start the script.

{% tabs %}
{% tab title="ESX 1.0/1.1" %}
Rename the file <mark style="color:yellow;">`whitelist_server_old_esx.lua`</mark> to <mark style="color:yellow;">`whitelist_server.lua`</mark>.
{% endtab %}

{% tab title="ESX Legacy" %}
Rename the file <mark style="color:yellow;">`whitelist_server_new_esx.lua`</mark> to <mark style="color:yellow;">`whitelist_server.lua`</mark>.
{% endtab %}
{% endtabs %}

&#x20;


