# Config

{% hint style="info" %}
You can enter the values ​​listed below in your config at AggroLevel to determine how a Ped group should behave.
{% endhint %}

<details>

<summary>Agression Levels / Ped behavior</summary>

```lua
0 = Companion
1 = Respect
2 = Like
3 = Neutral
4 = Dislike
5 = Hate
```

</details>

{% hint style="info" %}
You can make adjustments for your framework in the ESX Config. This means, for example, events for awarding items or weapons, or an animation for picking up items. Normally there is no need to change anything there if you use ESX.
{% endhint %}

<details>

<summary>ESX Config</summary>

```lua
Config.ItemDropCallback = function(source, type, item, count)
    local ESX = exports['es_extended']:getSharedObject()
    local xPlayer = ESX.GetPlayerFromId(source)

    if type == "item" then
        xPlayer.addInventoryItem(item, count)
    elseif type == "weapon" then
        xPlayer.addWeapon(item, count)
    end
end

Config.PickupAnim = {
    Animation = "pickup_low",
    Lib = "random@domestic"
}
```

</details>

{% hint style="info" %}
The Active Peds Config is there to set and configure your Ped groups. There you can, for example, create groups with peds that work together, customize their protective vests, the weapons they use, the aggro level and much more. You can create unlimited different groups of Peds.
{% endhint %}

<details>

<summary>Active Peds Config</summary>

{% code fullWidth="true" %}

```lua
Config.Groups = 
{
    ["Grove"] = {
        Defaults = { 
            Weapon = "WEAPON_MICROSMG", 
            AggroLevel = 4, 
            Accuracy = 15, 
            Armour = 0, 
            RespawnSeconds = -1,  
            GroupCenterCoords = vector3(103.3628, -1939.7953, 20.8037), 
            ItemDrops = {
                {type = "item", name = "case", amount = 1, chance = 5},
                {type = "item", name = "casekey", amount = 1, chance = 5},
                {type = "item", name = "weaclip", amount = 1, chance = 5},
            }
        },
        Peds = {
            { coords = vector3(116.9127, -1927.4237, 20.7443), heading = 133.513, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG", Armour = 100},
            { coords = vector3(111.0326, -1921.4326, 20.8709), heading = 151.780, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG", AggroLevel = 5},
            { coords = vector3(79.1506, -1947.3203, 21.1741), heading = 310.0021, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG", Accuracy = 90},
            { coords = vector3(90.4941, -1955.1763, 20.8671), heading = 0.561200, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG", 
            { coords = vector3(86.8706, -1948.5342, 20.7981), heading = 338.9240, model = 'csb_ramp_gang', Weapon ="WEAPON_MICROSMG"},
            { coords = vector3(101.4297, -1957.6694, 20.7428), heading = 24.2025, model = 'csb_ramp_gang', Weapon ="WEAPON_MICROSMG"},
            { coords = vector3(111.6559, -1958.4443, 20.8265), heading = 29.4064, model = 'csb_ramp_gang', Weapon ="WEAPON_MICROSMG"},
            { coords = vector3(117.7004, -1951.0455, 20.7459), heading = 24.7913, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG"},

        }
    },
```

{% endcode %}

</details>

{% hint style="info" %}
In the code example from our config below you can see how you can assign overriding variables to individual peds. This means that you can not only set all values ​​for a group, but also for all Peds individually if desired.
{% endhint %}

<details>

<summary>Custom Peds Config</summary>

```lua
 Peds = {
            { coords = vector3(116.9127, -1927.4237, 20.7443), heading = 133.513, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG", Armour = 100},
            { coords = vector3(111.0326, -1921.4326, 20.8709), heading = 151.780, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG", AggroLevel = 5},
            { coords = vector3(79.1506, -1947.3203, 21.1741), heading = 310.0021, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG", Accuracy = 90},
            { coords = vector3(90.4941, -1955.1763, 20.8671), heading = 0.561200, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG", 
            { coords = vector3(86.8706, -1948.5342, 20.7981), heading = 338.9240, model = 'csb_ramp_gang', Weapon ="WEAPON_MICROSMG"},
            { coords = vector3(101.4297, -1957.6694, 20.7428), heading = 24.2025, model = 'csb_ramp_gang', Weapon ="WEAPON_MICROSMG"},
            { coords = vector3(111.6559, -1958.4443, 20.8265), heading = 29.4064, model = 'csb_ramp_gang', Weapon ="WEAPON_MICROSMG"},
            { coords = vector3(117.7004, -1951.0455, 20.7459), heading = 24.7913, model = 'csb_ramp_gang', Weapon ="WEAPON_SMG"},

        }
    },
```

</details>

{% hint style="info" %}
In the Static Ped Config you can create your static Peds. You have the option to set the coordinates, the ped model and the animation if you want one. You can create unlimited static peds.
{% endhint %}

<details>

<summary>Static Peds Config</summary>

```lua
Config.StaticPeds = {
    { 
        coords = vector3(222.8386, 205.9472, 104.5159), 
        heading = 167.9034, 
        model = 'csb_prolsec',
        animLib = "mp_player_inteat@burger",
        anim = "mp_player_int_eat_burger_fp"
    }
}
```

</details>

### Exports

Use this export to respawn peds of a certain group

```lua
respawnGroup("groupName")
```


---

# 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://docs.hyper-code.eu/documentation/all-in-one-peds/config.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.
