IsPlayerDead: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (Changed "DeprecatedWithAlt" template to "Deprecated") |
||
(14 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | |||
This function | {{Deprecated|isPedDead|}} | ||
This function checks if the specified [[player]] is dead or not. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool isPlayerDead ( player thePlayer )</syntaxhighlight> | |||
===Required Arguments=== | ===Required Arguments=== | ||
* ''' | * '''thePlayer''': A [[player]] object referencing the specified player | ||
===Returns=== | |||
Returns ''true'' if the player is dead, ''false'' otherwise. | |||
==Example== | ==Example== | ||
<section name="Server" class="server" show="true"> | |||
This example allows a player to use the command 'amidead' to see if they are dead or not. | |||
<syntaxhighlight lang="lua"> | |||
--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 ) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | |||
{{Player functions}} |
Latest revision as of 16:14, 13 February 2015
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use isPedDead instead. |
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 [-]
ServerThis 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
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState