Devastator_cm 434 Posted September 5, 2016 Hi Guys, I have a problem with the ammo boxes in my dedicated server mission. I deleted the content of the box with I have following code in the init of the ammo box clearWeaponCargoGlobal this; clearMagazineCargoGlobal this; clearItemCargoGlobal this; this addmagazinecargoGlobal ["TMT_15Rnd_9x19_M92_M", 10]; this addmagazinecargoGlobal ["TMT_17Rnd_9x19_Glock17_M", 10]; problem is, only the first person who joins to server can take those magazines. People who joined later on can see them but can"t move them to his/her inventory... Any idea what can be the issue??I used ACE3 default supply box for the model Share this post Link to post Share on other sites
D. James 0 Posted September 5, 2016 ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal; I just use virtual arsenals. I always find stuff like that is buggy and i can never get it to work Share this post Link to post Share on other sites
Devastator_cm 434 Posted September 5, 2016 but I need a pre-setup for ammo box. I don't want the players to choose what ever they want.. Share this post Link to post Share on other sites
Tajin 349 Posted September 6, 2016 Change to this: if (isServer) then { clearWeaponCargoGlobal this; clearMagazineCargoGlobal this; clearItemCargoGlobal this; this addmagazinecargoGlobal ["TMT_15Rnd_9x19_M92_M", 10]; this addmagazinecargoGlobal ["TMT_17Rnd_9x19_Glock17_M", 10]; }; Also, use the editing/scripting subforum for questions like that. https://forums.bistudio.com/forum/154-arma-3-mission-editing-scripting/ Share this post Link to post Share on other sites
Devastator_cm 434 Posted September 6, 2016 Danke TajinI will take a look if it will fix my problem Share this post Link to post Share on other sites
Devastator_cm 434 Posted September 6, 2016 Do I need to use if (isServer) then for all kind of object inits?For example I adjust the uniform and so on with commands in object init but I didnt use if (isServer) there Share this post Link to post Share on other sites
Tajin 349 Posted September 7, 2016 Check the wiki for the locality of the commands you are using.: https://community.bistudio.com/wiki/Category:Commands_by_effects_and_arguments_locality (look for the little icons that show argument- and effect-locality) clearWeaponCargoGlobal is a command that is transmitted to all clients anyway so its important that it only gets called once or it it can lead to unexpected results. clearWeaponCargo in the contrary has only a local effect, so you'd have to run this on every client that should be affected Share this post Link to post Share on other sites
Devastator_cm 434 Posted September 7, 2016 thanks again!Your answers are really helpful Share this post Link to post Share on other sites
Imperator[TFD] 444 Posted September 9, 2016 Is this box pre-placed in the editor or are you spawning it in via script later on? If it's pre placed just use the Equipment Storage functionality found in the Object Attributes of an object. Share this post Link to post Share on other sites
Devastator_cm 434 Posted September 10, 2016 it is preplaced. Tajin's advise with server check worked. I will try also your suggestion and will report back Share this post Link to post Share on other sites
Imperator[TFD] 444 Posted September 10, 2016 it is preplaced. Tajin's advise with server check worked. I will try also your suggestion and will report back Just like using the arsenal to equip a soldier, using the Equipment Storage part of an objects attributes is JIP friendly and works in a dedi environment. Share this post Link to post Share on other sites