# Shared Emotes

Two-player synchronized emotes (couples, handshakes, etc.) with a request/accept system.

***

### How it works

1. Open the emote menu and go to the **Shared** tab
2. Click a shared emote
3. The system finds the **nearest player** within range
4. A **request** is sent to the target player
5. The target sees a prompt:
   * Press `E` to **accept**
   * Press `X` to **decline**
   * Press `ALT` to **switch target** (if multiple players nearby)
6. If accepted, both players are positioned and play their respective animations

{% hint style="info" %}
If the target doesn't respond within the timeout (10 seconds by default), the request is automatically declined.
{% endhint %}

***

### Positioning

Shared emotes use sync parameters to position the two players relative to each other:

| Parameter | Description                              |
| --------- | ---------------------------------------- |
| `front`   | Distance in front of the initiator (1.0) |
| `side`    | Lateral offset (0.0)                     |
| `height`  | Vertical offset (0.0)                    |
| `heading` | Heading difference (180.1 = facing)      |

Some shared emotes also use bone attachments for precise alignment.

***

### Server validation

The server validates every shared emote request:

* **Rate limiting** -- one request per 2 seconds per player
* **Distance check** -- both players must be within `MaxRange`
* **Ped existence** -- ensures both players are spawned

***

### Config

```lua
Config.SharedEmotes = {
    MaxRange = 3.0,          -- Max distance between players
    RequestTimeout = 10,     -- Seconds before auto-decline
    AcceptControl = 51,      -- Accept key (E)
    DeclineControl = 73,     -- Decline key (X)
    CycleTargetControl = 19, -- Cycle target key (Alt)
}
```


---

# 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://doc.var-fivem.com/emote/configuration/shared-emotes.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.
