Oxide.Rust
Oxide.Rust copied to clipboard
Add OnNearbyTurretsScan hook
object OnNearbyTurretsScan(AutoTurret turret, List<AutoTurret> nearbyTurrets, bool created)
{
LogWarning($"OnNearbyTurretsScan works!");
return null;
}
- Called when an auto turret spawns or despawns, in order to determine which turrets are nearby
- Returning non-null will cancel the default Vis.Entities call, allowing for an alternative searching implementation
- The list that will be populated with the Vis.Entities call is passed to the hook, so plugins can simply use a
void
return type and add additional turrets that may not be found by the Vis.Entities call, such as turrets that don't have a collider on the Deployed layer (e.g., for Car Turrets or Drone Turrets) - Works similar to the
OnSamSiteTargetScan
hook