- Documentation
- Server functions
- isPedOnGround
Function
isPedOnGround
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
getPedContactElementReturns the element a ped is standing on, e.g. a vehicle or an object (when a player stands on a bus roof it returns the bus). Returnsfalsewhen the ped stands on regular map ground.isPedInVehicleChecks whether a ped is sitting in any vehicle (in any seat). It also returnsfalsewhile the ped is still getting in, before it takes the seat. When you need the vehicle itself, usegetPedOccupiedVehicle.