ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. getPedControlState

Function

getPedControlState

ServerPedsIdentical to MTA:SA

Checks whether a ped's control is pressed according to the state set by scripts (setPedControlState or setPedAnalogControlState). It does not read the keys a player physically presses; use getControlState on the client for that.

Syntax

bool getPedControlState(ped ped, string control)

Arguments

pedped
A player or an NPC.
controlstring
Control name, e.g. "forwards".

Returns

true when pressed.

Example

if getPedControlState(walker, "sprint") then outputServerLog("biegnie") end

See also