# getPedAnalogControlState (Client)

> Tells how far one of a ped's controls is pressed, from 0 to 1. It is meant for analog controls such as walking, steering and accelerating.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Controls
- **URL**: https://wiki.mymp.gg/en/getPedAnalogControlState

## Syntax

```lua
float|false getPedAnalogControlState(ped thePed, string control [, bool rawInput = false])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `thePed` | `ped` | The ped or player. |
| `control` | `string` | The control's name, case insensitive. |
| `rawInput` | `bool` | Local player only: `true` reads the player's own input, before the states set by scripts and the controls turned off. *(default: `false`)* |

## Returns

A number from 0 to 1. A control that is not analog gives 0 or 1. `false` if the control name does not exist or the ped cannot be read; on a player, a name that does not exist gives 0.

On the local player it reads what the game gets this frame, including what `setControlState` turned on. On a remote player it reads the controls that came over the network. On a ped it reads what a script set on it.

## Example

```lua
addEventHandler("onClientRender", root, function()
    if isPedInVehicle(localPlayer) then
        local throttle = getPedAnalogControlState(localPlayer, "accelerate")
        dxDrawText(string.format("Acelerador: %d%%", throttle * 100), 20, 300)
    end
end)
```

## See also

- [setPedAnalogControlState (Client)](https://wiki.mymp.gg/en/setPedAnalogControlState.md): Presses one of a ped's analog controls only partly, for example to make it walk slowly or steer gently.
- [getPedControlState (Client)](https://wiki.mymp.gg/en/getPedControlState.md): Tells whether one of a ped's controls is pressed, such as forwards, fire or accelerate.
- [setControlState (Client)](https://wiki.mymp.gg/en/setControlState-client.md): Presses or releases one of a ped's controls as if it were a key, for example to make it walk, jump or shoot.
