Sorry if this has been posted before but I've not been able to find exactly what I mean (maybe I'm just being a noob, not maybe, I am being a noob)
I've got a script running that defines the array "weapon" as a random selection of weapons.
gun = ["srifle_EBR_DMS_F","srifle_GM6_LRPS_F"," srifle_LRR_LRPS_F","LMG_Mk200_MRCO_F"] call BIS_fnc_selectRandom;
This is defined in my Init.sqf
I've then added a crate and given it the variable name CASE1. The next line in the init is this:
CASE1 addWeaponCargo [gun,1];
This spawns one of weapons defined by gun at random.
What I want to be able to do is add something to the effect the code below into the init file of the actual case, instead of having to name all of my cases and load it from the init.sqf.
this addWeaponCargo [gun,1];
Additionally I'd like to run the command a few times without just pasting it on 3 lines for example. I tried the forEach command but I'm puzzled by it.
Please excuse me as I imagine this is an extremely easy thing to do, just v new to this :D
Thanks in advance!