IsPlayerDucked: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
This function checks if the specified [[player]] is ducked (crouched) or not.
This function returns a boolean value (true or false) depending on whether the specified [[player]] is ducked (crouched) or not.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool IsPlayerDucked ( player player )</syntaxhighlight>
<syntaxhighlight lang="lua">bool isPlayerDucked ( player thePlayer )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''player''': A [[player]] object referencing the specified player
*'''thePlayer''': A [[player]] object referencing the specified player


==Example==
==Example==
<syntaxhighlight lang="lua">player = getPlayerFromID ( 1 )
This example checks if a random player is ducked or not, and if so displays a message in the chat box.
if ( IsPlayerDucked ( player ) )
<syntaxhighlight lang="lua">aPlayer = getRandomPlayer ( )
   outputChatBox ( GetPlayerName ( player ) , " is currently crouching." )
if ( isPlayerDucked ( aPlayer ) )
   outputChatBox ( getPlayerName ( aPlayer ) .. " is currently crouching." )
end</syntaxhighlight>
end</syntaxhighlight>


==See Also==
==See Also==
{{Player functions}}
{{Player functions}}

Revision as of 10:06, 14 August 2006