Skip to content

OnRackedWeaponTake

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnRackedWeaponTake( Item slot, BasePlayer player, WeaponRack instance )
{
    Puts( "OnRackedWeaponTake works!" );
}

Location

  • WeaponRack::GivePlayerWeapon(BasePlayer player, int mountSlotIndex, int playerBeltIndex, bool tryHold, bool sendUpdate)
csharp
//---
	Item slot = base.inventory.GetSlot(weaponAtIndex.InventoryIndex);
	if (slot == null)
	{
		return;
	}
	if (Interface.CallHook("OnRackedWeaponTake", slot, player, this) != null)
	{
		return;
	}
	this.ClearSlot(weaponAtIndex);
	if (slot.MoveToContainer(player.inventory.containerBelt, playerBeltIndex, true, false, null, true))
//---

Released under the MIT License.