IsPlayerDead: 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 dead or not.
This function returns a boolean value (true or false) depending on whether the specified [[player]] is dead or not.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool IsPlayerDead ( player player )</syntaxhighlight>
<syntaxhighlight lang="lua">bool isPlayerDead ( player thePlayer )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
* '''player''': A [[player]] object referencing the specified player
* '''thePlayer''': A [[player]] object referencing the specified player
 
===Returns===
Returns ''true'' if the player is dead, ''false'' otherwise.


==Example==
==Example==
<syntaxhighlight lang="lua">player = GetRandomPlayer ( )
This example checks if a random player is dead, and if so displays a message in the chat.
if ( IsPlayerDead ( player ) )
<syntaxhighlight lang="lua">player = getRandomPlayer ( )
   outputChatBox ( GetPlayerName ( player ) , " has bitten the dust." )
if ( isPlayerDead ( player ) )
   outputChatBox ( getPlayerName ( player ) , " has bitten the dust." )
end</syntaxhighlight>
end</syntaxhighlight>


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

Revision as of 10:03, 14 August 2006

This function checks if the specified player is dead or not.

Syntax

bool isPlayerDead ( player thePlayer )

Required Arguments

  • thePlayer: A player object referencing the specified player

Returns

Returns true if the player is dead, false otherwise.

Example

This example checks if a random player is dead, and if so displays a message in the chat.

player = getRandomPlayer ( )
if ( isPlayerDead ( player ) )
  outputChatBox ( getPlayerName ( player ) , " has bitten the dust." )
end

See Also