IsPedDead

From Multi Theft Auto: Wiki
Revision as of 17:24, 26 November 2014 by AlexTMjugador (talk | contribs) (Added OOP syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

Syntax

bool isPedDead ( ped thePed )

OOP Syntax Help! I don't understand this!

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


Required Arguments

  • thePed: the ped you want to check up on.

Returns

Returns true if the ped 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 ( 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