OnPlayerWeaponSwitch

From RAGE Multiplayer Wiki

This event is triggered when a player changes weapon.


C# Syntax

[ServerEvent(Event.PlayerWeaponSwitch)]

Parameters

  • player: parameter input should be in Player type
  • oldWeapon: parameter input should be in WeaponHash type
  • newWeapon: parameter input should be in WeaponHash type

Example

[ServerEvent(Event.PlayerWeaponSwitch)]
public void OnPlayerWeaponSwitch(Player player, WeaponHash oldWeapon, WeaponHash newWeapon)
{
	player.SendChatMessage($"You have swapped from {oldWeapon} to {newWeapon}.");
}