I allso have exact same problem af people here: https://umod.org/community/raid-alarm/23596-not-working-when-someone-destroys-walls-or-anything
Plugin works with test and all, but simply does not send anything when something in a base is destroyed. Sad because its a brilliant idea for not allways getting offlined.
Not workingSolved
I'll take a second look
I am no expert on coding, but tryed to find the error, maybe it helps you. Read the commets after the printwarnings :
var buildingPrivilege = entity.GetBuildingPrivilege();
PrintWarning(buildingPrivilege +" - OnEntityDeath is running"); // returns the same if im auth on tc and if im NOT auth on tc.
if (buildingPrivilege == null || buildingPrivilege.authorizedPlayers.IsEmpty()) return;
PrintWarning(buildingPrivilege +" - OnEntityDeath is running"); // warning prints only if im auth on tc and something is destroyed.
var victims = new List<ulong>(buildingPrivilege.authorizedPlayers.Count);
foreach (PlayerNameID victim in buildingPrivilege.authorizedPlayers)
{
if (victim == null) continue;
if (config.usePermissions && !permission.UserHasPermission(victim.userid.ToString(), PERMISSION)) return;
if (victim.userid == info.InitiatorPlayer.userID) return;
if (disabled.Contains(victim.userid)) continue;
victims.Add(victim.userid);
}
PrintWarning(buildingPrivilege +" - OnEntityDeath is running"); // Does never print this warning
Merged post
well im stuck i cant get this foreach to run and i cant figure out why...
foreach (PlayerNameID victim in buildingPrivilege.authorizedPlayers){
I've been playing on a server for almost a year now that uses this plugin. It barely works half the time and the Owner of the server said that if its a multi TC base that is what breaks the plugin. I hope this helps because I hate doing electrical smart alarms.
flosstradamusI've been playing on a server for almost a year now that uses this plugin. It barely works half the time and the Owner of the server said that if its a multi TC base that is what breaks the plugin. I hope this helps because I hate doing electrical smart alarms.
Most definitely! I'll probably get some time tomorrow.
ya i figured out that this is the problem. It cant cycle auth players at TC
foreach (PlayerNameID victim in buildingPrivilege.authorizedPlayers)
{
if (victim == null) continue;
if (config.usePermissions && !permission.UserHasPermission(victim.userid.ToString(), PERMISSION)) return;
if (victim.userid == info.InitiatorPlayer.userID) return;
if (disabled.Contains(victim.userid)) continue;
victims.Add(victim.userid);
}
I'm assuming these servers used the permissions setting. Fixed a bug where victims could be skipped resulting in no message.
Thanks !