RustTip

OnStashExposed

OxideCarbonEntity

Called when a stash is exposed.

void OnStashExposed(StashContainer entity, BasePlayer basePlayer)
Works — the game method in this build is the one the hook was written for.

Parameters

entity
StashContainer
basePlayer
BasePlayer

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnStashExposed(StashContainer entity, BasePlayer basePlayer)
{
    Puts("OnStashExposed");
}

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

Injection point

Rust.opj (Oxide)
void BasePlayer.CheckStashRevealInvoke()

Passes: StashContainer entity, BasePlayer basePlayer

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (l1.Entity, this)Assembly-CSharp.dll

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

private void CheckStashRevealInvoke()
{
	Interface.CallHook("OnStashExposed", nearbyStash.Entity, this);
	for (int i = 0; i < nearbyStashes.Count; i++)
	{
		NearbyStash nearbyStash = nearbyStashes[i];
		if (nearbyStash.Entity == null || nearbyStash.Entity.IsDestroyed)
		{
			nearbyStashes.RemoveAt(i);
		}
		else if (nearbyStash.Entity.IsHidden() && nearbyStash.Entity.PlayerInRange(this))
// …

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.