OnLiftUse
Usage
- Return a non-null value to override default behavior
Example Autogenerated
csharp
private object OnLiftUse( Lift instance, BasePlayer player )
{
Puts( "OnLiftUse works!" );
return null;
}csharp
private object OnLiftUse( ProceduralLift instance, BasePlayer player )
{
Puts( "OnLiftUse works!" );
return null;
}Location
- Lift::RPC_UseLift(BaseEntity.RPCMessage rpc)
- ProceduralLift::RPC_UseLift(BaseEntity.RPCMessage rpc)
csharp
[RPC_Server]
[RPC_Server.MaxDistance(3f)]
private void RPC_UseLift(RPCMessage rpc)
{
if (rpc.player.CanInteract() && Interface.CallHook("OnLiftUse", this, rpc.player) == null)
{
MoveUp();
}
}csharp
[RPC_Server]
[RPC_Server.MaxDistance(3f)]
private void RPC_UseLift(RPCMessage rpc)
{
if (rpc.player.CanInteract() && Interface.CallHook("OnLiftUse", this, rpc.player) == null && !IsBusy())
{
MoveToFloor((floorIndex + 1) % stops.Length);
}
}