Player::applyDamageTo: Difference between revisions

From RAGE Multiplayer Wiki
Line 10: Line 10:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
// player health: 100, armor: 100
player.applyDamageTo(25, false);
// player health: 75, armor: 100
player.applyDamageTo(25, true);
// player health: 75, armor: 75
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Player_function_c}}
{{Player_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 11:21, 9 January 2023

Syntax

player.applyDamageTo(damageAmount, withArmor);

Required Arguments

  • damageAmount: int
  • withArmor: Boolean

Return value

  • Undefined

Example

// player health: 100, armor: 100
player.applyDamageTo(25, false);
// player health: 75, armor: 100
player.applyDamageTo(25, true);
// player health: 75, armor: 75

See also