RustTip

OnArcadeScoreAdded

OxideCarbonEntity

Called when an arcade score is added.

void OnArcadeScoreAdded(BaseArcadeMachine baseArcadeMachine, BasePlayer player, int score)
Works — the game method in this build is the one the hook was written for.

Parameters

baseArcadeMachine
BaseArcadeMachine
player
BasePlayer
score
int

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnArcadeScoreAdded(BaseArcadeMachine baseArcadeMachine, BasePlayer player, int score)
{
    Puts("OnArcadeScoreAdded");
}

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

Injection point

Rust.opj (Oxide)
void BaseArcadeMachine.AddScore(BasePlayer, int)

Passes: BaseArcadeMachine baseArcadeMachine, BasePlayer player, int score

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this, a0, a1)Assembly-CSharp.dll

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

// …
		scores.Add(scoreEntry);
		scores.Sort((ScoreEntry a, ScoreEntry b) => b.score.CompareTo(a.score));
		if (scores.Count > 5)
		{
			scores.RemoveRange(5, scores.Count - 5);
		}
		SendNetworkUpdate();
	}
Interface.CallHook("OnArcadeScoreAdded", this, player, score);
}

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.