Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You need to make the changes mentioned in server_cleanup.fsm
See:
http://opendayz.net/threads/deployable-ammo-crates-and-1-7-7.11197/page-3#post-56220
Once you do that all crates will spawn and work. If you want to get them saving gear as deployables to the database you will also have to do the other fixes mentioned on the first page.
You need to make the changes mentioned in server_cleanup.fsm
See:
http://opendayz.net/threads/deployable-ammo-crates-and-1-7-7.11197/page-3#post-56220
Once you do that all crates will spawn and work. If you want to get them saving gear as deployables to the database you will also have to do the other fixes mentioned on the first page.
_ammoBox setVariable ["KrixKeep",true,true];
"{" \n
" _keep = _x getVariable [""permaLoot"",false];" \n
" _nearby = {isPlayer _x} count (_x nearEntities [[""CAManBase""], 250]);" \n
"" \n
"{" \n
" _keep = _x getVariable [""permaLoot"",false];" \n
" _krixKeep = _x getVariable [""KrixKeep"",false];" \n
" _nearby = {isPlayer _x} count (_x nearEntities [[""CAManBase""], 250]);" \n
"" \n
" if ( (!_keep) && (_nearby==0) && (_age > 60) ) then {" \n
" if ( (!_keep) && (_nearby==0) && (_age > 60) && (!_krixKeep) ) then {" \n
if (!isServer) exitWith {};
_boxPos = [4223.48,8392.66,0];
_ammoBoxModel = "USVehicleBox_EP1";
_ammoBox = createVehicle [_ammoBoxModel, _boxPos, [], 0, "CAN_COLLIDE"];
_ammoBox setDir 0.0;
_ammoBox setPos _boxPos;
_ammoBox setVariable ["KrixKeep",true,true];
You make _ammoBox equal your created object....
You need to make an .sqf run on just the server from your mission file to create the box...
The .sqf would look like this....
Code:if (!isServer) exitWith {}; _boxPos = [4223.48,8392.66,0]; _ammoBoxModel = "USVehicleBox_EP1"; _ammoBox = createVehicle [_ammoBoxModel, _boxPos, [], 0, "CAN_COLLIDE"]; _ammoBox setDir 0.0; _ammoBox setPos _boxPos; _ammoBox setVariable ["KrixKeep",true,true];
This code is ran from your mission pbo most likely inside your init.sqf not from your server pbo...![]()
how would you change its content, EDIT: does not work
clearMagazineCargoGlobal _ammoBox;
clearWeaponCargoGlobal _ammoBox;
_ammoBox addWeaponCargoGlobal ["M16A2", 5]; // What you want and how many you want.
_ammoBox addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 50]; // Same here as above but with ammo.
It does work. I am currently using it. Where did you put the code in the code block above?
To change stuff inside you first clear it....
Code:clearMagazineCargoGlobal _ammoBox; clearWeaponCargoGlobal _ammoBox;
Then you add what you want....
Code:_ammoBox addWeaponCargoGlobal ["M16A2", 5]; // What you want and how many you want. _ammoBox addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 50]; // Same here as above but with ammo.
What errors are you getting in your RPT?
//box attributes
_boxPos = [8108,9149,0];
_ammoBoxModel = "USBasicAmmunitionBox";
//Spawning the box
_ammoBox = createVehicle [_ammoBoxModel, _boxPos, [], 0, "CAN_COLLIDE"];
_ammoBox setDir 0.0;
_ammoBox setPos _boxPos;
//clear and add items
clearMagazineCargoGlobal _ammoBox;
clearWeaponCargoGlobal _ammoBox;
_ammoBox addWeaponCargoGlobal ["M16A2", 1]; // What you want and how many you want.
_ammoBox addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 2]; // Same here as above but with ammo.
//set variable
_ammoBox setVariable ["KrixKeep",true,true];
12.07.2013 21:25:47: GhostPhantom (184.158.59.75:3291) 141f03c043662bac888d873c31d39115 - #0 [COLOR=#ff0000]"krixkeep"[/COLOR] = true 3:0 USBasicAmmunitionBox
!="krixkeep"
//Ammo box spawn script by ghostphantom172
//Currently working on 1.7.7.1
//---------------------The CODE---------------------
//Box Models
_ammoBoxModel1 = "USBasicAmmunitionBox";
_ammoBoxModel2 = "GuerillaCacheBox";
//Box chances and types choice
_boxtype = [["_ammoBoxmodel1"], ["_ammoBoxModel2"]]; //can not be changed
_boxchance = [0.05, 0.05]; //50 50 chance
_boxspawn = [_boxtype,_boxchance]
//-------Box 1 Information example--------
//Box 1 attributes
//box attributes
_boxPos1 = [8108,9149,0]; //Change postion of ammo box one
//Ammo box 1 spawning
//Spawning the box
_ammoBox1 = createVehicle [_boxspawn, _boxPos1, [], 0, "CAN_COLLIDE"];
_ammoBox1 setDir 0.0;
_ammoBox1 setPos _boxPos1;
//Box model Contents
//clear items
clearMagazineCargoGlobal _boxspawn;
clearWeaponCargoGlobal _boxspawn;
//add items
_boxspawn addWeaponCargoGlobal ["M16A2", 1]; // What you want and how many you want.
_boxspawn addMagazineCargoGlobal ["30Rnd_556x45_Stanag", 2]; // Same here as above but with ammo.
//set variable
_ammoBox1 setVariable ["KrixKeep",true,true]; //set If you want it to keep it or not
do i ma
first do i make and sqf or paste it right in the init.sqf also shouldn't it be inside the brackets of the if statement to work?
Yes, you would make a new .sqf for spawning the boxes and then inside your init.sqf you would execute the file. You want it only executed server side though not on each client.
I was trying not to hi-jack this thread is why I kept it brief.![]()
"//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
_ammoBox setVariable ["KrixKeep",true,true];