IsPlayerDucked: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:
==Example==
==Example==
This example checks if a random player is ducked or not, and if so displays a message in the chat box.
This example checks if a random player is ducked or not, and if so displays a message in the chat box.
<syntaxhighlight lang="lua">aPlayer = getRandomPlayer ( )
<syntaxhighlight lang="lua">
if ( isPlayerDucked ( aPlayer ) )
aPlayer = getRandomPlayer ( )
  outputChatBox ( getPlayerName ( aPlayer ) .. " is currently crouching." )
if ( isPlayerDucked ( aPlayer ) ) then
end</syntaxhighlight>
outputChatBox ( getClientName ( aPlayer ) .. " is currently crouching." )
end
</syntaxhighlight>


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

Revision as of 18:32, 30 July 2007

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

Syntax

bool isPlayerDucked ( player thePlayer )

Required Arguments

  • thePlayer: A player object referencing the specified player

Returns

Returns true if the player 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.

aPlayer = getRandomPlayer ( )
if ( isPlayerDucked ( aPlayer ) ) then
	outputChatBox ( getClientName ( aPlayer ) .. " is currently crouching." )
end

See Also