RustTip

OnPlayerReported

OxideCarbonPlayer

Called when a player is reported.

void OnPlayerReported(BasePlayer local1, string local6, string targetId, string local2, string local3, string local5)
Works — the game method in this build is the one the hook was written for.

Parameters

local1
BasePlayer
local6
string
targetId
string
local2
string
local3
string
local5
string

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnPlayerReported(BasePlayer local1, string local6, string targetId, string local2, string local3, string local5)
{
    Puts("OnPlayerReported");
}

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

Injection point

Rust.opj (Oxide)
void BasePlayer.<OnPlayerReported>d__778.MoveNext()

Passes: BasePlayer local1, string local6, string targetId, string local2, string local3, string local5

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (l1, l6, this.<targetId>5__2, l2, l3, l5)Assembly-CSharp.dll

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

// …
	PlayerId = basePlayer.UserIDString,
	PlayerName = basePlayer.displayName,
	TargetId = <targetId>5__2,
	TargetName = text4,
	Subject = text,
	Message = message,
	Type = text3
});
Interface.CallHook("OnPlayerReported", basePlayer, text4, this.<targetId>5__2, text, text2, text3);
if (string.IsNullOrEmpty(Server.reportsServerEndpoint))
{
	goto IL_0203;
}
ReportType type = ReportType.Abuse;
if (text3.Equals("cheat"))
{
	type = ReportType.Cheat;
// …

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.