AmmoBox wont stay

bajaboy1972

Well-Known Member
Can anybody tell me why these boxes are only on the map maybe 50 percent of the time....when they are there they are full and functional.

Code below is within the mission.sqm folder and server is 1.7.7.1 Cherno.

Code:
class Item14
        {
            position[]={1193.2314,347.93768,10042.21};
            id=115;
            side="EMPTY";
            vehicle="AmmoBoxBig";
            skill=0.60000002;
            init="null0 = this execVM ""adminsupplies.sqf""";


But the other 50 percent of the time they are not there.
 
Check my example here...

No need to add an additional variable when there's one already there...

http://opendayz.net/threads/ammo-box-script-work-in-progress.12039/

I guess to further expand and to keep people from commenting out things ment to help..
You could do this aswell...

Add this
Code:
"    _keep = _x getVariable [""permaLoot"",false];" \n

To this
Code:
"Check for Ammobox" \n
" {" \n
"if(!(_x isKindOf ""WeaponHolder"")) then {" \n
"diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n
"deleteVehicle _x;" \n
"};" \n
"} forEach allMissionObjects ""ReammoBox"";" \n
"*/" \n
"" \n

Like this
Code:
"Check for Ammobox" \n
" {" \n
"_keep = _x getVariable [""permaLoot"",false];" \n
"if(!(_x isKindOf ""WeaponHolder"")) then {" \n
"diag_log (""CLEANUP: DELETING AN AMMOBOX "" + (typeOf _x));" \n
"deleteVehicle _x;" \n
"};" \n
"} forEach allMissionObjects ""ReammoBox"";" \n
"*/" \n
"" \n

And change this line
Code:
"if(!(_x isKindOf ""WeaponHolder"")) then {" \n

To look like this
Code:
"if(!(_x isKindOf ""WeaponHolder"") && (!_keep)) then {" \n

And then if you absolutely had to add the box via mission.sqf add this
Code:
this setVariable ["permaLoot",true,true];

To your init inside your mission object.

The Global variable "permaLoot", from what I can tell, was put in to keep the loot piles around heli crashes from dissapearing once they spawned because they spawned during the heli crash site spawn and did not have a respawn for obvious reasons. We can use this variable for our "Loot Boxes" and not have to comment out or make another variable. This way we can tell the server WHICH boxes we wish to keep and the rest, spawned in by "other" means, will still get deleted as they should... Hope this helps...
 
Hello all, how can this be made to work with version 1.8? The deleting the ammo box portion is not included in any of the 1.8 files.
 
Back
Top