OnItemSkinChange
Usage
- Return a non-null value to override default behavior
Example Autogenerated
csharp
private object OnItemSkinChange( int inventoryId, Item slot, RepairBench instance, BasePlayer basePlayer )
{
Puts( "OnItemSkinChange works!" );
return null;
}Location
- RepairBench::ChangeSkin(BaseEntity.RPCMessage msg)
csharp
//---
int inventoryId = msg.read.Int32();
ItemId itemId = ((msg.read.Unread > 0) ? new ItemId(msg.read.UInt64()) : default(ItemId));
bool isValid = itemId.IsValid;
bool flag = !isValid || Time.realtimeSinceStartup > nextSkinChangeAudioTime;
Item slot = base.inventory.GetSlot(0);
if (slot == null || Interface.CallHook("OnItemSkinChange", inventoryId, slot, this, player) != null || (isValid && slot.uid != itemId))
{
return;
}
if (inventoryId != 0 && !player.blueprints.CheckSkinOwnership(inventoryId, player))
{
//---