# Installation

{% hint style="warning" %}
Ich empfehle zur Installation von Scripts **WinSCP**\
\
**FileZilla** überträgt in den meisten Fällen einige verschlüsselte Dateien nicht. Dadurch kann es passieren, dass die Scripts nicht funktionieren!
{% endhint %}

{% hint style="info" %}
Um Medical Equipment vollständig nutzen zu können, ist das Script "visn\_are" notwendig.\
<https://store.veryinsanee.space/package/5215195>
{% endhint %}

## 1. Medical Equipment herunterladen und installieren

Nach dem Kauf von Medical Equipment über den Tebex Store kannst du es unter folgendem Link herunterladen und über ein FTP Programm auf deinem Server hinzufügen:

{% embed url="<https://portal.cfx.re>" %}

Füge Medical Equipment anschließend **am Ende** der Start Config (beispielsweise über txAdmin) hinzu.

```lua
start [MEDIC_EQUIP]
```

## 2. Items

Mit Medical Equipment werden neue Funktionen in visn\_are hinzugefügt. Dafür sind neue Items notwendig.

### 2.1. ESX Limit

```sql
INSERT INTO `items` (`name`, `label`, `limit`, `rare`, `can_remove`) VALUES ('cpr_machine', 'LUCAS 3', 10, 0, 1);
INSERT INTO `items` (`name`, `label`, `limit`, `rare`, `can_remove`) VALUES ('iv_zugang', 'i.v. Zugang', 10, 0, 1);
INSERT INTO `items` (`name`, `label`, `limit`, `rare`, `can_remove`) VALUES ('io_zugang', 'i.o. Zugang', 10, 0, 1);
INSERT INTO `items` (`name`, `label`, `limit`, `rare`, `can_remove`) VALUES ('ampullarium', 'Ampullarium', 10, 0, 1);
INSERT INTO `items` (`name`, `label`, `limit`, `rare`, `can_remove`) VALUES ('stifneck', 'Stifneck', 10, 0, 1);
```

### 2.2. ESX Weight

```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('cpr_machine', 'LUCAS 3', 1, 0, 1);
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('iv_zugang', 'i.v. Zugang', 1, 0, 1);
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('io_zugang', 'i.o. Zugang', 1, 0, 1);
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('ampullarium', 'Ampullarium', 1, 0, 1);
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('stifneck', 'Stifneck', 1, 0, 1);
```

### 2.3. QBCore

Script: qb-core\
Dateiname: shared/items.lua

```lua
['cpr_machine'] 			 	 = {['name'] = 'cpr_machine', 			  			['label'] = 'LUCAS 3', 				['weight'] = 100, 	    ['type'] = 'item', 		['image'] = 'cpr_machine.png', 				['unique'] = false, 	['useable'] = true, 	['shouldClose'] = true,    ['combinable'] = nil,   ['description'] = 'LUCAS 3 Thoraxkompressionssystem'},
['iv_zugang'] 			 	 = {['name'] = 'iv_zugang', 			  		['label'] = 'i.v. Zugang', 			['weight'] = 100, 	    ['type'] = 'item', 		['image'] = 'iv_zugang.png', 			['unique'] = false, 	['useable'] = true, 	['shouldClose'] = true,    ['combinable'] = nil,   ['description'] = 'intravenöser Zugang'},
['io_zugang'] 			 	 = {['name'] = 'io_zugang', 			  			['label'] = 'i.o. Zugang', 			['weight'] = 100, 	    ['type'] = 'item', 		['image'] = 'io_zugang.png', 			['unique'] = false, 	['useable'] = true, 	['shouldClose'] = true,    ['combinable'] = nil,   ['description'] = 'intraosärer Zugang'},
['ampullarium'] 			 	 = {['name'] = 'ampullarium', 			  			['label'] = 'Ampullarium', 			['weight'] = 100, 	    ['type'] = 'item', 		['image'] = 'ampullarium.png', 			['unique'] = false, 	['useable'] = true, 	['shouldClose'] = true,    ['combinable'] = nil,   ['description'] = 'Notarzt Ampullarium'},
['stifneck'] 			 	 = {['name'] = 'stifneck', 			  			['label'] = 'Stifneck', 			['weight'] = 100, 	    ['type'] = 'item', 		['image'] = 'stifneck.png', 			['unique'] = false, 	['useable'] = true, 	['shouldClose'] = true,    ['combinable'] = nil,   ['description'] = 'Stifneck zur Immobilisation der HWS'},
```

## 3. Funktionen in visn\_are einfügen

### 3.1. neue Aktionspunkte im Gesundheitsmenü

Im Download ist ein Ordner mit dem Namen "visn\_are" enthalten. Der dort enthaltene Ordner "plugins" ist in das "visn\_are" Script einzufügen.\
\
Die Aktionen in der Datei "insert\_into\_actions.lua" sind in folgende Datei hinzuzufügen:\
\&#xNAN;*visn\_are/script/entities/actions.lua*\
Füge den Abschnitt \["diagnoses"] ans Ende der entsprechenden Aktionsliste hinzu.

