- Documentation
- Server functions
- setAnalogControlState
Function
setAnalogControlState
An alias of setPedAnalogControlState, kept for older scripts. It takes the same arguments: ped, control name and strength 0-1.
Syntax
bool setAnalogControlState(ped ped, string control, float state)Arguments
pedped- A player or an NPC.Different type in MTA:SA: string control
controlstring- Control name.Different type in MTA:SA: float state
statefloat- Strength 0-1.Different type in MTA:SA: bool forceOverrideNextFrame = false
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
setAnalogControlState(string control, float state, bool forceOverrideNextFrame = false)Returns
true on success.
Example
setAnalogControlState(walker, "forwards", 0.5)
See also
setPedAnalogControlStateSets a ped's analog control within 0-1, i.e. how hard it is "pressed" (e.g. 0.5 = half throttle). The value is stored for scripts; in addition any value above 0 presses the regular control of that name and 0 releases it, so for NPCsforwards,backwardsandsprintwork in the game as withsetPedControlState(without graded strength).getAnalogControlStateAn alias ofgetPedAnalogControlState, kept for compatibility with existing scripts. Returns the analog control strength 0-1.