SetPedBleeding

From Multi Theft Auto: Wiki
Revision as of 08:10, 1 September 2021 by Hydra (talk | contribs) (→‎Example)
Jump to navigation Jump to search

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

Example by Hydra

function makePedBleed()
   if getElementHealth(localPlayer) == 20 then
      setPedBleeding(localPlayer, true)
   else
      setPedBleeding(localPlayer, false)
   end
end
addEventHandler("onClientRender", root, makePedBleed)

Requirements

Minimum server version n/a
Minimum client version 1.5.8-9.20935

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.5.8-9.20935" />

See Also

Shared