IsPedDucked

From Multi Theft Auto: Wiki
Revision as of 18:07, 30 March 2008 by Arc (talk | contribs) (New page: __NOTOC__ {{Client function}} This function checks if the specified ped is ducked (crouched) or not. ==Syntax== <syntaxhighlight lang="lua">bool isPedDucked ( ped thePed )</syntaxhighlight> ===Required Argume...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function checks if the specified ped is ducked (crouched) or not.

Syntax

bool isPedDucked ( ped thePed )

Required Arguments

  • thePed: The ped to check.

Returns

Returns true if the ped is ducked, false otherwise.

Example

This example checks if a random player is ducked or not, and if so displays a message in the chat box.

local players = getElementsByType ( "player" )
local randomPlayer = players[math.random(#players)]
if ( isPlayerDucked ( randomPlayer ) ) then
	outputChatBox ( getPlayerName ( randomPlayer ) .. " is currently crouching." )
end

See Also