Is this box spawn going to work?
Just wondering if this little crate spawn script I'm trying to write will work.
If its not can yall give me some advice on why it wont? If Im right this should give me 50 of each of those items.
Code:
hint "Spawning Crate";
titleText ["USBasicWeapons_EP1 filled with guns and ammo spawned!", "PLAIN DOWN"]; titlefadeout 2;
_pos = [((getPosATL player) select 0) + 3, ((getPosATL player) select 1) + 3, (getPosATL player) select 2];
//call compile (""lolcrate = 'USBasicWeapons_EP1' creat""+""eVehicle %1;"");
call compile format ["[0, nil, [0, %1], '%2'] call ssppwwnnn;", _pos, 'USBasicWeapons_EP1'];
lolcrate = _pos nearestObject 'USBasicWeapons_EP1z';
sleep 5;
_crate2 = "if (isServer) then
{
call compile (""{lolcrate addWea""+""ponCargoGlobal [_x, 50];} forEach
['M4A1_AIM_SD_camo','BAF_AS50_scoped','DMR','M9SD','M40A3','Binocular_Vector',
'NVGoggles','ItemGPS','ItemKnife','ItemHatchet','ItemMatchbox','ItemToolbox',
'ItemWaterbottle','FoodSteakCooked','ItemBandage','ItemPainkiller','ItemMorphine',
'ItemAntibiotic','ItemBloodbag','Skin_Camo1_DZ','Skin_Sniper1_DZ','PartWheel',
'PartFueltank','PartGlass','PartEngine','PartGeneric','PartVRotor','ItemJerrycan',
'ItemTent','Skin_Camo1_DZ','Skin_Sniper1_DZ','DZ_Backpack_EP1'];"");
};";
[_crate2] execVM "scr\exec.sqf";
sleep 5;
_crate3 = "if (isServer) then
{
call compile (""{lolcrate addMagazi""+""neCargoGlobal [_x, 50];} forEach
[30Rnd_556x45_StanagSD','20Rnd_762x51_DMR','15Rnd_9x19_M9SD',
'10Rnd_127x99_m107','PipeBomb'];"");
};";
[_crate3] execVM "scr\exec.sqf";
sleep 5;
_crate4 = "if (isServer) then
{
call compile (""lolcrate addBackpa""+""ckCargoGlobal ['DZ_Backpack_EP1', 25];"");
};";
[_crate4] execVM "scr\exec.sqf";