RustTip

OnExcavatorSuppliesRequested

OxideCarbonElectronic

Called when an excavator supplies is requested.

void OnExcavatorSuppliesRequested(ExcavatorSignalComputer excavatorSignalComputer, BasePlayer player, BaseEntity local0)
Works — the game method in this build is the one the hook was written for.

Parameters

excavatorSignalComputer
ExcavatorSignalComputer
player
BasePlayer
local0
BaseEntity

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnExcavatorSuppliesRequested(ExcavatorSignalComputer excavatorSignalComputer, BasePlayer player, BaseEntity local0)
{
    Puts("OnExcavatorSuppliesRequested");
}

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

Injection point

Rust.opj (Oxide)
void ExcavatorSignalComputer.RequestSupplies(BaseEntity.RPCMessage)

Passes: ExcavatorSignalComputer excavatorSignalComputer, BasePlayer player, BaseEntity local0

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

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

// …
if ((bool)baseEntity)
{
	Vector3 position = dropPoints[Random.Range(0, dropPoints.Length)].position;
	Vector3 vector = new Vector3(Random.Range(-3f, 3f), 0f, Random.Range(-3f, 3f));
	baseEntity.SendMessage("InitDropPosition", position + vector, SendMessageOptions.DontRequireReceiver);
	baseEntity.Spawn();
}
chargePower -= GetChargeNeededForSupplies();
Interface.CallHook("OnExcavatorSuppliesRequested", this, rpc.player, baseEntity);
using (FlagsUpdateScope flagsUpdateScope = StartSetFlags(FlagsUpdateMode.Local))
{
	flagsUpdateScope.Set(Flags.Reserved7, b: false);
	flagsUpdateScope.Set(Flags.Reserved9, b: true);
}
Invoke(StopTransmitting, 5f);
numSuppliesCalled++;
SendNetworkUpdate();
// …

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.