Weapon (30)

All currently available hooks that are found in Carbon. Most hooks would be ones compatible with Oxide, although there are Carbon-only ones as well.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseHelicopter.IsValidHomingTarget of Assembly-CSharp.dll.

Example
object CanBeHomingTargeted(BaseHelicopter self)
{
    Puts("CanBeHomingTargeted was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CH47Helicopter.IsValidHomingTarget of Assembly-CSharp.dll.

Example
object CanBeHomingTargeted(CH47Helicopter self)
{
    Puts("CanBeHomingTargeted was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerHelicopter.IsValidHomingTarget of Assembly-CSharp.dll.

Example
object CanBeHomingTargeted(PlayerHelicopter self)
{
    Puts("CanBeHomingTargeted was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PatrolHelicopter.IsValidHomingTarget of Assembly-CSharp.dll.

Example
object CanBeHomingTargeted(PatrolHelicopter self)
{
    Puts("CanBeHomingTargeted was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches AttackHeliPilotFlare.IsValidHomingTarget of Assembly-CSharp.dll.

Example
object CanBeHomingTargeted(AttackHeliPilotFlare self)
{
    Puts("CanBeHomingTargeted was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches RoadFlare.IsValidHomingTarget of Assembly-CSharp.dll.

Example
object CanBeHomingTargeted(RoadFlare self)
{
    Puts("CanBeHomingTargeted was called!");
    return (bool) null;
}
  • Called when the item creates a projectile in the world.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.CreateWorldProjectile of Assembly-CSharp.dll.

Example
object CanCreateWorldProjectile(HitInfo info, ItemDefinition itemDef)
{
    Puts("CanCreateWorldProjectile was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches LiquidWeapon.CanFire of Assembly-CSharp.dll.

Example
object CanFireLiquidWeapon(BasePlayer player, LiquidWeapon self)
{
    Puts("CanFireLiquidWeapon was called!");
    return (bool) null;
}
  • Called when the player starts to switch the ammo in a weapon.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseProjectile.SwitchAmmoTo of Assembly-CSharp.dll.

Example
object OnAmmoSwitch(BaseProjectile self, BasePlayer local0, ItemDefinition local2)
{
    Puts("OnAmmoSwitch was called!");
    return (object) null;
}
  • Called when a player is trying to unload ammo.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseProjectile.UnloadAmmo of Assembly-CSharp.dll.

Example
object OnAmmoUnload(BaseProjectile local0, Item item, BasePlayer player)
{
    Puts("OnAmmoUnload was called!");
    return (object) null;
}
  • Called when the player drops an explosive item (C4, grenade, ...).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ThrownWeapon.DoDrop of Assembly-CSharp.dll.

Example
void OnExplosiveDropped(BasePlayer player, BaseEntity local2, ThrownWeapon self)
{
    Puts("OnExplosiveDropped was called!");
}
  • Called when explosive tries to become dud.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches DudTimedExplosive.Explode of Assembly-CSharp.dll.

Example
object OnExplosiveDud()
{
    Puts("OnExplosiveDud was called!");
    return (object) null;
}
  • Called when a fuse of an explosive is set.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches TimedExplosive.SetFuse of Assembly-CSharp.dll.

Example
void OnExplosiveFuseSet(TimedExplosive self, float fuseLength)
{
    Puts("OnExplosiveFuseSet was called!");
}
  • Called when the player throws an explosive item (C4, grenade, ...).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ThrownWeapon.DoThrow of Assembly-CSharp.dll.

Example
void OnExplosiveThrown(BasePlayer player, BaseEntity local3, ThrownWeapon self)
{
    Puts("OnExplosiveThrown was called!");
}
  • Called when a fire ball does damage to another entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches FireBall.DoRadialDamage of Assembly-CSharp.dll.

Example
void OnFireBallDamage(FireBall self, BaseCombatEntity local4, HitInfo local2)
{
    Puts("OnFireBallDamage was called!");
}
  • Called when a fire ball fire spreads.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches FireBall.TryToSpread of Assembly-CSharp.dll.

Example
void OnFireBallSpread(FireBall self, BaseEntity local1)
{
    Puts("OnFireBallSpread was called!");
}
  • Called when a flame explodes.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches FlameExplosive.FlameExplode of Assembly-CSharp.dll.

Example
void OnFlameExplosion(FlameExplosive self, UnityEngine.Collider local1)
{
    Puts("OnFlameExplosion was called!");
}
  • Called when the burn from a flame thrower spreads.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches FlameThrower.FlameTick of Assembly-CSharp.dll.

Example
void OnFlameThrowerBurn(FlameThrower self, BaseEntity local11)
{
    Puts("OnFlameThrowerBurn was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches server.ImpactEffect of Assembly-CSharp.dll.

Example
object OnImpactEffectCreate(HitInfo info)
{
    Puts("OnImpactEffectCreate was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches LiquidWeapon.StartFiring of Assembly-CSharp.dll.

Example
void OnLiquidWeaponFired(LiquidWeapon self, BasePlayer local0)
{
    Puts("OnLiquidWeaponFired was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches LiquidWeapon.StopFiring of Assembly-CSharp.dll.

Example
void OnLiquidWeaponFiringStopped(LiquidWeapon self)
{
    Puts("OnLiquidWeaponFiringStopped was called!");
}
  • Called when the player reloads a magazine.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseProjectile.TryReloadMagazine of Assembly-CSharp.dll.

Example
object OnMagazineReload(BaseProjectile self, IAmmoContainer ammoSource, BaseProjectile self1)
{
    Puts("OnMagazineReload was called!");
    return (bool) null;
}
  • Called when the player throws a melee item (axe, rock, ...).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMelee.CLProject of Assembly-CSharp.dll.

Example
void OnMeleeThrown(BasePlayer local0, Item local1)
{
    Puts("OnMeleeThrown was called!");
}
  • Called when a player's weapon projectile ricochets.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.OnProjectileRicochet of Assembly-CSharp.dll.

Example
object OnProjectileRicochet(BasePlayer self, ProtoBuf.PlayerProjectileRicochet local0)
{
    Puts("OnProjectileRicochet was called!");
    return (object) null;
}
  • Called when the player launches a rocket.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseLauncher.SV_Launch of Assembly-CSharp.dll.

Example
void OnRocketLaunched(BasePlayer local0, BaseEntity local8)
{
    Puts("OnRocketLaunched was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches TimedExplosive.Explode of Assembly-CSharp.dll.

Example
object OnTimedExplosiveExplode(TimedExplosive self)
{
    Puts("OnTimedExplosiveExplode was called!");
    return (object) null;
}
  • Called when the player fires a weapon.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseProjectile.CLProject of Assembly-CSharp.dll.

Example
void OnWeaponFired(BaseProjectile self, BasePlayer player, ItemModProjectile local3, ProtoBuf.ProjectileShoot local2)
{
    Puts("OnWeaponFired was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseProjectile.DelayedModsChanged of Assembly-CSharp.dll.

Example
object OnWeaponModChange(BaseProjectile self, BaseProjectile self1)
{
    Puts("OnWeaponModChange was called!");
    return (object) null;
}
  • Called when the player reloads a weapon.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseProjectile.StartReload of Assembly-CSharp.dll.

Example
object OnWeaponReload(BaseProjectile self, BasePlayer local0)
{
    Puts("OnWeaponReload was called!");
    return (object) null;
}
  • Called when a projectile is created.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.CreateWorldProjectile of Assembly-CSharp.dll.

Example
object OnWorldProjectileCreate(HitInfo info, Item local1)
{
    Puts("OnWorldProjectileCreate was called!");
    return (object) null;
}

This hook requires CanCreateWorldProjectile, which loads alongside OnWorldProjectileCreate.

Last updated