Skip to content

OnQuarryToggle

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnQuarryToggle( MiningQuarry miningQuarry, BasePlayer player )
{
    Puts( "OnQuarryToggle works!" );
}

Location

  • EngineSwitch::StartEngine(BaseEntity/RPCMessage msg)
  • EngineSwitch::StopEngine(BaseEntity/RPCMessage msg)
csharp
//---
public void StartEngine(BaseEntity.RPCMessage msg)
{
	MiningQuarry miningQuarry = base.GetParentEntity() as MiningQuarry;
	if (miningQuarry)
	{
		if (Interface.CallHook("OnQuarryToggle", miningQuarry, msg.player) != null)
		{
			return;
		}
		miningQuarry.EngineSwitch(true);
	}
//---
csharp
//---
public void StopEngine(BaseEntity.RPCMessage msg)
{
	MiningQuarry miningQuarry = base.GetParentEntity() as MiningQuarry;
	if (miningQuarry)
	{
		if (Interface.CallHook("OnQuarryToggle", miningQuarry, msg.player) != null)
		{
			return;
		}
		miningQuarry.EngineSwitch(false);
	}
//---

Released under the MIT License.