works fine with scentists and zombies but players are able to now loot the bradley, no longer locked to highest damage.
Not working with Bradley APC
Did you manage to fix this?
nope still rip, I had to use a paid one that locks the loot to most damage
Yes it doesn't work for heli and bradley for me (unless I use a hacky fix). Also remove fire from crates doesn't seem to work.
TVXtra
nope still rip, I had to use a paid one that locks the loot to most damage
What is the paid one called?
Working fine with NPC and Helicopter, but not working with Bradley.
I looked into code and I saw there are not much difference between Heli and Bradley aproaches. Heli works like it should, so why Bradley isn't?
Maybe we should add a lockInfo.LockTimeout into message in chat when we kill a target, so we could know better where exactly the problem is?
Can someone, please, help to figure this one out?
Any ideas would be appreciated.
I can test really quick if someone want to participate with code suggestions.
Merged post
Ok, so I did some tracing.
When Bradley killed:
Helicopter killed:
entity.net.ID not found in lockInfo, but I can't understand why.
Tracing again:
Merged post
And by the way,
Merged post
*Basic Crate
I looked into code and I saw there are not much difference between Heli and Bradley aproaches. Heli works like it should, so why Bradley isn't?
Maybe we should add a lockInfo.LockTimeout into message in chat when we kill a target, so we could know better where exactly the problem is?
Can someone, please, help to figure this one out?
Any ideas would be appreciated.
I can test really quick if someone want to participate with code suggestions.
Merged post
Ok, so I did some tracing.
private void OnEntityKill(BaseEntity entity)
{
if (!entity.IsValid() || (!damageInfos.ContainsKey(entity.net.ID) && !lockInfos.ContainsKey(entity.net.ID)))
{
return;
}
if (entity is BaseHelicopter || entity is BradleyAPC)
{
damageInfos[entity.net.ID].OnKilled();
var lockInfo = new LockInfo(damageInfos[entity.net.ID], entity is BaseHelicopter ? Instance.config.LockHeliSeconds : Instance.config.LockBradleySeconds);
Puts("damageInfos = " + damageInfos[entity.net.ID].ToString());
Puts("entity is = " + (entity is BaseHelicopter ? Instance.config.LockHeliSeconds : Instance.config.LockBradleySeconds).ToString());When Bradley killed:
[Loot Defender] damageInfos = Oxide.Plugins.LootDefender+DamageInfo
[Loot Defender] entity is = 900Helicopter killed:
[Loot Defender] damageInfos = Oxide.Plugins.LootDefender+DamageInfo
[Loot Defender] entity is = 900Then I added some prints to console to find when someone able to loot Bradley, this block of code is allowing him:
private object CanLootEntity(BasePlayer player, BaseEntity entity)
LockInfo lockInfo;
if (!lockInfos.TryGetValue(entity.net.ID, out lockInfo))
{
Puts("1");
return null;
}entity.net.ID not found in lockInfo, but I can't understand why.
Tracing again:
private void OnEntityKill(BaseEntity entity)
{
if (!entity.IsValid() || (!damageInfos.ContainsKey(entity.net.ID) && !lockInfos.ContainsKey(entity.net.ID)))
{
Puts("OnEntityKill - 1. entity = " + entity.net.ID + " entity.net.ID = " + entity.net.ID);
return;
}
if (entity is BaseHelicopter || entity is BradleyAPC)
{
damageInfos[entity.net.ID].OnKilled();
var lockInfo = new LockInfo(damageInfos[entity.net.ID], entity is BaseHelicopter ? Instance.config.LockHeliSeconds : Instance.config.LockBradleySeconds);
LockInRadius<LootContainer>(entity.transform.position, lockInfo, KillEntitySpawnRadius);
LockInRadius<HelicopterDebris>(entity.transform.position, lockInfo, KillEntitySpawnRadius);
Puts("entity = " + entity);
Puts("entity.net.ID = " + entity.net.ID);
}Killing Heli:
[Loot Defender] entity = patrolhelicopter[1924378]
[Loot Defender] entity.net.ID = 1924378Killing Bradley:
[Loot Defender] entity = bradleyapc[1930190]
[Loot Defender] entity.net.ID = 1930190Now looting.
private object CanLootEntity(BasePlayer player, BaseEntity entity)
{
if (!permission.UserHasPermission(player.UserIDString, permUse) || !entity.IsValid())
{
Puts("player.UserIDString = " + player.UserIDString);
return null;
}
LockInfo lockInfo;
if (!lockInfos.TryGetValue(entity.net.ID, out lockInfo))
{
Puts("WRONG!");
Puts("entity = " + entity.ToString());
Puts("entity.net.ID = " + entity.net.ID.ToString());
return null;
}
if (lockInfo.IsLockOutdated)
{
Puts("lockInfo.IsLockOutdated");
lockInfos.Remove(entity.net.ID);
return null;
}
if (!lockInfo.CanInteract(player.userID))
{
Puts("CORRECT!");
Puts("entity = " + entity.ToString());
Puts("entity.net.ID = " + entity.net.ID.ToString());
SendReply(player, _("CannotLoot", player.UserIDString));
SendReply(player, lockInfo.GetDamageReport(player.UserIDString));
return false;
}
Puts("Nothing worked. entity = " + entity + " entity.net.ID = " + entity.net.ID);
return null;
}Looting Heli crates:
[Loot Defender] Nothing worked. entity = heli_crate[1931333] entity.net.ID = 1931333
[Loot Defender] Nothing worked. entity = heli_crate[1931346] entity.net.ID = 1931346
[Loot Defender] Nothing worked. entity = heli_crate[1931340] entity.net.ID = 1931340Looting Bradley crates
[Loot Defender] WRONG!
[Loot Defender] entity = bradley_crate[1934837]
[Loot Defender] entity.net.ID = 1934837Where should I dig next? xD
Merged post
And by the way,
LockInRadius<LootContainer>(entity.transform.position, lockInfo, KillEntitySpawnRadius);
LockInRadius<HelicopterDebris>(entity.transform.position, lockInfo, KillEntitySpawnRadius);works like it should. There were crate near the place Bradley were killed, and that crate was locked, just like bradley_crate should be...
Merged post
*Basic Crate
6 months and just nothing? No One has no idea how to manage this one out? Pretty strange situation...
Any updates on this plugin? Still not working as far as I can see on my server (same issue with Bradley/Heli)..
Merged post
Event Protector by Orange is a paid alternative in case loot defender is still mia
Merged post
Event Protector by Orange is a paid alternative in case loot defender is still mia
this is working with bradley in have a fix in the lang file eng instead of {
"NoPermission": "You have no permission to use this command",
"DamageReport": "Damage report for {0}",
"CannotLoot": "You cannot loot it, major damage was not from you",
"CannotMine": "You cannot mine it, major damage was not from you",
"Heli": "Patrol helicopter",
"Bradley": "Bradley APC"
}
use this one below
{
"NoPermission": "You have no permission to use this command",
"DamageReport": "Damage report for {0}",
"CannotLoot": "You cannot loot it, major damage was not from you",
"CannotMine": "You cannot mine it, major damage was not from you",
"Heli": "Patrol helicopter",
"Bradley": "BradleyAPC"
}
Merged post
ok got it working once and now its not again
"NoPermission": "You have no permission to use this command",
"DamageReport": "Damage report for {0}",
"CannotLoot": "You cannot loot it, major damage was not from you",
"CannotMine": "You cannot mine it, major damage was not from you",
"Heli": "Patrol helicopter",
"Bradley": "Bradley APC"
}
use this one below
{
"NoPermission": "You have no permission to use this command",
"DamageReport": "Damage report for {0}",
"CannotLoot": "You cannot loot it, major damage was not from you",
"CannotMine": "You cannot mine it, major damage was not from you",
"Heli": "Patrol helicopter",
"Bradley": "BradleyAPC"
}
Merged post
ok got it working once and now its not again