<figure><img src="https://553956293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZuxSxAs2P8ars8V4u8ry%2Fuploads%2FF9ODylk3jPJ0pz6bwp81%2Fdiagnoses.PNG?alt=media&#x26;token=acc2342e-9c95-4b1f-ad2c-bc35a6eabdd5" alt=""><figcaption></figcaption></figure>

Füge den Abschnitt \["cpr"] ans Ende der entsprechenden Aktionsliste hinzu.

<figure><img src="https://553956293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZuxSxAs2P8ars8V4u8ry%2Fuploads%2FK4KDbjHm512DpSfnbUIG%2Fcpr.PNG?alt=media&#x26;token=b498db10-34aa-4883-8885-9d25e5e4df3c" alt=""><figcaption></figcaption></figure>

### 3.2. Zugang als Voraussetzung für Medikamente und Infusionen

Damit für Medikamente und Infusionen der i.v./i.o. Zugang Voraussetzung ist, ist folgende Änderung notwendig.\
\
Suche in der Datei "actions.lua" nach "for \_, volume in pairs(v.availableVolumes) do"\
\
Ändere hier folgenden Abschnitt "condition":

```lua
condition = function(healthBuffer, bodyPart) return healthBuffer.bodyParts[bodyPart].zugang == true and not healthBuffer.bodybag end,
```

<figure><img src="https://553956293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZuxSxAs2P8ars8V4u8ry%2Fuploads%2F1MHXJYqjBlWQQePhVFNP%2Finfusion.PNG?alt=media&#x26;token=291ae236-b3e9-4487-ba59-7ac5a0ca7578" alt=""><figcaption></figcaption></figure>

Suche jetzt nach "for k, v in PairsByKeys(MEDICATIONS) do"\
\
Ändere hier folgenden Abschnitt "condition":

```lua
condition = function(healthBuffer, bodyPart) return healthBuffer.bodyParts[bodyPart].zugang == true and not healthBuffer.bodybag end,
```

<figure><img src="https://553956293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZuxSxAs2P8ars8V4u8ry%2Fuploads%2F7q8JQhRTNYsqKLJ0Kt8c%2Fmedis.PNG?alt=media&#x26;token=898d6998-fffd-40c3-9467-5435880acd82" alt=""><figcaption></figcaption></figure>

### 3.3. Übersetzungen einfügen

Datei: visn\_are/script/languages/de.json\
\
Füge hier die Zeilen aus der Datei "insert\_into\_de.json" am Ende ein:

<figure><img src="https://553956293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZuxSxAs2P8ars8V4u8ry%2Fuploads%2F4FRRaRB5lpwTWwJSK73c%2Flanguage.PNG?alt=media&#x26;token=23401c0d-acc9-49ef-b010-9d4719282479" alt=""><figcaption></figcaption></figure>

### 3.4. actions.lua und de.json als Komplett Version

Anbei sind auch die beiden Dateien als modifizierte Version verfügbar.\
\
Stand: Update vom 25.05.2024\
\
actions.lua: *visn\_are/script/entities*\
de.json: *visn\_are/script/languages*

{% file src="<https://553956293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZuxSxAs2P8ars8V4u8ry%2Fuploads%2FKI1DaxXVxeJxeMYAjUHv%2Factions.lua?alt=media&token=e324f372-46e1-4ae1-a96e-8491facd7c35>" %}

{% file src="<https://553956293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZuxSxAs2P8ars8V4u8ry%2Fuploads%2FG714nipEL2xhXheiIFwV%2Fde.json?alt=media&token=1b84d0e0-6565-45be-b9bf-b6f014739116>" %}

## 4. Notfallrucksack in YourEquipment

Es ist möglich, den Rucksack mit YourEquipment in das Geräte Menü einzubinden.\
\
Öffne hierzu die Administration von YourEquipment und klicke auf "Custom Geräte" -> "neu"\
\
Gib als Name beispielsweise "Notfallrucksack" an und wähle das Bild aus.\
Auf der rechten Seite ist "Trigger Client Event" auszuwählen und folgendes Event einzutragen.\
`medic_equipment:bag`

<figure><img src="https://553956293-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZuxSxAs2P8ars8V4u8ry%2Fuploads%2Fw4pVq4iCu9Fgc4pj5a1E%2F20251204163915_1.jpg?alt=media&#x26;token=d6ba630c-3369-4637-9b23-172c2127c244" alt=""><figcaption></figcaption></figure>

Im Feld "Argument" ist der Name des Rucksackes, wie er in der Config.RescueBag festgelegt wurde, einzutragen. Hier als Beispiel "bag1".

{% hint style="warning" %}
Es können mehrere Rucksäcke auf ein Fahrzeug verlastet werden. Diese sollten aber einen unterschiedlichen Namen haben, um Fehler in der Synchronisation zu vermeiden. Als mehrfach den gleichen Rucksack-Typ (bag1 beispielsweise) auf ein Fahrzeug zu verlasten sollte vermieden werden.
{% endhint %}
