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 BaseHelicopter )
{
    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 CH47Helicopter )
{
    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 PlayerHelicopter )
{
    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 PatrolHelicopter )
{
    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 AttackHeliPilotFlare )
{
    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 RoadFlare )
{
    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 HitInfo , ItemDefinition ItemDefinition )
{
    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 BasePlayer , LiquidWeapon LiquidWeapon )
{
    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 BaseProjectile , BasePlayer BasePlayer , ItemDefinition ItemDefinition )
{
    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 BaseProjectile , Item Item , BasePlayer BasePlayer )
{
    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 BasePlayer , BaseEntity BaseEntity , ThrownWeapon ThrownWeapon )
{
    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
void OnExplosiveDud()
{
    Puts("OnExplosiveDud was called!");
}
  • 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 TimedExplosive , float Single )
{
    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 BasePlayer , BaseEntity BaseEntity , ThrownWeapon ThrownWeapon )
{
    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 FireBall , BaseCombatEntity BaseCombatEntity , HitInfo HitInfo )
{
    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 FireBall , BaseEntity BaseEntity )
{
    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 FlameExplosive , UnityEngine.Collider Collider )
{
    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 FlameThrower , BaseEntity BaseEntity )
{
    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 HitInfo )
{
    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 LiquidWeapon , BasePlayer BasePlayer )
{
    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 LiquidWeapon )
{
    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 BaseProjectile , IAmmoContainer IAmmoContainer , BaseProjectile BaseProjectile )
{
    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 BasePlayer , Item Item )
{
    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 BasePlayer , ProtoBuf.PlayerProjectileRicochet PlayerProjectileRicochet )
{
    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 BasePlayer , BaseEntity BaseEntity )
{
    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 TimedExplosive )
{
    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 BaseProjectile , BasePlayer BasePlayer , ItemModProjectile ItemModProjectile , ProtoBuf.ProjectileShoot ProjectileShoot )
{
    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 BaseProjectile , BaseProjectile BaseProjectile )
{
    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 BaseProjectile , BasePlayer BasePlayer )
{
    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 HitInfo , Item Item )
{
    Puts("OnWorldProjectileCreate was called!");
    return (object) null;
}

This hook requires CanCreateWorldProjectile, which loads alongside OnWorldProjectileCreate.

Last updated