OnLiquidWeaponFired
OxideCarbonWeaponCalled when a liquid weapon is fired.
void OnLiquidWeaponFired(LiquidWeapon liquidWeapon, BasePlayer local0)Method changed — check — the game method differs from the one the hook is recorded for in Oxide. The hook is still called, but its place may have shifted — worth checking after an update.
Parameters
- liquidWeapon
- LiquidWeapon
- local0
- BasePlayer
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnLiquidWeaponFired(LiquidWeapon liquidWeapon, BasePlayer local0)
{
Puts("OnLiquidWeaponFired");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
void LiquidWeapon.StartFiring(BaseEntity.RPCMessage)
Passes: LiquidWeapon liquidWeapon, BasePlayer local0
Method changed — checkReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this, l0)Assembly-CSharp.dll
Where it is called (this branch's game code)
// …
{
CancelInvoke(FireTick);
InvokeRepeating(FireTick, 0f, FireRate);
using (FlagsUpdateScope flagsUpdateScope = StartSetFlags(FlagsUpdateMode.SendNetworkUpdate))
{
flagsUpdateScope.Set(Flags.On, b: true);
flagsUpdateScope.Set(Flags.Reserved1, GetContents().info.baseRadioactivity > 0f);
}
Interface.CallHook("OnLiquidWeaponFired", this, player);
StartCooldown(FireRate);
if (isServer)
{
SendNetworkUpdateImmediate();
}
}
}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.