Skip to content

CanLootEntity

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void CanLootEntity( BasePlayer player, BaseRidableAnimal instance )
{
    Puts( "CanLootEntity works!" );
}
csharp
private void CanLootEntity(  )
{
    Puts( "CanLootEntity works!" );
}
csharp
private void CanLootEntity( BasePlayer player, DroppedItemContainer instance )
{
    Puts( "CanLootEntity works!" );
}
csharp
private void CanLootEntity(  )
{
    Puts( "CanLootEntity works!" );
}
csharp
private void CanLootEntity( BasePlayer player, LootableCorpse instance )
{
    Puts( "CanLootEntity works!" );
}
csharp
private void CanLootEntity( BasePlayer player, ResourceContainer instance )
{
    Puts( "CanLootEntity works!" );
}
csharp
private void CanLootEntity(  )
{
    Puts( "CanLootEntity works!" );
}

Location

  • BaseRidableAnimal::RPC_OpenLoot(BaseEntity/RPCMessage rpc)
  • ContainerIOEntity::PlayerOpenLoot(BasePlayer player, string panelToOpen, bool doPositionChecks)
  • DroppedItemContainer::RPC_OpenLoot(BaseEntity/RPCMessage rpc)
  • IndustrialCrafter::PlayerOpenLoot(BasePlayer player, string panelToOpen, bool doPositionChecks)
  • LootableCorpse::RPC_LootCorpse(BaseEntity/RPCMessage rpc)
  • ResourceContainer::StartLootingContainer(BaseEntity/RPCMessage msg)
  • StorageContainer::PlayerOpenLoot(BasePlayer player, string panelToOpen, bool doPositionChecks)
csharp
//---
	}
	if (this.needsBuildingPrivilegeToUse && !player.CanBuild())
	{
		return;
	}
	if (Interface.CallHook("CanLootEntity", player, this) != null)
	{
		return;
	}
	if (player.inventory.loot.StartLootingEntity(this, true))
	{
//---
csharp
public virtual bool PlayerOpenLoot(BasePlayer player, string panelToOpen = "", bool doPositionChecks = true)
{
	if (Interface.CallHook("CanLootEntity", player, this) != null)
	{
		return false;
	}
	if (this.needsBuildingPrivilegeToUse && !player.CanBuild())
	{
//---
csharp
//---
	BasePlayer player = rpc.player;
	if (!player || !player.CanInteract())
	{
		return;
	}
	if (Interface.CallHook("CanLootEntity", player, this) != null)
	{
		return;
	}
	if (player.inventory.loot.StartLootingEntity(this, true))
	{
//---
csharp
public virtual bool PlayerOpenLoot(BasePlayer player, string panelToOpen = "", bool doPositionChecks = true)
{
	if (Interface.CallHook("CanLootEntity", player, this) != null)
	{
		return false;
	}
	if (this.NeedsBuildingPrivilegeToUse && !player.CanBuild())
	{
//---
csharp
//---
	}
	if (this.containers == null)
	{
		return;
	}
	if (Interface.CallHook("CanLootEntity", player, this) != null)
	{
		return;
	}
	if (player.inventory.loot.StartLootingEntity(this, true))
	{
//---
csharp
//---
	}
	if (!this.lootable)
	{
		return;
	}
	if (Interface.CallHook("CanLootEntity", player, this) != null)
	{
		return;
	}
	if (player.inventory.loot.StartLootingEntity(base.baseEntity, true))
	{
//---
csharp
public virtual bool PlayerOpenLoot(BasePlayer player, string panelToOpen = "", bool doPositionChecks = true)
{
	if (Interface.CallHook("CanLootEntity", player, this) != null)
	{
		return false;
	}
	if (base.IsLocked() || base.IsTransferring())
	{
//---

Released under the MIT License.