RustTip

OnPlayerUnvanished

OxideCarbonPlayer
object OnPlayerUnvanished(BasePlayer local0)
object OnPlayerUnvanished()
Works — the game method in this build is the one the hook was written for.

Parameters

local0
BasePlayer

Return value

objectThe result is checked in a special way — see the call code below.

Example

object — you can affect the game: return a value to change or cancel the action.

private object OnPlayerUnvanished(BasePlayer local0)
{
    Puts("OnPlayerUnvanished");

    // change nothing — the game continues as usual
    return null;

    // to affect the game:
    // return null; // null — the game continues as usual
}

Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.

Injection point 1

Rust.opj (Oxide)
void ConVar.Debugging.invis(ConsoleSystem.Arg)

Passes: BasePlayer local0

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (l0)Assembly-CSharp.dll

Injection point 2

Rust.opj (Oxide)
void ConVar.Debugging.invis(ConsoleSystem.Arg)

Passes: —

WorksReturnBehavior: CustomAssembly-CSharp.dll

Where it is called (this branch's game code)

// …
	BasePlayer.invisPlayers.Add(basePlayer);
	basePlayer.DisablePlayerCollider();
	SimpleAIMemory.AddIgnorePlayer(basePlayer);
	BaseEntity.Query.Server.RemovePlayer(basePlayer);
}
else if (!flag && basePlayer.isInvisible)
{
	basePlayer.isInvisible = false;
	object result = Interface.CallHook("OnPlayerUnvanished");
	// … проверка результата (Modify-хук, см. Rust.opj)
	BasePlayer.invisPlayers.Remove(basePlayer);
	basePlayer.EnablePlayerCollider();
	if (!ServerOcclusion.OcclusionEnabled)
	{
		foreach (Connection subscriber2 in basePlayer.net.group.subscribers)
		{
			BasePlayer player = subscriber2.player as BasePlayer;
// …

Sources: Rust.opj from OxideMod/Oxide.Rust (MIT) and hook metadata of the Carbon documentation (MIT). Method code is decompiled from this branch's server.