OnPlayerDamage: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "{{Warning|This feature is currently doesn't work in the current branch of Rage Multiplayer.}} This event is triggered when a player's health or armor changes. {{CSharpContai...")
 
(Rage -> RAGE)
Line 1: Line 1:
{{Warning|This feature is currently doesn't work in the current branch of Rage Multiplayer.}}
{{Warning|This feature is currently doesn't work in the current branch of RAGE:Multiplayer.}}


This event is triggered when a player's health or armor changes.
This event is triggered when a player's health or armor changes.

Revision as of 08:55, 8 June 2020

This feature is currently doesn't work in the current branch of RAGE:Multiplayer.

This event is triggered when a player's health or armor changes.


C# Syntax

[ServerEvent(Event.PlayerDamage)]

Parameters

  • player: parameter input should be in Client type
  • health: parameter input should be in float type
  • armor: parameter input should be in float type

Example

[ServerEvent(Event.PlayerDamage)]
public void OnPlayerDamage(Client player, float healthLoss, float armorLoss)
{
	player.SendChatMessage($"You have lost {healthLoss} health and {armorLoss} armor.");
}