Ophelian 10 Posted April 24, 2014 Hi, I googled the heck out of this and just can't figure it out. Everywhere i look its Arma 2 related and i'm not sure to what extent the two are similar. So basically i have 6 ammo boxes (B_supplycrate_F) and add this init code to them (ammo type is trivial in that case): this allowDamage false; clearWeaponCargo this; clearMagazineCargo this; clearItemCargo this; this addMagazineCargoGlobal["RH_30Rnd_556x45_Mk262",250]; this addMagazineCargoGlobal["1Rnd_HE_Grenade_shell",100]; this addMagazineCargoGlobal["AT4_HEAT",7]; this addMagazineCargoGlobal["AT4_HP",7]; this addMagazineCargoGlobal["100Rnd_762_MAG_Belt",30]; this addMagazineCargoGlobal["100_Rnd_762_Mag_Belt_TR",30]; this addMagazineCargoGlobal["100_Rnd_762_Mag_Belt_TR5",30]; this addMagazineCargoGlobal["hlc_100Rnd_762x51_B_M60E4",30]; this addMagazineCargoGlobal["hlc_100Rnd_762x51_T_M60E4",30]; this addMagazineCargoGlobal["hlc_100Rnd_762x51_M_M60E4",30]; this addMagazineCargoGlobal["200Rnd_556_F89_Belt",30]; this addMagazineCargoGlobal["200Rnd_556_F89_Belt_TR",30]; this addMagazineCargoGlobal["200Rnd_556_F89_Belt_TR5",30]; I made one template and copied the others. The problem is this: when i preview the mission in the editor everything works, all the ammo boxes clean themselves and put the right amount of ammunition to the box. But when i upload it to the dedicated server, not only the "clearXXX" commands don't work, but the ammobox has multiplied the ammo (for example, all the LMG ammo spawns 240 mags instead of 30). Is there a difference between "addMagazineCargoGlobal" and "addMagazineCargo" or do i have to add "Global" to the 3 "clearXXX" commands? I'm at a loss here. Am i using the right init commands or these are old ones? I'm missing something and i know its something trivial. Thanks for taking a look at this. Share this post Link to post Share on other sites
Larrow 2820 Posted April 24, 2014 Change the Clear commands to their Global counterpart and wrap the whole thing in a isServer check so only the server is controlling the box's inventory rather than everyone connecting. this allowDamage false; if (isServer) then { clearWeaponCargoGlobal this; clearMagazineCargoGlobal this; clearItemCargoGlobal this; this addMagazineCargoGlobal["RH_30Rnd_556x45_Mk262",250]; this addMagazineCargoGlobal["1Rnd_HE_Grenade_shell",100]; this addMagazineCargoGlobal["AT4_HEAT",7]; this addMagazineCargoGlobal["AT4_HP",7]; this addMagazineCargoGlobal["100Rnd_762_MAG_Belt",30]; this addMagazineCargoGlobal["100_Rnd_762_Mag_Belt_TR",30]; this addMagazineCargoGlobal["100_Rnd_762_Mag_Belt_TR5",30]; this addMagazineCargoGlobal["hlc_100Rnd_762x51_B_M60E4",30]; this addMagazineCargoGlobal["hlc_100Rnd_762x51_T_M60E4",30]; this addMagazineCargoGlobal["hlc_100Rnd_762x51_M_M60E4",30]; this addMagazineCargoGlobal["200Rnd_556_F89_Belt",30]; this addMagazineCargoGlobal["200Rnd_556_F89_Belt_TR",30]; this addMagazineCargoGlobal["200Rnd_556_F89_Belt_TR5",30]; }; Share this post Link to post Share on other sites
davidzi 11 Posted April 24, 2014 (edited) Larrow's solution will work on dedicated server. Edited April 24, 2014 by DavidZi ninja'd Share this post Link to post Share on other sites
Ophelian 10 Posted April 24, 2014 THanks Larrow for the help. Tonight ill add the corrections to my mission. So if i understand, my old code was influenced by the JIP clients, so the new one because it is in a "if" condition with the "isServer" it specifies that it is the server only that will populate the box? I'm a total noob when it comes to this and i'm trying to understand to the best of my knowledge. Thank you very much for the help! Share this post Link to post Share on other sites
zyg0tic 12 Posted March 1, 2015 (edited) Starting new thread to raise my question about side-issue im having with a custom box in MP server. Mod please delete this sorry. Edited March 1, 2015 by zyg0tic Share this post Link to post Share on other sites
DAGGER ARMANET 172 Posted September 11, 2015 * update actually may have solved my issue. User error. Share this post Link to post Share on other sites