Skip to content

OnPlayerSpectate

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnPlayerSpectate( BasePlayer instance, string spectateFilter )
{
    Puts( "OnPlayerSpectate works!" );
}

Location

  • BasePlayer::StartSpectating()
csharp
//---
{
	if (this.IsSpectating())
	{
		return;
	}
	if (Interface.CallHook("OnPlayerSpectate", this, this.spectateFilter) != null)
	{
		return;
	}
	this.SetPlayerFlag(BasePlayer.PlayerFlags.Spectating, true);
	base.gameObject.SetLayerRecursive(10);
//---

Released under the MIT License.