Ammo Crates Fix

in your init.sgf
dayz_antihack = 0; // DayZ Antihack / 1 = enabled // 0 = disabled
dayz_REsec = 0; // DayZ RE Security / 1 = enabled // 0 = disabled
make sure you have set this to 0,
and if you need live help join my teamspeak,tsgb1.vilayer.com:10024 and i can try help you that way mate

Those are both turned off.
 
i dont think the 1.8.5 resec or antihack would affect the crates although they should be disabled anyways. the code looks to deal only with plants and points of interest.

check your work and make sure you repacked your dayz_server.pbo so changes are active.

i had thought before that it might be something else if it actually does take 30+ minutes for them to be deleted. infistar is usually instantaneous and the cleanup scripts run every 5 minutes or so.

why dont you post an rpt log?
 
I added you to skype but no friends request was accepted. I am still having this issue.. Add me on skype cikez0781. Thanks.
 
I am still having this issue with 1.8.6.1. It worked just fine with prior versions. The issue is I cannot find the code that is making them disappear. It seemed like in earlier version the code was in server_monitor or server_cleanup. With the way they have changed and added the new sched_* files I figured it would be in there somewhere. Any help would be much appreciated!

Any
 
yes it will, you just don't understand how to do it.


Watch in server-monitor for your item to come across, make sure it allows it to be spawned, and then set the variable from there.
 
What do you mean by look in server-monitor for it to come across? So I guess I didnt know this but you are saying that you can set a "permaloot" variable to an item that is in the database and not spawned via SQF?
 
You haven't taken the time to search for that variable. When you search the dayz pbo's for it and still don't understand, then i'll be happy to help you.
 
I have taken the time to search for it but I thought that variable could only be set on items that are spawned with SQF and NOT through object_data in SQL.

I see this in spawncarepackages file: _lootVeh setVariable ["permaLoot", true];

But like I said above.. How do you set a variable to an item that is not being spawned via SQF?
 
You don't the way you are asking.

You could go into the server_monitor and check to see if the item being spawned in is the type of item you are looking for and add the variable. You have to mess with the server_monitor in most cases to get it to load a custom object anyhow.
 
in your server file that streams in all the database objects the classname is passed to the code. Compare the streamed classname with your classname and if true, set the variable.

Here is the Dayz server monitor. Look at line 154, it has created the streamed item and now it checks for if its a trap item and does specific code. https://github.com/DayZMod/DayZ/blo...491/SQF/dayz_server/system/server_monitor.sqf
Do something with your crate like that.
Code:
//Create it
_object = createVehicle [_type, _pos, [], 0, if (_type in DayZ_nonCollide) then {"NONE"} else {"CAN_COLLIDE"}];
// prevent immediate hive write when vehicle parts are set up
_object setVariable ["lastUpdate",diag_ticktime];
_object setVariable ["ObjectID", _idKey, true];
dayz_serverIDMonitor set [count dayz_serverIDMonitor,_idKey];
_object setVariable ["CharacterID", _ownerID, true];
_object setdir _dir;
_object setDamage _damage;
if (!_wsDone) then {
[_object,"position",true] call server_updateObject;
};
if (_type == "Base_Fire_DZ") then { _object spawn base_fireMonitor; };
//Dont add inventory for traps.
if (!(_object isKindOf "TrapItems") And !(_object iskindof "DZ_buildables")) then {
_cargo = _inventory;
clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;
clearBackpackCargoGlobal _object;
_config = ["CfgWeapons", "CfgMagazines",
 
in your server file that streams in all the database objects the classname is passed to the code. Compare the streamed classname with your classname and if true, set the variable.

Here is the Dayz server monitor. Look at line 154, it has created the streamed item and now it checks for if its a trap item and does specific code. https://github.com/DayZMod/DayZ/blo...491/SQF/dayz_server/system/server_monitor.sqf
Do something with your crate like that.
Code:
//Create it
_object = createVehicle [_type, _pos, [], 0, if (_type in DayZ_nonCollide) then {"NONE"} else {"CAN_COLLIDE"}];
// prevent immediate hive write when vehicle parts are set up
_object setVariable ["lastUpdate",diag_ticktime];
_object setVariable ["ObjectID", _idKey, true];
dayz_serverIDMonitor set [count dayz_serverIDMonitor,_idKey];
_object setVariable ["CharacterID", _ownerID, true];
_object setdir _dir;
_object setDamage _damage;
if (!_wsDone) then {
[_object,"position",true] call server_updateObject;
};
if (_type == "Base_Fire_DZ") then { _object spawn base_fireMonitor; };
//Dont add inventory for traps.
if (!(_object isKindOf "TrapItems") And !(_object iskindof "DZ_buildables")) then {
_cargo = _inventory;
clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;
clearBackpackCargoGlobal _object;
_config = ["CfgWeapons", "CfgMagazines",

Ahhh, makes sense now.. So something like this should work in server_monitor.sqf:

Code:
        //If class is AmmoBoxBig set permaloot to true
        if (_type == "AmmoBoxBig") then { _object setVariable ["permaLoot", true]; };
 
.... EDIT ... OKAY. i see the code has _type already defined as the classname so your code is correct. I had made a post using "typeof _object " logic but thats not needed. again,
 
OK no problem. Thanks a lot for your help. I have applied this code to my server... We will see if everything goes as planned. Thanks again man!
 
It seems to be helping a lot but some of the crates still are disappearing.. Would having a "banned" or "invalid" weapon in the crate cause it to disappear? I noticed that a few of them had a KSVK and AS50 in them which is now banned in Vanilla. This could be what is causing the others to disappear.

Thanks again for your help. Much appreciated.
 
Back
Top