OnPlayerRespawned
OxideCarbonPlayerCalled when a player is respawned.
void OnPlayerRespawned(BasePlayer basePlayer)Works — the game method in this build is the one the hook was written for.
Parameters
- basePlayer
- BasePlayer
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnPlayerRespawned(BasePlayer basePlayer)
{
Puts("OnPlayerRespawned");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
void BasePlayer.RespawnAt(Vector3, Quaternion, BaseEntity)
Passes: BasePlayer basePlayer
WorksReturnBehavior: ContinueArgumentBehavior: JustThisAssembly-CSharp.dll
Where it is called (this branch's game code)
// …
if ((bool)activeGameMode)
{
BaseGameMode.GetActiveGameMode(serverside: true).OnPlayerRespawn(this);
}
if (IsConnected)
{
EACServer.OnStartLoading(net.connection);
}
Interface.CallHook("OnPlayerRespawned", this);
ProcessMissionEvent(BaseMission.MissionEventType.RESPAWN, 0, 0f);
PlayerInjureState = GetInjureState();
}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.