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

Function

getPedMoveState

ServerPedsIdentical to MTA:SA

Estimates how a ped is moving right now: stand, walk, powerwalk, jog or sprint. The result follows from the ped's speed, or from the walk/sprint control when a script pressed it. Useful e.g. for fatigue or footstep noise systems.

Syntax

string getPedMoveState(ped ped)

Arguments

pedped
A player or an NPC.

Returns

stand, walk, powerwalk, jog or sprint.

Example

setTimer(function()
    for _, p in ipairs(getElementsByType("player")) do
        if getPedMoveState(p) == "sprint" then outputChatBox("Biegniesz!", p) end
    end
end, 2000, 0)

See also