Skip to content

OnCodeEntered

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnCodeEntered( CodeLock instance, BasePlayer player, string text )
{
    Puts( "OnCodeEntered works!" );
}

Location

  • CodeLock::UnlockWithCode(BaseEntity/RPCMessage rpc)
csharp
//---
	if (this.IsCodeEntryBlocked())
	{
		return;
	}
	string text = rpc.read.String(256, false);
	if (Interface.CallHook("OnCodeEntered", this, rpc.player, text) != null)
	{
		return;
	}
	bool flag = text == this.guestCode;
	bool flag2 = text == this.code;
//---

Released under the MIT License.