Ammo Crates Fix

if you,had a script that added that variable to all objects of your crate class, then they would all either stay put or be deleted. if you are only losing some, then there is another factor.
are you SURE they are all being spawned to begin with? add a diag_log line to your code to output to the log when and where each is spawned, or perhaps create a map marker.
 
then if they are spawned and then actually being deleted then its a cleanup script. there are a handful of sched****** files that cleanup dead bodies etc. every few minutes ... the 'permaloot' variable is one of the checks to prevent these from being deleted, perhaps there is another check taking place.
here is the search results for 'delete', see if any of those hits might be your issue.
https://github.com/DayZMod/DayZ/search?utf8=✓&q=delete
 
Its the only check. I've already set something up on my server for this version. He just needs to do that and everything will be fine.
 
Hmm I have this:

if (_type == "AmmoBoxBig") then { _object setVariable ["permaLoot", true]; };

Right below this:

if (_type == "Base_Fire_DZ") then { _object spawn base_fireMonitor; };

In server_monitor.sqf

For some reason they still seem to disappear randomly. Am I missing something?

In the database i also have a character ID of a created character assigned to the ammoboxes. I also want to clarify when this happens they just disappear. They are not actually removed in the database.

Thanks.
 
Last edited:
Hey sorry I have been very busy. I just got some intel from a donator.. He said:

"After a restart the crate is usually there for about 15 mins or so then disappears. However, if a restart happens and I'm not at the house, once i return the crate is there for about 15 mins as well. It seems it "spawns" like other items in the house when we get close then after a few mins it goes away."

Hopefully this helps with troubleshooting. If you still need to see my files let me know which ones. Thanks.
 
If it spawns and disappears after some time then it must be getting deleted by a cleanup script.
Lets see the servers RPT log and lets see the file where you set the "permaloot" variable.
 
I looked through the github code quickly and your files. I see no reason why it wouldnt be working. Sounds like they are inside of a building, have you tried to put one outside a building to see if it stays? How about if you restart the server and stand there and watch them, do they delete if a player is nearby? (no idea if either of those thoughts has any merit, just thoughts). Have you disabled Infistar?
 
I have not tried putting them outside of a building or disabling Infistar.

It seems like from what I have seen if a player is nearby they do not disappear but I could be wrong. I will try disabling infistar to see if that fixes it. Thanks.
 
Back
Top