# Custom Interaction

## Config (shared/cfg.lua)

```lua
['ped'] = {
        ['personal_card'] = {
            ['icon'] = 'fa-solid fa-money-check-dollar',
            ['label'] = ' [E]', -- UI Label
            ['key'] = 38, -- Interact key code https://docs.fivem.net/docs/game-references/controls/
            ['event'] = 'rm_copsv:client:openPersonalCard',
            
        },
        ['dispatch'] = {
            ['icon'] = 'fa-solid fa-handcuffs',
            ['label'] = ' [Y]', -- UI Label
            ['key'] = 246, -- Interact key code https://docs.fivem.net/docs/game-references/controls/
            ['event'] = 'rm_copsv:client:fakeDispatch',
        },
        ['location_player'] = {
            ['icon'] = 'fa-solid fa-location-dot',
            ['label'] = ' [U]', -- UI Label
            ['key'] = 303, -- Interact key code https://docs.fivem.net/docs/game-references/controls/
            ['event'] = 'rm_copsv:client:locationPlayer',
        },
        -- Custom Interaction
        ['custom_interaction'] = {
            ['icon'] = 'fa-solid fa-location-dot',
            ['label'] = ' [U]', -- UI Label
            ['key'] = 47, -- Interact key code https://docs.fivem.net/docs/game-references/controls/
            ['event'] = 'rm_copsv:client:customEvent',
        },
},
```

Add these lines as a new option to ped interactions. This table should be placed under `cfg['interactions']['ped']`, similar to `cfg['interactions']['vehicle']`.

```lua
['custom_interaction'] = {
    ['icon'] = 'fa-solid fa-location-dot',
    ['label'] = ' [U]', -- UI Label
    ['key'] = 47, -- Interact key code https://docs.fivem.net/docs/game-references/controls/
    ['event'] = 'rm_copsv:client:customEvent', -- Add a new event for custom interaction on the client side.
},
```


---

# 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.rainmad.com/resources/cops-v-database/custom-interaction.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.
