> For the complete documentation index, see [llms.txt](https://docs.vames-store.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vames-store.com/assets/vms_anims/developer-api/client-exports.md).

# Client Exports

### RunAnimationById

If you want to get rid of unnecessary animation requesting in another script, you can use the function from vms\_anims by specifying the animation ID from the in-game panel and specifying parameters.

{% code overflow="wrap" %}

```etlua
-- @param {id: number}: Animation id displayed on each animation in the menu
-- @param {disableCancel: boolean}: Ability to cancel animation at any time (true = cannot cancel animation / false = can cancel the animation)
-- @param {time number}: Animation duration, if you want infinite animation set -1, otherwise value given in milliseconds
-- @param {flag: number}: Animation flag: https://docs.fivem.net/natives/?_0xEA47FE3719165B94
-- @param {disableAdjusting: boolean}: Is the player to be able to adjust the position of the animation with a button or command
-- @param {syncedOptions: table}: Options for synced animation
--    selecting: Is the player to be able to choose the player
--    force: Will the other player have forced acceptance without choice
--    player: You can specify the ID of the player to be selected for animation

exports['vms_anims']:RunAnimationById(
    id,
    disableCancel,
    time,
    flag,
    disableAdjusting,
    syncedOptions
)
```

{% endcode %}

<details>

<summary>Example Usage</summary>

Synchronized animation started with cancellation option, player does not have to select the other player and player with id 2 does not have to accept the animation:

```lua
exports['vms_anims']:RunAnimationById(
    649, 
    true, 
    5000, 
    0, 
    true,
    {selecting = false, force = true, player = 2}
)
```

</details>

***

### RunAnimation

If you want to get rid of the unnecessary animation request in another script, you can use the function from vms\_anims, specifying the name of the animation and specifying the required parameters.

{% code overflow="wrap" %}

```lua
---@param {data: table}: The table must contain the same parameters that are in the default animations in animations.lua
---@param {disableCancel: boolean}: Ability to cancel animation at any time (true = cannot cancel animation / false = can cancel the animation)
---@param {time: number}: Animation duration, if you want infinite animation set -1, otherwise value given in milliseconds
---@param {flag: number}: Animation flag: https://docs.fivem.net/natives/?_0xEA47FE3719165B94

exports['vms_anims']:RunAnimation(
    data,
    disableCancel,
    time,
    flag
)
```

{% endcode %}

<details>

<summary>Example Usage</summary>

Running animations with prop using vms\_anims

```lua
exports['vms_anims']:RunAnimation(
    {
        AnimDict = "anim@amb@nightclub@lazlow@hi_railing@",
        Anim = "ambclub_09_mi_hi_bellydancer_laz",
        props = {
            prop = "ba_prop_battle_glowstick_01",
            propBone = 28422,
            propPlacement = {0.07, 0.14, 0.0, -80.0, 20.0, 0.0, 0.0},
            propTwo = "ba_prop_battle_glowstick_01",
            propTwoBone = 60309,
            propTwoPlacement = {0.07, 0.09, 0.0, -120.0, -20.0, 0.0, 0.0}
        }
    }, 
    true, 
    5000, 
    0
)
```

</details>

***

### Cancel

If you have run an animation using the RunAnimationById export, and you want to cancel it, you can do so using the Cancel export

```lua
exports['vms_anims']:Cancel()
```

***

### isMenuOpened

Checking if the player has the menu running

```lua
exports['vms_anims']:isMenuOpened()
```

***

### getAnimData

Get information about the animation currently running

```lua
---@return table | false
local animation = exports['vms_anims']:getAnimData()
```
