IsPedBleeding: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (We can see your name in the page history)
Line 13: Line 13:


==Example==
==Example==
Example by Hydra
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function checkBleeding()
function checkBleeding()
Line 22: Line 21:
   end
   end
end
end
addCommandHandler("cBleed", checkBleeding
addCommandHandler("cBleed", checkBleeding)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 11:57, 3 September 2021

This function gets the state of a player's or ped's bleeding effect.

Syntax

bool isPedBleeding( ped thePed ) 

OOP Syntax Help! I don't understand this!

Method: ped:isBleeding(...)
Variable: .bleeding
Counterpart: setPedBleeding


Required Arguments

  • thePed: the player or ped whose bleeding effect state you want to get.

Returns

Returns true if the player or ped is bleeding, false otherwise.

Example

function checkBleeding()
   if isPedBleeding(localPlayer) then
      outputChatBox("The ped is bleeding")
   else
      outputChatBox("The ped is not bleeding")
   end
end
addCommandHandler("cBleed", checkBleeding)

Requirements

This template will be deleted.

See Also