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

Function

isPedOnGround

ServerPedsIdentical to MTA:SA

Checks whether a ped is standing on the ground. Returns false when the ped is jumping, falling, swimming, sitting in a vehicle or flying a jetpack. The state comes from the player's game.

Syntax

bool isPedOnGround(ped ped)

Arguments

pedped
A player or an NPC.

Returns

true when on the ground.

Example

addCommandHandler("skok", function(player)
    if isPedOnGround(player) then setElementVelocity(player, 0, 0, 0.5) end
end)

See also