RustTip

OnClanCreated

OxideCarbonClan

Called when a clan is created.

void OnClanCreated(LocalClan clan, ulong leaderSteamId)
Works — the game method in this build is the one the hook was written for.

Parameters

clan
LocalClan
leaderSteamId
ulong

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnClanCreated(LocalClan clan, ulong leaderSteamId)
{
    Puts("OnClanCreated");
}

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

Injection point

Rust.opj (Oxide)
void LocalClanBackend.<Create>d__11.MoveNext()

Passes: LocalClan clan, ulong leaderSteamId

WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (l3, this.leaderSteamId)Rust.Clans.Local.dll

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

// …
	IL_022c:
	if (!localClanBackend.TryGetClan(clanId, out var clan))
	{
		throw new Exception("Couldn't find the clan we just created?");
	}
	localClanBackend.MembershipChanged(leaderSteamId, clan.ClanId);
	result = clan;
	end_IL_0007:;
Interface.CallHook("OnClanCreated", clan, this.leaderSteamId);
}
catch (Exception exception)
{
	<>1__state = -2;
	<>t__builder.SetException(exception);
	return;
}
<>1__state = -2;
// …

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.