IsPedBleeding: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0159|1.5.8|20935|This function gets the state of a player's or ped's bleeding effect.}} ==Syntax== <synt...")
 
(Remove obsolete Requirements section)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Client function}}
{{Client function}}
__NOTOC__
__NOTOC__
{{New feature/item|3.0159|1.5.8|20935|This function gets the state of a [[player|player's]] or [[ped|ped's]] bleeding effect.}}
{{Added feature/item|1.5.9|1.5.8|20935|This function gets the state of a [[player|player's]] or [[ped|ped's]] bleeding effect.}}
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">bool isPedBleeding( ped thePed ) </syntaxhighlight>  
<syntaxhighlight lang="lua">bool isPedBleeding ( ped thePed ) </syntaxhighlight>  
{{OOP||[[ped]]:isBleeding|bleeding|setPedBleeding}}
{{OOP||[[ped]]:isBleeding|bleeding|setPedBleeding}}


===Required Arguments===
===Required Arguments===
*'''thePed:''' the player or ped whose bleeding effect state you want to get.
*'''thePed:''' The [[player]] or [[ped]] whose bleeding effect state you want to get.


===Returns===
===Returns===
Returns ''true'' if the player or ped is bleeding, ''false'' otherwise.
Returns ''true'' if the [[player]] or [[ped]] is bleeding, ''false'' otherwise.


==Example==
==Example==
{{Example}}
<syntaxhighlight lang="lua">
function checkBleeding ()
  if isPedBleeding (localPlayer) then
      outputChatBox ("The ped is bleeding!")
  else
      outputChatBox ("The ped is not bleeding!")
  end
end


==Requirements==
addCommandHandler ("checkbleed", checkBleeding)
{{Requirements|n/a|1.5.8-9.20935|}}
</syntaxhighlight>


==See Also==
==See Also==
{{Client ped functions}}
{{Client ped functions}}

Latest revision as of 17:28, 7 November 2024

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 ("checkbleed", checkBleeding)

See Also