# Installation

## Step1: Adding the resource to your server

* Drag and drop the cr-effects folder to your resource folder.
* Make sure you install the dependancies: [qb-core](https://github.com/qbcore-framework/qb-core), [progressbar](https://github.com/qbcore-framework/progressbar).
* Make sure you have the below start order in your server.cfg.

<pre class="language-lua"><code class="lang-lua">ensure qb-core
<strong>ensure progressbar
</strong>ensure cr-effects
</code></pre>

## Step 2: Editing the config

Below is an example of an item with effects.

```lua
Config.Items = {
    ["example"] = {
        name = "phone", -- The name of the useable item
        useItemText = "Smoke weed", -- What to notify when you use the item
        effect = {
            speed = { -- Run faster
                enabled = false,
                time = 30,
            },
            drunk = { -- Get a Drunk effect
                enabled = false,
                time = 30,
            },
            alienEffect = {
                enabled = false,
                time = 30,
            },
            relieveStress = { -- Reduce stress
                enabled = false,
                amount = 100
            },
            healthRegen = { -- Gain health regeneration
                enabled = false,
                time = 30,
                rate = 1.8
            },
            ragDoll = { -- Sets the player to ragdoll 
                enabled = false,
                time = 30
            },
            stumble = { -- Stumble while running
                enabled = false,
                time = 30
            },
            reliveThirst = {
                enabled = false,
                amount = 10
            },
            reliveHunger = {
                enabled = false,
                amount = 10
            },
            stamina = { -- Get more stamina so you can run longer
                enabled = false,
                time = 30
            },
            CameraShake = {
                enabled = false,
                time = 30, -- for how long
                CameraShakeType = "SMALL_EXPLOSION_SHAKE", -- What type of shake (DEATH_FAIL_IN_EFFECT_SHAKE, DRUNK_SHAKE, FAMILY5_DRUG_TRIP_SHAKE, HAND_SHAKE, JOLT_SHAKE, LARGE_EXPLOSION_SHAKE, MEDIUM_EXPLOSION_SHAKE, SMALL_EXPLOSION_SHAKE, ROAD_VIBRATION_SHAKE, SKY_DIVING_SHAKE, VIBRATE_SHAKE)
                intensity = 0.8 -- how intense the shake should be
            },
            ScreenFLash = { -- Adds a Screen flashing effect
                enabled = false,
                time = 30
            },
            Custom = {
                enabled = false,
                effectName = "test_effect",
                transition = 100,
                time = 3000
            },
            Status = {
                enabled = true,
                statusName = "weedsmell", -- See the docs (https://creative-development.gitbook.io/cr-effects/fundamentals/installation#what-all-the-different-things-mean-and-what-they-do)
                time = 200 -- how long in seconds
            }
        },
        progressBar = {
            enabled = true, -- If you want to enable the progressbar or not
            progressBarLength = 10000, -- How long the progressbar should be
            progressBarText = "Smoking weed", -- What the progressbar should display
            animDict = "amb@world_human_drinking@coffee@male@idle_a", -- The animation dictionary
            anim = "idle_c", -- The animation in the animation dictionary
            notifyProgressbarDone = "You smoked weed", -- What to notify then you progressbar is done
            notifyProgressbarFail = "You droped the joint!", -- What to notify then the progressbar fails
            disableMovement = false, -- If you want to be able to move (walk)
            disableCarMovement = false, -- If you want to be able to control the car
            disableMouse = false, -- If you want to be able to move the mouse (look around)
            disableCombat = false,                             -- If you want to be able to fight (punch and stuff)
            propSettings = {
                enabled = true,
                prop = "v_ret_fh_bscup",
                boneId = 28422
            }
        },
    },
    -- Copy above example and add your next one under here
}
```

### What all the different things mean and what they do

<table data-full-width="false"><thead><tr><th>Name</th><th>information</th><th>variables</th></tr></thead><tbody><tr><td><pre><code>["example"]
</code></pre></td><td>This need to be a unique name</td><td></td></tr><tr><td><pre><code>name 
</code></pre></td><td>This is the name of the item you want to make usable and add the effects to</td><td></td></tr><tr><td><pre><code>useItemText 
</code></pre></td><td><p>This is what you want to be </p><p>notified when you use the item</p></td><td></td></tr><tr><td><pre><code>speed
</code></pre></td><td>This is the effect of running faster</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>time</strong>: This is for how long the effect should last in seconds.</td></tr><tr><td><pre><code>drunk 
</code></pre></td><td>Gain a drunk effect</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>time</strong>: This is for how long the effect should last in seconds.</td></tr><tr><td><pre><code>alienEffect 
</code></pre></td><td>Gain an alien like visual effect</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>time</strong>: This is for how long the effect should last in seconds.</td></tr><tr><td><pre><code>relieveStress 
</code></pre></td><td>Relieve some stress</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>amount</strong>: how much stress to remove</td></tr><tr><td><pre><code>healthRegen 
</code></pre></td><td>Gain some health regen</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>time</strong>: This is for how long the effect should last in seconds.<br><br>rate: How fast to regen health</td></tr><tr><td><pre><code>ragDoll 
</code></pre></td><td>Sets the player to ragdoll</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>time</strong>: This is for how long the effect should last in seconds.</td></tr><tr><td><pre><code>stumble 
</code></pre></td><td>Makes the player stumble when running</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>time</strong>: This is for how long the effect should last in seconds.</td></tr><tr><td><pre><code>reliveThirst 
</code></pre></td><td>Relieve some thirst</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>amount</strong>: how much thirst to relieve</td></tr><tr><td><pre><code>reliveHunger 
</code></pre></td><td>Relieve some hunger</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>amount</strong>: how much hunger to relieve</td></tr><tr><td><pre><code>stamina 
</code></pre></td><td>Gain more stamina so you can run longer</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>time</strong>: This is for how long the effect should last in seconds.</td></tr><tr><td><pre><code>CameraShake 
</code></pre></td><td>Makes the players screen shake</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>time</strong>: This is for how long the effect should last in seconds.<br><br><strong>CameraShakeType</strong>: what the type of camerashake you want, can be: <code>DEATH_FAIL_IN_EFFECT_SHAKE, DRUNK_SHAKE, FAMILY5_DRUG_TRIP_SHAKE, HAND_SHAKE, JOLT_SHAKE, LARGE_EXPLOSION_SHAKE, MEDIUM_EXPLOSION_SHAKE, SMALL_EXPLOSION_SHAKE, ROAD_VIBRATION_SHAKE, SKY_DIVING_SHAKE, VIBRATE_SHAKE</code><br><br><strong>intensity</strong>: How intense the shake should be.</td></tr><tr><td><pre><code>ScreenFLash 
</code></pre></td><td>Adds a screen flashing effect to the players screen</td><td><strong>enabled</strong>: if the effect is enabled for the item or not.<br><br><strong>time</strong>: This is for how long the effect should last in seconds.</td></tr><tr><td><pre><code>Custom 
</code></pre></td><td>Adds a custom visiual effect</td><td><p><strong>enabled</strong>: if the effect is enabled for the item or not.</p><p></p><p><strong>effectName</strong>: The name of the custom effect (see more in <a data-mention href="/pages/9VzzmaGaxDGwKxPCxrZL">/pages/9VzzmaGaxDGwKxPCxrZL</a>).</p><p></p><p><strong>transition</strong>: How long the transition is for the effect to be at full strength in MS.</p><p></p><p><strong>strength</strong>: How strong the effect should be.<br><br><strong>time</strong>: This is for how long the effect should last in MS.</p></td></tr><tr><td><pre><code>Status
</code></pre></td><td>Adds a status "effect" that police can inspect.</td><td><strong>statusName</strong>: See <a data-mention href="#the-different-status-names">#the-different-status-names</a><br><br><strong>time</strong>: This is for how long the effect should last in Seconds.</td></tr></tbody></table>

### The progressbar settings for each item

<table><thead><tr><th>name</th><th>information</th></tr></thead><tbody><tr><td><pre><code>enabled 
</code></pre></td><td>If the progressbar is enabled or not. if false then you can ignore the below settings</td></tr><tr><td><pre><code>progressBarLength 
</code></pre></td><td>How long the progressbar should be</td></tr><tr><td><pre><code>progressBarText 
</code></pre></td><td>What to display in the progressbar text</td></tr><tr><td><pre><code>animDict 
</code></pre></td><td>This is the dictionary your animation is in</td></tr><tr><td><pre><code>anim 
</code></pre></td><td>This is the animation</td></tr><tr><td><pre><code>notifyProgressbarDone 
</code></pre></td><td>This is what is getting notified when the progressbar is done</td></tr><tr><td><pre><code>notifyProgressbarFail 
</code></pre></td><td>This is what is getting notified when the progressbar fails</td></tr><tr><td><pre><code>disableMovement 
</code></pre></td><td>This disables the players movement (walking) while in the progressbar</td></tr><tr><td><pre><code>disableCarMovement 
</code></pre></td><td>This disables the ability to control the car</td></tr><tr><td><pre><code>disableMouse 
</code></pre></td><td>This disables the mouse movement (looking around)</td></tr><tr><td><pre><code>disableCombat 
</code></pre></td><td>This disables the the ability to be in combat (punch players etc)</td></tr></tbody></table>

### Propsettings

<table><thead><tr><th>Name</th><th>Information</th></tr></thead><tbody><tr><td><pre><code>enabled
</code></pre></td><td>If you want a prop or not</td></tr><tr><td><pre><code>prop
</code></pre></td><td>This is the name of the prop</td></tr><tr><td><pre><code>boneId
</code></pre></td><td>This is the id of the "bone" See this list of bones: <a href="https://wiki.rage.mp/index.php?title=Bones">https://wiki.rage.mp/index.php?title=Bones</a></td></tr></tbody></table>

### The different status names

```lua
'fight'
'widepupils'
'redeyes'
'weedsmell'
'gunpowder'
'chemicals'
'heavybreath'
'sweat'
'handbleed'
'confused'
'alcohol'
"heavyalcohol"
"agitated"
```

### Creating new items

* Copy the above example and paste it underneath.
* Edit all the variables to match for your item.
* that's it.


---

# 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://creative-development.gitbook.io/cr-effects/fundamentals/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.
