isPedDead | Multi Theft Auto: Wiki Skip to content

isPedDead

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


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

OOP Syntax Help! I don't understand this!

  • Method:ped:isDead(...)
  • Variable: .dead

Syntax

bool isPedDead ( ped thePed )
Required Arguments
  • thePed: the ped you want to check up on.

Returns

  • bool: value

Returns true if the ped is dead, false otherwise.

Code Examples

shared

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 ( isPedDead ( 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