Zernichter Posted December 22, 2013 Report Share Posted December 22, 2013 Hey guys, i need to spawn a ammobox with custom loot at my ai base. so it has to refill after every server restart and it should not dissapear. I use Wicked Ai/Missions and some other custom events. (so using the ammobox as a mission would clear it after another mission gets cleared?) Anybody there who can help me ? :) great wishes Florian Zernichter 1 Link to comment Share on other sites More sharing options...
0 gunnar Posted December 22, 2013 Report Share Posted December 22, 2013 Here is an example: save as myLoot.sqf if (isServer) then { _vehicle_999999 = objNull; if (true) then { _this = createVehicle ["TKVehicleBox_EP1", [8000.0,10000.0], [], 0, "CAN_COLLIDE"]; _vehicle_999999 = _this; _this setDir 20; clearWeaponCargoGlobal _this; clearMagazineCargoGlobal _this; _this addWeaponCargoGlobal ["NVGoggles",1]; _this addWeaponCargoGlobal ["MakarovSD",1]; _this addWeaponCargoGlobal ["G36K_camo",1]; _this addMagazineCargoGlobal ["MortarBucket",1]; _this addMagazineCargoGlobal ["PartGeneric",1]; _this addMagazineCargoGlobal ["8Rnd_9x18_MakarovSD",10]; _this addMagazineCargoGlobal ["ItemGoldBar10oz",1]; }; }; add to init.sqf [] ExecVM "myLoot.sqf"; dont forget to edit the spawn location -> 8000.0,10000.0 Link to comment Share on other sites More sharing options...
0 PetuniaEpoch Posted December 23, 2013 Report Share Posted December 23, 2013 Nice :)You could also add that into the server PBO (in a new folder like say '/loot', and call it via the server_functions.sqf file adding:[] execVM "\z\addons\dayz_server\loot\myLoot.sqf"; :)Here is an example: save as myLoot.sqf if (isServer) then { _vehicle_999999 = objNull; if (true) then { _this = createVehicle ["TKVehicleBox_EP1", [8000.0,10000.0], [], 0, "CAN_COLLIDE"]; _vehicle_999999 = _this; _this setDir 20; clearWeaponCargoGlobal _this; clearMagazineCargoGlobal _this; _this addWeaponCargoGlobal ["NVGoggles",1]; _this addWeaponCargoGlobal ["MakarovSD",1]; _this addWeaponCargoGlobal ["G36K_camo",1]; _this addMagazineCargoGlobal ["MortarBucket",1]; _this addMagazineCargoGlobal ["PartGeneric",1]; _this addMagazineCargoGlobal ["8Rnd_9x18_MakarovSD",10]; _this addMagazineCargoGlobal ["ItemGoldBar10oz",1]; }; }; add to init.sqf [] ExecVM "myLoot.sqf"; dont forget to edit the spawn location -> 8000.0,10000.0 Link to comment Share on other sites More sharing options...
0 PetuniaEpoch Posted December 23, 2013 Report Share Posted December 23, 2013 Oh, and also try adding this to the end, to give players 10mins to loot the crate when they get to it, before it vanishes :) waitUntil{{isPlayer _x && _x distance _vehicle_999999 < 10 } count playableunits > 0}; [nil,nil,rTitleText,"You have 10mins to loot crate, then it will vanish! Hurry!!!!", "PLAIN",6] call RE; sleep 300; [nil,nil,rTitleText,"Survivors, 5mins remaining to loot crate!", "PLAIN",6] call RE; sleep 300; deletevehicle _vehicle_999999; sleep 1; [nil,nil,rTitleText,"Crate is GONE! If you didn't loot it all, you're too slow!", "PLAIN",6] call RE; Basically to give this: if (isServer) then { _vehicle_999999 = objNull; if (true) then { _this = createVehicle ["TKVehicleBox_EP1", [8000.0,10000.0], [], 0, "CAN_COLLIDE"]; _vehicle_999999 = _this; _this setDir 20; clearWeaponCargoGlobal _this; clearMagazineCargoGlobal _this; _this addWeaponCargoGlobal ["NVGoggles",1]; _this addWeaponCargoGlobal ["MakarovSD",1]; _this addWeaponCargoGlobal ["G36K_camo",1]; _this addMagazineCargoGlobal ["MortarBucket",1]; _this addMagazineCargoGlobal ["PartGeneric",1]; _this addMagazineCargoGlobal ["8Rnd_9x18_MakarovSD",10]; _this addMagazineCargoGlobal ["ItemGoldBar10oz",1]; }; waitUntil{{isPlayer _x && _x distance _vehicle_999999 < 10 } count playableunits > 0}; [nil,nil,rTitleText,"You have 10mins to loot crate, then it will vanish! Hurry!!!!", "PLAIN",6] call RE; sleep 300; [nil,nil,rTitleText,"Survivors, 5mins remaining to loot crate!", "PLAIN",6] call RE; sleep 300; deletevehicle _vehicle_999999; sleep 1; [nil,nil,rTitleText,"Crate is GONE! If you didn't loot it all, you're too slow!", "PLAIN",6] call RE; }; Only thing I'm not 100% of is deletevehicle _vehicle_999999; - I normally use createvehicle a lil differently, but it should work I think :) Link to comment Share on other sites More sharing options...
0 Zernichter Posted December 23, 2013 Author Report Share Posted December 23, 2013 Thank you really much for all that help :) ill try it later today when im at home :). I wish you a merry christmas :) Greetings from germany Zernichter 1 Link to comment Share on other sites More sharing options...
0 PetuniaEpoch Posted December 23, 2013 Report Share Posted December 23, 2013 Merry Christmas to you too :) (From Bristol, UK!)Thank you really much for all that help :) ill try it later today when im at home :).I wish you a merry christmas :)Greetings from germany Link to comment Share on other sites More sharing options...
0 Mochan Posted January 12, 2014 Report Share Posted January 12, 2014 Are items like toolboxes, crowbar, etools magazines or weapons? Link to comment Share on other sites More sharing options...
0 Mochan Posted January 12, 2014 Report Share Posted January 12, 2014 Here is an example: save as myLoot.sqf if (isServer) then { _vehicle_999999 = objNull; if (true) then { _this = createVehicle ["TKVehicleBox_EP1", [8000.0,10000.0], [], 0, "CAN_COLLIDE"]; _vehicle_999999 = _this; _this setDir 20; clearWeaponCargoGlobal _this; clearMagazineCargoGlobal _this; _this addWeaponCargoGlobal ["NVGoggles",1]; _this addWeaponCargoGlobal ["MakarovSD",1]; _this addWeaponCargoGlobal ["G36K_camo",1]; _this addMagazineCargoGlobal ["MortarBucket",1]; _this addMagazineCargoGlobal ["PartGeneric",1]; _this addMagazineCargoGlobal ["8Rnd_9x18_MakarovSD",10]; _this addMagazineCargoGlobal ["ItemGoldBar10oz",1]; }; }; add to init.sqf [] ExecVM "myLoot.sqf"; dont forget to edit the spawn location -> 8000.0,10000.0 How do you convert the position from a grid ref? Link to comment Share on other sites More sharing options...
0 Richie Posted January 12, 2014 Report Share Posted January 12, 2014 How do you convert the position from a grid ref? Stand in the spot you want the box and grab your location from the database or use the editor :) Link to comment Share on other sites More sharing options...
Question
Zernichter
Hey guys,
i need to spawn a ammobox with custom loot at my ai base. so it has to refill after every server restart and it should not dissapear.
I use Wicked Ai/Missions and some other custom events. (so using the ammobox as a mission would clear it after another mission gets cleared?)
Anybody there who can help me ? :)
great wishes
Florian
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now