SetPedBleeding: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Remove obsolete Requirements section)
 
(One intermediate revision by one other user not shown)
Line 14: Line 14:


==Example==
==Example==
{{Needs Example}}
This example causes the player to bleed.
 
<syntaxhighlight lang="lua">
==Requirements==
addCommandHandler("bleed", function()
{{Requirements|n/a|1.5.8-9.20935|}}
    setPedBleeding(localPlayer, not isPedBleeding(localPlayer))
end)
</syntaxhighlight>


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

Latest revision as of 17:28, 7 November 2024

This function allows you to set player's or ped's bleeding effect.

Syntax

bool setPedBleeding ( ped thePed, bool bleeding ) 

OOP Syntax Help! I don't understand this!

Method: ped:setBleeding(...)
Variable: .bleeding
Counterpart: isPedBleeding


Required Arguments

  • thePed: The player or ped whose bleeding effect you want to set of.
  • bleeding: Boolean specifying whether the player or ped is bleeding or not.

Returns

Returns true if the bleeding state was successfully set, false otherwise.

Example

This example causes the player to bleed.

addCommandHandler("bleed", function()
    setPedBleeding(localPlayer, not isPedBleeding(localPlayer))
end)

See Also