Skip to content

OnItemAction

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnItemAction( Item item, string text, BasePlayer player )
{
    Puts( "OnItemAction works!" );
}

Location

  • PlayerInventory::ItemCmd(BaseEntity/RPCMessage msg)
csharp
//---
	Item item = this.FindItemByUID(id);
	if (item == null)
	{
		return;
	}
	if (Interface.CallHook("OnItemAction", item, text, msg.player) != null)
	{
		return;
	}
	BaseEntity entityOwner = item.GetEntityOwner();
	if (entityOwner != null && entityOwner == msg.player && msg.player.IsRestrainedOrSurrendering)
//---

Released under the MIT License.