RustTip

OnEntityMounted

OxideCarbonPlayer

Called to validate a player's dismount position before exiting a mount or vehicle.

void OnEntityMounted(BaseMountable baseMountable, BasePlayer player)
Works — the game method in this build is the one the hook was written for.

Parameters

baseMountable
BaseMountable
player
BasePlayer

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnEntityMounted(BaseMountable baseMountable, BasePlayer player)
{
    Puts("OnEntityMounted");
}

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

Injection point

Rust.opj (Oxide)
void BaseMountable.MountPlayer(BasePlayer)

Passes: BaseMountable baseMountable, BasePlayer player

WorksReturnBehavior: ContinueArgumentBehavior: AllAssembly-CSharp.dll

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

// …
}
player.OverrideViewAngles(transform.rotation.eulerAngles);
_mounted.eyes.NetworkUpdate(transform.rotation);
player.SendNetworkUpdateImmediate();
Analytics.Azure.OnMountEntity(player, this, VehicleParent());
OnPlayerMounted();
if (allowedGestures == MountGestureType.None && player.InGesture)
{
	Interface.CallHook("OnEntityMounted", this, player);
	player.Server_CancelGesture();
}
else if (allowedGestures == MountGestureType.UpperBody && player.InGesture && player.CurrentGestureIsFullBody)
{
	player.Server_CancelGesture();
}
if (this.IsValid() && player.IsValid())
{
// …

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.