Skip to content

OnTrainCarUncouple

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnTrainCarUncouple( TrainCar instance, BasePlayer player )
{
    Puts( "OnTrainCarUncouple works!" );
}

Location

  • TrainCar::RPC_WantsUncouple(BaseEntity/RPCMessage msg)
csharp
//---
	}
	if (Vector3.SqrMagnitude(base.transform.position - player.transform.position) > 200f)
	{
		return;
	}
	if (Interface.CallHook("OnTrainCarUncouple", this, msg.player) != null)
	{
		return;
	}
	bool front = msg.read.Bit();
	this.coupling.Uncouple(front);
//---

Released under the MIT License.