OnCCTVDirectionChange
Usage
- Return a non-null value to override default behavior
Example Autogenerated
csharp
private object OnCCTVDirectionChange( CCTV_RC instance, BasePlayer player )
{
Puts( "OnCCTVDirectionChange works!" );
return null;
}Location
- CCTV_RC::Server_SetDir(BaseEntity.RPCMessage msg)
csharp
//---
public void Server_SetDir(RPCMessage msg)
{
if (!IsStatic())
{
BasePlayer player = msg.player;
if (player.CanBuild() && player.IsBuildingAuthed() && Interface.CallHook("OnCCTVDirectionChange", this, player) == null)
{
Vector3 direction = Vector3Ex.Direction(player.eyes.position, yaw.transform.position);
direction = base.transform.InverseTransformDirection(direction);
Vector3 vector = BaseMountable.ConvertVector(Quaternion.LookRotation(direction).eulerAngles);
pitchAmount = Mathf.Clamp(vector.x, pitchClamp.x, pitchClamp.y);
//---