IsPlayerDead

From Multi Theft Auto: Wiki
Revision as of 23:20, 21 October 2011 by Ccw (talk | contribs)
Jump to navigation Jump to search

Template:DeprecatedWithAlt 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

Click to collapse [-]
Server

This example allows a player to use the command 'amidead' to see if they are dead or not.

--Check if player is alive or dead and let them know in the chat box
function deathCheck ( thePlayer, commandName )
    if ( isPlayerDead ( thePlayer ) ) then
         outputChatBox ( "You're dead... prepare to become a zombie.", thePlayer )
    else
         outputChatBox ( "Count your lucky stars, you're alive.", thePlayer )
    end
end
addCommandHandler ( "amidead", deathCheck )

See Also