# Installation

## Important Steps to Follow

{% hint style="success" %}
The most important part of this installation is to edit the required resource that enables it to run on your server without any issues
{% endhint %}

{% hint style="danger" %}
Ensure that you complete the following task before testing the resource
{% endhint %}

> * ### [#required-resource-adjustments](#required-resource-adjustments "mention")

***

## Download Resource

{% hint style="success" %}
Purchase the script from our [HighQez Store](https://highqez.tebex.io/). After the purchase, the resource will be available in your [Keymaster Account](https://keymaster.fivem.net/asset-grants)
{% endhint %}

Make sure you purchase the script using the same [Keymaster Account](https://keymaster.fivem.net/) that is linked to your server. If not you will receive a warning "**You lack the required entitlement".**

If you receive the error mentioned above, you may have to transfer the resource from the current Keymaster account to the server's Keymaster account using the transfer feature in Keymaster.

***

## Transfer Resource

{% hint style="success" %}
Unzip the downloaded file and transfer it to your server's resource folder
{% endhint %}

If you are using **FTP**, please ensure you use [**WinSCP** ](https://winscp.net/eng/download.php)to transfer the resource to the server. If you use FileZilla, you may encounter the error "**Failed to verify protected resource**"

***

## Start Resource

{% hint style="success" %}
Ensure the resource in server.cfg of your server
{% endhint %}

Make sure to start the resource only after all essential server resources have been started. Follow the example below to **ensure highqez\_crawldead**

```
ensure es_extended/qb-core #Don't start above this
ensure qb-target/ox-target/qtarget #Don't start above this

#Start the HighQez resource here

ensure highqez_crawldead

#Start the rest of your resources
```

***

## Resource Database

{% hint style="success" %}
Proceed the required SQL queue to your server database
{% endhint %}

Insert the SQL query from the attached file to use the resource, depending on your framework. See below for framework-specific SQL queries

<details>

<summary>SQL query for ESX</summary>

```sql
ALTER TABLE `users`
	ADD `is_crawl` TINYINT(1) NULL DEFAULT '0'
;
```

</details>

***

## Resource Items

{% hint style="success" %}
Transfer the item's images from the INSTALL folder of the resource to your server's inventory
{% endhint %}

{% hint style="info" %}
Ensure to add all required **items** to your server
{% endhint %}

<details>

<summary>ESX INVENTORY</summary>

```sql
INSERT INTO `items` (name, label, weight) VALUES
	('highdosepill','High Dose Pill', 1)
;
```

</details>

<details>

<summary>OX INVENTORY</summary>

```lua
['highdosepill'] = {
    label = 'High Dose Pill',
    weight = 1,
    stack = false,
    close = true,
},
```

</details>

<details>

<summary>OLD QBCore</summary>

```lua
["highdosepill"] = {
    ["name"] = "highdosepill", 							
    ["label"] = "High Dose Pill",                     
    ["weight"] = 100,      
    ["type"] = "item",      
    ["image"] = "highdosepill.png",                 
    ["unique"] = false,     
    ["useable"] = true,     
    ["shouldClose"] = true,    
    ["combinable"] = nil,   
    ["description"] = "The pill that can make you high"
},
```

</details>

<details>

<summary>NEW QBCore</summary>

```lua
highdosepill = { 
    name = 'highdosepill', 
    label = 'High Dose Pill', 
    weight = 100, 
    type = 'item', 
    image = 'highdosepill.png', 
    unique = false, 
    useable = true, 
    shouldClose = true, 
    combinable = nil, 
    description = 'The pill that can make you high' 
},
```

</details>

***

## Configure Resource

{% hint style="success" %}
Customize the script to suit the specific requirements of your server
{% endhint %}

Open-source files are available for editing the framework function. The main configuration of the resource is provided below.

<details>

<summary>Config File</summary>

```lua
Config = {}

-- Add any keys if you want the injured player to use while crawling
Config.EnabledKeys = {  --https://docs.fivem.net/docs/game-references/controls/
    0, --v
    1, --cam
    2, --cam
    47, -- G
    245, --T 
    38, --E
}

Config.CrawlTimer = 100 -- (In Seconds) Player will be dead after the timer

Config.SelfReviveCommand = 'selfrevive' -- Custom command for self revive

Config.ReviveItem = 'highdosepill' -- Use false if you wanna disable this

Config.EveryoneCanReviveOthers = true -- Anyone can revive the nearby player using the item

Config.CombatLoggingCrawl = true -- Player will be crawl if they exit while crawling

Config.CombatLoggingDead = true -- Player will be dead if they exit when he is dead(TURN ON COMBAT LOG IN YOUR AMBULANCE SCRIPT TOO)

Config.FinishEmotes = true -- true/false Finishing animation effect

Config.ScreenEffect = 'ChopVision' -- Use false to disable it or add 'ChopVision' effect name

Config.Target = 'ox_target' -- 'ox_target' or 'qtarget'

-- Config below if Config.FinishEmotes = true
Config.Emotes = {
    ['Punch'] = {
        ["killer"] = {  -- The killer animation side
            "melee@unarmed@streamed_variations",
            "plyr_takedown_rear_lefthook",
            "Punch",
            "victim"
        },
        ["victim"] = {  -- The victim/injured player animation side
            "melee@unarmed@streamed_variations",
            "victim_takedown_front_cross_r",
            "Punched",
            "killer"
        },
        item = nil  -- Required item to perform the finish move, nill or 'item_name'
    },
    ['Slap'] = {
        ["killer"] = {
            "melee@unarmed@streamed_variations",
            "plyr_takedown_front_slap",
            "Slap",
            "victim",
            AnimationOptions = {
                EmoteDuration = 2000,
            }
        },
        ["victim"] = {
            "melee@unarmed@streamed_variations",
            "victim_takedown_front_slap",
            "Slapped",
            "killer"
        },
        item = nil
    },
    ['Knife'] = {
        ["killer"] = {
            "melee@knife@streamed_variations",
            "plyr_knife_front_takedown_variation_a",
            "Knife",
            "victim",
            AnimationOptions = {
                EmoteDuration = 2000,
            }
        },
        ["victim"] = {
            "melee@knife@streamed_variations",
            "victim_knife_front_takedown_variation_a",
            "Knifed",
            "killer"
        },
        item = 'WEAPON_KNIFE'
    },
    ['SMG'] = {
        ["killer"] = {
            "combat@fire_variations@gang@smg",
            "var_a",
            "Shot",
            "victim",
            AnimationOptions = {
                EmoteDuration = 2000,
            }
        },
        ["victim"] = {
            "melee@pistol@streamed_core",
            "victim_front_takedown_kill",
            "Shoted",
            "killer"
        },
        item = 'WEAPON_SMG'
    },

}
```

</details>

***

## Required Resource Adjustments&#x20;

{% hint style="success" %}
Server resources need to be modified for the proper execution of this script. Follow the instructions below to ensure the script runs smoothly
{% endhint %}

{% hint style="info" %}
Refer to the following tab, which is relevant to your current ambulance job script
{% endhint %}

<details>

<summary>ESX AMBULANCE JOB</summary>

* Ensure to make edits to both **esx\_extended** and **esx\_ambulancejob**
  * **es\_extended**: [*View Edited File* *(GitHub)*](https://github.com/highqez0/es_extended_CRAWLDEAD/commit/343453dac490114658aae6a640d83858f33b8372)
  * **esx\_ambulancejob**: [*View Edited File* *(GitHub)*](https://github.com/highqez0/esx_ambulancejob_CRAWLDEAD/commit/5e0c8a640813db3b94781c4cdb0cdcb468e21c83)

</details>

<details>

<summary>QB AMBULANCE JOB</summary>

* Ensure to make edits to **qb-ambulancejob**
  * **qb-ambulancejob**: [*View Edited File (GitHub)*](https://github.com/highqez0/qb-ambulancejob-HIGHQEZ_CRAWLDEAD/commit/c276ff4094c91b605e219b05262ebb2bee9acb5e)

</details>

<details>

<summary>ARS AMBULANCE JOB</summary>

* Ensure to make edits to **ars\_ambulancejob**
  * **ars\_ambulancejob**: [*View Edited File (GitHub)*](https://github.com/highqez0/ars_ambulancejob_CRAWLDEAD/commit/4a502c1149a2a8261601e526fe8db6b61e2a5691)

</details>

<details>

<summary>WASABI AMBULANCE</summary>

* Ensure to make edits to **wasabi\_ambulance**
  * **wasabi\_ambulance/game/client/client.lua**: [*View Edited File (Diff)*](https://www.diffchecker.com/lSDFCp1v/)

**Remember this important information**\
\&#xNAN;*Use the website to compare old and new edited files. Scroll down and review the Green or Red column to understand the code additions and removals in the current file*

</details>

***

## Resource API

{% hint style="info" %}
Check out the API page to access all APIs for this resource, which can be very useful for **developers**
{% endhint %}

{% content-ref url="/pages/1yMqXp7Ii99pbQOWouRl" %}
[API](/docs/resources/crawl-dead/api.md)
{% endcontent-ref %}

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://highqez.gitbook.io/docs/resources/crawl-dead/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
