Jump to content

Ammo Crate don't spawn Custom Loot inside


nidico100

Recommended Posts

I added some crates to my map.

The first one works fine it's loaded with ak's and ammo.

	_crate1 = objNull;
		if (true) then
		{
			_this = createVehicle ["SpecialWeaponsBox", [9016.3799, 12927.087, 3.5677726], [], 0, "CAN_COLLIDE"];
			_crate1 = _this;
			clearweaponcargoGlobal _this;
			clearmagazinecargoGlobal _this;
			_this addWeaponCargoGlobal ["AK_74",5];
			_this addWeaponCargoGlobal ["AK_47_M",1];
			_this addWeaponCargoGlobal ["AK_47_S",1];
			_this addmagazineCargoGlobal ["30Rnd_762x39_AK47",10];
			_this addmagazineCargoGlobal ["30Rnd_545x39_AK",25];
			_this setPos [9016.3799, 12927.087, 3.5677726];
		};

but the other 3 don't have loot inside. they spawn empty i wanted them to spawn "ItemKiloHemp" and "ItemZombieParts".

	_crate2 = objNull;
		if (true) then
		{
			_this = createVehicle ["USOrdnanceBox", [9009.8037, 12930.672, 3.6088436], [], 0, "CAN_COLLIDE"];
			_crate2 = _this;
			clearweaponcargoGlobal _this;
			clearmagazinecargoGlobal _this;
			_this addmagazineCargoGlobal [["ItemKiloHemp",50]];
			_this setPos [9009.8037, 12930.672, 3.6088436];
		};		

	_crate3 = objNull;
		if (true) then
		{
			_this = createVehicle ["USOrdnanceBox",[9013.2539, 12930.277, 0.34331667], [], 0, "CAN_COLLIDE"];
			_crate3 = _this;
			clearweaponcargoGlobal _this;
			clearmagazinecargoGlobal _this;
			_this addmagazineCargoGlobal [["ItemZombieParts",12]];
			_this setPos [9013.2539, 12930.277, 0.34331667];
		};

	_crate4 = objNull;
		if (true) then
		{
			_this = createVehicle ["USOrdnanceBox",[9027.3027, 12928.585, 0.02336337], [], 0, "CAN_COLLIDE"];
			_crate4 = _this;
			clearweaponcargoGlobal _this;
			clearmagazinecargoGlobal _this;
			_this addmagazineCargoGlobal [["ItemKiloHemp",7]];
			_this setPos [9027.3027, 12928.585, 0.02336337];
		};

 

Link to comment
Share on other sites

  • 7 months later...
  On 8/31/2016 at 12:24 PM, Hooty said:

Is this how you would change the loot from arma editor default? 

 

Expand  

to change the default loot first use

clearWeaponCargoGlobal and clearMagazineCargoGlobal   (this gonna delete all default loot)

Then you need fill the crate again with your loot using:

addWeaponCargoGlobal and addmagazinecargoglobal so an example:

  Reveal hidden contents

 

Link to comment
Share on other sites

So i would take this

  Reveal hidden contents

and change it to this

  Reveal hidden contents

Just change the items to my liking? Do I need to remove the permaloot?

Link to comment
Share on other sites

@Hootyno, permaloot its fine, prevent crate despawn along time. but take a look here, you have a bad name in crates:

_crate1 = objNull;

                    _vehicle_213 = objNull;

this must be:

  _vehicle_213 = objNull;

   if (true) then
                   {               

 

so for your example:

  Reveal hidden contents

..or you can use a more advanced way , see:

  Reveal hidden contents

 

Link to comment
Share on other sites

Thank you very much works Great!!! I have the advanced set up for my missions just could not figure out how to make custom crates with the editor. Working on a weaponstash.sqf  since i had to do away with my ai island to increase fps.

Thanks again!

 

P.s

If i leave out the clear section will it just add weapons to the box?

clearweaponcargoGlobal _this;
			clearmagazinecargoGlobal _this;
Link to comment
Share on other sites

@Hooty ..."If i leave out the clear section will it just add weapons to the box?"...

sory cant understand your question so well. You asking me if u not use the  clearWeapons and clearmagazine the crate spawn with default loot?  if is it, yes.

Crate gonna fill and use the standar loot from arma2oa editor.

Link to comment
Share on other sites

Also you can leave the job to the server creating a small function trough time.

customcrate.sqf  ( put into mpmissions\yourinstance\customcrates\ )

  Reveal hidden contents

*Now go to your init.sqf and into 

if (isServer) then {  section ,

bellow:   _serverMonitor =     [] execVM "\z\addons\dayz_server\system\server_monitor.sqf"; 

paste:

  _customcrate = [] execVM "customcrates\customcrate.sqf";

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...