> For the complete documentation index, see [llms.txt](https://lumanstudio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lumanstudio.gitbook.io/docs/redm-scripts/dragon-rider/config-and-permissions.md).

# Config and Permissions

## Basic configuration

```lua
Config.CommandName = 'luman-dragon' -- Command name
Config.CommandAdminOnly = true -- Admin only
```

## Permissions

By default command for dragon spawn is available only to main administrators. To allow other players use the command you can add access for them via `server.cfg`:

```
# example #1
add_ace group.dragon-access command.luman-dragon allow
add_principal identifier.license:rjridjs38382 group.dragon-access

# example #2
add_ace group.donator-group command.luman-dragon allow
add_principal identifier.license:rjridjs38382 group.donator-group
```

{% hint style="info" %}
More details about how it works in [ACE Permissions](https://forum.cfx.re/t/basic-aces-principals-overview-guide/90917) guide.
{% endhint %}

{% hint style="info" %}
You also can totally enable the command to all players on the server in `config.lua` by setting `Config.CommandAdminOnly = false`.
{% endhint %}

### Permissions by Player Identifiers

You can restrict access per specific dragons. For this add player identifiers into `allowedOnlyToPlayersWithIdentifiers`. From now only players with these identifiers will have access to the dragon. Example:

```lua
Config.Dragons = {
    -- Golden Dragon. Use command `/luman-dragon 1`
    {
        hash = `a_c_lumandragon_01`,
        outfit = 0,
        ...
        cameraDistance = 11.0,
        allowedOnlyToPlayersWithIdentifiers = {
            "fivem:70175",
            "discord:452471793853267973",
            "steam:21000000020000",
            "license:1rerd5d1234b7cc33c2de13fc0fer5e2dbc3f432",
        },
    },
}
```

## Advanced Configuration

```lua
----------------------------
-- Advanced Configuration --
----------------------------
Config.AllowDamageToDragonByBullets = true -- see shared/damage.lua
Config.AllowDamageToDragonByMelee = true -- see shared/damage.lua
Config.SummonCooldown = 60000 -- milliseconds
Config.FireCharging = {
    Enabled = true,
    MAX_FIRE_CHARGE = 100,
    CRITITCAL_FIRE_CHARGE = 10,
    DECREASE_FIRE_CHARGE_EVERY_MS = 100,
    INCREASE_FIRE_CHARGE_EVERY_MS = 5000,
    UI_POS_X = 0.5,
    UI_POS_Y = 0.95,
}
Config.Health = {
    UI_POS_X = 0.5,
    UI_POS_Y = 0.925,
}
Config.ToggleUIButton = 9 -- Tab button. See: https://cherrytree.at/misc/vk.htm / https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

--------------------------------------------------------
-- Experimental options. Change them on your own risk --
--------------------------------------------------------
Config.DragonSpeedLimitEnabled = true
Config.DragonSpeedLimit = 20.0
Config.AllowDamageToDragonByFire = false
```

## Items

```lua
Config.Inventory = {
    Enabled = true,

    -- Remove the item from the player's inventory when used.
    RemoveOnUse = false,

    -- Apply the summon cooldown (Config.SummonCooldown) to item usage.
    RespectCooldown = false,

    -- Map a usable inventory item name to the dragon index it spawns
    -- (index matches an entry in Config.Dragons below).
    Items = {
        ['golden_dragon_totem'] = 1,
        ['red_dragon_totem']    = 2,
        ['blue_dragon_totem']   = 3,
        ['owl_totem']           = 4,
    },
}
```
