OnItemPickup
Usage
- Return a non-null value to override default behavior
Example Autogenerated
csharp
private object OnItemPickup( Item item, BasePlayer player, WorldItem instance )
{
Puts( "OnItemPickup works!" );
return null;
}Location
- WorldItem::Pickup(BaseEntity.RPCMessage msg)
csharp
[RPC_Server]
[RPC_Server.IsVisible(3f)]
public void Pickup(RPCMessage msg)
{
if (msg.player.CanInteract() && this.item != null && allowPickup && Interface.CallHook("OnItemPickup", this.item, msg.player, this) == null && CanOpenInSafeZone(msg.player))
{
ItemModContainer component = this.item.info.GetComponent<ItemModContainer>();
if (!(component != null) || !component.canLootInWorld || !(component.pickupInWorldDelay > 0f) || !(Mathf.Abs(pickupStartTime + component.pickupInWorldDelay - UnityEngine.Time.realtimeSinceStartup) > ConVar.AntiHack.rpc_timer_forgiveness))
{
ClientRPC(RpcTarget.NetworkGroup("PickupSound"));
//---