Skip to content

OnRackedWeaponSwapped

Usage

  • No return behavior

Example Autogenerated

csharp
private void OnRackedWeaponSwapped( Item item, WeaponRackSlot weaponAtIndex, BasePlayer player, WeaponRack instance )
{
    Puts( "OnRackedWeaponSwapped works!" );
}

Location

  • WeaponRack::SwapPlayerWeapon(BasePlayer player, int gridCellIndex, int takeFromBeltIndex, int rotation)
csharp
//---
			item.RemoveFromContainer();
			GivePlayerWeapon(player, mountSlotIndex, takeFromBeltIndex, tryHold: false);
			MountWeapon(item, player, bestPlacementCellIndex, rotation, sendUpdate: false);
			ItemManager.DoRemoves();
			SendNetworkUpdateImmediate();
			Interface.CallHook("OnRackedWeaponSwapped", item, weaponAtIndex, player, this);
		}
	}
}

Released under the MIT License.