# Client

## <mark style="color:green;">playAnim</mark>

### Usage

```lua
Lib.playAnim(ped, data)
```

* ped: `number`
* data: `object`
  * isNetwork(optional): `boolean`
    * default: `false`
  * dict: `string`
  * anim: `string`
  * blendIn(optional): `float`
    * default: `3.0`
  * blendOut(optional): `float`
    * default: `3.0`
  * duration(optional): `number`
    * default: `-1`
  * flag(optional): `number`
    * default: `49`
  * playbackRate(optional): `number`
    * default: `0`
  * lockX(optional): `boolean`
    * default: `false`
  * lockY(optional): `boolean`
    * default: `false`
  * lockZ(optional): `boolean`
    * default: `false`

### Example

```lua
Lib.playAnim(ped, {
    dict = "rcmnigel1c",
    anim = "hailing_whistle_waive_a",
    flag = 0,
})
```

```lua
Lib.playAnim(netId, {
    isNetwork = true,
    dict = "rcmnigel1c",
    anim = "hailing_whistle_waive_a",
    flag = 0,
})
```

## <mark style="color:green;">playScenario</mark>

### Usage

```lua
Lib.playScenario(ped, data)
```

* ped: `number`
* data: `object`
  * scenario: `string`
  * enterAnim(optional): `boolean`
    * default: `true`

### Example

```lua
Lib.playScenario(ped, {
    scenario = "WORLD_HUMAN_GUARD_STAND",
})
```

## <mark style="color:green;">playSpeech</mark>

### Usage

```lua
Lib.playSpeech(ped, data)
```

* ped: `number`
* data: `table{}`
  * isNetwork(optional): `boolean`
    * default: `false`
  * name: `string`
  * param: `string`

### Example

```lua
Lib.playSpeech(ped, {
    name = "GENERIC_HI",
    param = "SPEECH_PARAMS_STANDARD",
})
```

```lua
Lib.playSpeech(netId, {
    isNetwork = true,
    name = "GENERIC_HI",
    param = "SPEECH_PARAMS_STANDARD",
})
```

## <mark style="color:green;">faceToCoords</mark>

### Usage

```lua
Lib.faceToCoords(entity, target)
```

* entity: `number`
* target: `vector3` or `number`

### Example

```lua
Lib.faceToCoords(entity, GetEntityCoords(PlayerPedId()))
```

* return: `number`

## <mark style="color:green;">faceToCoordsSmooth</mark>

### Usage

```lua
Lib.faceToCoordsSmooth(ped, coords, delay)
```

* ped: `number`
* coords: `vector3`
* delay: `float(seconds)`

### Example

```lua
Lib.faceToCoordsSmooth(ped, vector3(0.0, 0.0, 0.0), 3.0)
```

## <mark style="color:green;">createObj</mark>

### Usage

```lua
Lib.createObj(hash, coords, isNetwork, data)
```

* hash: `string` or `number`
* coords: `vector3`
* isNetwork: `boolean`
* data(optional): `object`
  * rotation(optional): `object`
    * p: `float`
    * r: `float`
    * y: `float`
  * placeOnGround(optional): `boolean`
  * freeze(optional): `boolean`
  * invincible(optional): `boolean`
  * disableCollision(optional): `boolean`
  * alpha(optional): `number`

### Example

```lua
Lib.createObj("ng_proc_coffee_01a", vector3(0.0, 0.0, 0.0), false)
```

```lua
Lib.createObj("ng_proc_coffee_01a", vector3(0.0, 0.0, 0.0), true, {
    placeOnGround = true,
    freeze = true,
    invincible = true,
})
```

* return: `object`
  * id: `number`
  * netId: `number`

## <mark style="color:green;">createPed</mark>

### Usage

```lua
Lib.createPed(hash, coords, isNetwork, data)
```

* hash: `string` or `number`
* coords: `vector3`
* isNetwork: `boolean`
* data(optional): `object`
  * placeOnGround(optional): `boolean`
  * defaultVariation(optional): `boolean`
  * freeze(optional): `boolean`
  * god(optional): `boolean`
  * disableRagdoll(optional): `boolean`
  * cannotTarget(optional): `boolean`

### Example

```lua
Lib.createPed("a_m_y_downtown_01", vector3(0.0, 0.0, 0.0), false)
```

```lua
Lib.createPed("a_m_y_downtown_01", vector3(0.0, 0.0, 0.0), false, {
    placeOnGround = true,
    defaultVariation = true,
    freeze = true,
    god = true,
})
```

* return: `object`
  * id: `number`
  * netId: `number`

## <mark style="color:green;">createVeh</mark>

### Usage

```lua
Lib.createVeh(hash, coords, isNetwork, data)
```

* hash: `string` or `number`
* coords: `vector4`
* isNetwork: `boolean`
* data(optional): `object`
  * freeze(optional): `boolean`

### Example

```lua
Lib.createVeh("sultanrs", vector3(0.0, 0.0, 0.0), false)
```

```lua
Lib.createVeh("sultanrs", vector3(0.0, 0.0, 0.0), false, {
    freeze = true,
})
```

* return: `object`
  * id: `number`
  * netId: `number`

## <mark style="color:green;">deleteEntity</mark>

### Usage

```lua
Lib.deleteEntity(entity, invoker)
```

* entity: `number`
* invoker: `string`

### Example

```lua
Lib.deleteEntity(entity)
```

## <mark style="color:green;">getVehicleFullName</mark>

### Usage

```lua
Lib.getVehicleFullName(hash)
```

* hash: `string` or `number`

### Example

```lua
Lib.getVehicleFullName(hash)
```

* return: `string`

## <mark style="color:green;">setEntityStateBag</mark>

### Usage

```lua
Lib.setEntityStateBag(netId, key, value)
```

* netId: `number`
* key: `string`
* value: `any`

### Example

```lua
local veh = GetVehiclePedIsIn(PlayerPedId(), false)

if veh ~= 0 then
    Lib.setEntityStateBag(NetworkGetNetworkIdFromEntity(veh), someoneInVehicle, true)
end
```
