Plugin need update.
Plugin don't workError
Howdy, can you please provide more information as to what is and is not working?
August
Howdy, can you please provide more information as to what is and is not working?
"UnlockHelicopterGibs": true
But gibs are hot, and are not mined until they cool down. Everything worked before the update.
August
Howdy, can you please provide more information as to what is and is not working?
It's been 5 months. The plugin won't be fixed?
Is August gone forever?
Same issue. I believe the plugin is broken. It definitely used to work, and it definitely has not worked in several months.
The GPT chat suggested what needs to be fixed, it seems to be working as it should now.
using System.Collections.Generic;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("Instant Heli Loot", "August", "1.0.4")]
[Description("Makes Heli (and Bradley) Gibs lootable/harvestable immediately after being destroyed.")]
class InstantHeliLoot : CovalencePlugin
{
private const float GIB_CHECK_DELAY = 0.5f;
private const float GIB_CHECK_RADIUS = 30f;
protected override void LoadDefaultConfig()
{
Config["UnlockBradleyCrates"] = true;
Config["UnlockHelicopterCrates"] = true;
Config["UnlockHelicopterGibs"] = true;
Config["RemoveFireballs"] = true;
Config["GibCoolDownDelay"] = 0.5f;
Config["GibCheckRadius"] = 30f;
}
private void Init()
{
if (!(bool)Config["UnlockBradleyCrates"] && !(bool)Config["UnlockHelicopterCrates"])
{
Unsubscribe(nameof(OnEntityDeath));
}
}
private void OnServerShutdown() => SaveConfig();
private void UnlockCrates(Vector3 pos)
{
List<LockedByEntCrate> crates = new List<LockedByEntCrate>();
Vis.Entities(pos, 20f, crates);
foreach (var crate in crates)
{
crate.SetLocked(false);
}
}
private void KillFire(Vector3 pos)
{
List<FireBall> fireBalls = new List<FireBall>();
Vis.Entities(pos, 20f, fireBalls);
if (fireBalls.Count > 0)
{
foreach (FireBall fb in fireBalls)
{
fb.Kill();
}
}
}
private void CoolDownGibs(Vector3 position)
{
if (!(bool)Config["UnlockHelicopterGibs"]) return;
float delay = Config["GibCoolDownDelay"] != null ? (float)Config["GibCoolDownDelay"] : GIB_CHECK_DELAY;
float radius = Config["GibCheckRadius"] != null ? (float)Config["GibCheckRadius"] : GIB_CHECK_RADIUS;
timer.Once(delay, () =>
{
List<HelicopterDebris> debrisList = new List<HelicopterDebris>();
Vis.Entities(position, radius, debrisList);
foreach (var debris in debrisList)
{
if (debris == null || debris.IsDestroyed) continue;
debris.tooHotUntil = -1f;
}
});
}
private void OnEntityDeath(BradleyAPC apc, HitInfo info)
{
var pos = apc.transform.position;
if ((bool)Config["UnlockBradleyCrates"])
{
NextTick(() => UnlockCrates(pos));
}
if ((bool)Config["RemoveFireballs"])
{
NextTick(() => { KillFire(pos); });
}
}
private void OnEntityDeath(BaseHelicopter heli, HitInfo info)
{
var pos = heli.transform.position;
if ((bool)Config["UnlockHelicopterCrates"])
{
NextTick(() => UnlockCrates(pos));
}
if ((bool)Config["RemoveFireballs"])
{
NextTick(() => { KillFire(pos); });
}
CoolDownGibs(pos);
}
private void OnEntitySpawned(HelicopterDebris debris)
{
if (!(bool)Config["UnlockHelicopterGibs"]) return;
float delay = Config["GibCoolDownDelay"] != null ? (float)Config["GibCoolDownDelay"] : GIB_CHECK_DELAY;
timer.Once(delay, () =>
{
if (debris == null || debris.IsDestroyed) return;
debris.tooHotUntil = -1f;
});
}
}
}