IsPedDucked: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 23: Line 23:
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>
 
[[ru:IsPedDucked]]
==See Also==
==See Also==
{{Ped functions}}
{{Ped functions}}

Revision as of 11:34, 10 August 2014

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

Click to collapse [-]
Client

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 isPedDucked ( randomPlayer ) then
	outputChatBox ( getPlayerName ( randomPlayer ) .. " is currently crouching." )
end

See Also