SetPedBleeding: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
Tag: Reverted
m (Reverted edits by Hydra (talk) to last revision by StrixG)
Tag: Rollback
Line 14: Line 14:


==Example==
==Example==
Example by Hydra
{{Example}}
<syntaxhighlight lang="lua">
function makePedBleed()
  if getElementHealth(localPlayer) == 20 then
      setPedBleeding(localPlayer, true)
  else
      setPedBleeding(localPlayer, false)
  end
end
addEventHandler("onClientRender", root, makePedBleed)
</syntaxhighlight>


==Requirements==
==Requirements==

Revision as of 11:59, 3 September 2021

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, error is raised otherwise.

Example

Accessories-text-editor.png Script Example Missing Function SetPedBleeding needs a script example, help out by writing one.

Before submitting check out Editing Guidelines Script Examples.
-- TODO


Requirements

This template will be deleted.

See Also