RustTip

OnExplosiveDropped

OxideCarbonWeapon

Called when an explosive is dropped.

void OnExplosiveDropped(BasePlayer player, BaseEntity local3, ThrownWeapon thrownWeapon)
Works — the game method in this build is the one the hook was written for.

Parameters

player
BasePlayer
local3
BaseEntity
thrownWeapon
ThrownWeapon

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnExplosiveDropped(BasePlayer player, BaseEntity local3, ThrownWeapon thrownWeapon)
{
    Puts("OnExplosiveDropped");
}

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

Injection point

Rust.opj (Oxide)
void ThrownWeapon.DoDrop(BaseEntity.RPCMessage)

Passes: BasePlayer player, BaseEntity local3, ThrownWeapon thrownWeapon

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

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

// …
	{
		baseEntity.SetVelocity(normalized);
	}
	baseEntity.creatorEntity = msg.player;
	baseEntity.skinID = skinID;
	SpawnThrownEntity(baseEntity, msg.player, throwID);
	SetUpThrownWeapon(baseEntity, GetOwnerItem());
	StartAttackCooldown(repeatDelay);
	Interface.CallHook("OnExplosiveDropped", msg.player, baseEntity, this);
	UseItemAmount(1);
}

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.