Jump to content
Sign in to follow this  
ChadWicky

Randomized weapons in weapon holder script

Recommended Posts

I am looking for a script that places a completely random weapon and its ammo somewhere. I've already found weapon holder scripts, but I would like them to be completely random. I don't mind placing the Game Logics in the map. I just want the script to randomly choose one of any of the weapons in the game and in any mods I have, like ACE. If you could give the stuff to put into the Logic initialization and the script file I would be greatly appreciative. If you have played Dynamic Zombie Sandbox I would like a weapon spawn system like that, but the weapon's don't have to spawn in buildings or vehicles.

Share this post


Link to post
Share on other sites

I'm assuming you aren't totally lazy and searched or at least skimmed the forums enough to have found this other nearly identical thread, right?

So what you're really asking is "how do i select any weapon randomly?"

You could just use something like Ghost's config script to read the config and select a weapon from that list. The problem with this is that you'll run into a case where one player might have different weapon mods than the other so some players will be running around holding but shooting no weapon.

The other option is to hard code weapons in an array and use them in the previously listed script. A lot more typing, but safer. :)

Share this post


Link to post
Share on other sites

I just spent all day doing something similar. I was using a simple script earlier, but now i've managed to get buildings to spawn stuff.

If you put these in your missions folder and put them in something's init you can effectively make random loot zones. Just set the placement radius to randomize position. You will almost certainly want to modify them, not all the weapons are there and some that you might not have may be in there. To use these just place down a game logic or something else invisible and set it's placement radius to whatever you want, then just put call{[this] execvm "insertscriptnamehere.sqf}; in the init box.

This one will spawn random weapons:

waituntil {!isnil "bis_fnc_init"};
_log = _this select 0;
_weapons = ["ACE_M249_AIM","ACE_M249_PIP_ACOG","ACE_MG36","ACE_MG36_D","ACE_RPK","ACE_RPK74M","ACE_RPK74M_1P29","ACE_RPG22","ACE_RPG27","ACE_RPG29","ACE_RPG7V_PGO7","MAAWS","ACE_M72","SMAW","ACE_BAF_L7A2_GPMG","ACE_M240B","ACE_M240L","ACE_M240L_M145","ACE_M60","Pecheneg","ACE_APS","ACE_APSB","ACE_Flaregun","ACE_Glock18","ACE_P226","ACE_USP","ACE_USPSD","Colt1911","glock17_EP1","M9","M9SD","revolver_EP1","Sa61_EP1","UZI_EP1","UZI_SD_EP1","AA12_PMC","ACE_AK103","ACE_AK103_1P29","ACE_AK103_GL","ACE_AK103_GL_1P29","ACE_AK103_GL_Kobra","ACE_AK103_GL_PSO","ACE_AK103_Kobra","ACE_AK103_PSO","ACE_AK104","ACE_AK104_1P29","ACE_AK104_Kobra","ACE_AK104_PSO","ACE_AK105","ACE_AK105_1P29","ACE_AK105_Kobra","ACE_AK105_PSO","ACE_AK74M","ACE_AK74M_1P29","ACE_AK74M_1P78","ACE_AK74M_1P78_FL","ACE_AK74M_1P78_FL_F","ACE_AK74M_FL","ACE_AK74M_FL_F","ACE_AK74M_GL","ACE_AK74M_GL_1P29","ACE_AK74M_GL_1P78","ACE_AK74M_GL_Kobra","ACE_AK74M_GL_NSPU","ACE_AK74M_GL_PSO","ACE_AK74M_GL_TWS","ACE_AK74M_Kobra","ACE_AK74M_Kobra_FL","ACE_AK74M_Kobra_FL_F","ACE_AK74M_NSPU","ACE_AK74M_NSPU_FL","ACE_AK74M_NSPU_FL_F","ACE_AK74M_PSO","ACE_AK74M_PSO_FL","ACE_AK74M_PSO_FL_F","ACE_AK74M_SD","ACE_AK74M_SD_1P78","ACE_AK74M_SD_Kobra","ACE_AK74M_SD_PSO","ACE_AK74M_SD_TWS","ACE_AKM","ACE_AKM_GL","ACE_AKS74_GP25","ACE_AKS74_UN","ACE_AKS74P_1P29","ACE_G36A1_AG36_UP_F","ACE_G36A1_AG36A1","ACE_G36A2_AG36A2_F","ACE_G36A2_AG36A2_UP","ACE_G36A2_Bipod","ACE_G36A2_D","ACE_G36K_EOTech_D","ACE_G3A3","ACE_G3A3_RSAS","ACE_G3SG1","ACE_gr1","ACE_gr1sd","ACE_gr1sp","ACE_HK416_D10","ACE_HK416_D10_AIM","ACE_HK416_D10_COMPM3","ACE_HK416_D10_COMPM3_SD","ACE_HK416_D10_Holo","ACE_HK416_D10_M320","ACE_HK416_D14","ACE_HK416_D14_COMPM3","ACE_HK416_D14_TWS","ACE_KAC_PDW","ACE_M1014_Eotech","ACE_M14_ACOG","ACE_m16a2_scope","ACE_m16a2gl_scope","ACE_m16a2gl_scope_UP","ACE_M16A2GL_UP","ACE_M16A4_ACG_GL_UP","ACE_M16A4_CCO_GL","ACE_M16A4_CCO_GL_UP","ACE_M16A4_EOT","ACE_M16A4_EOT_GL","ACE_M16A4_EOT_GL_UP","ACE_M16A4_Iron","ACE_M27_IAR","ACE_M27_IAR_ACOG","ACE_M27_IAR_CCO","ACE_M4","ACE_M4_ACOG","ACE_M4_ACOG_F","ACE_M4_ACOG_PVS14","ACE_M4_Aim","ACE_M4_AIM_GL","ACE_M4_AIM_GL_UP","ACE_M4_Eotech","ACE_M4_Eotech_GL","ACE_M4_Eotech_GL_UP_F","ACE_M4_RCO_GL_F","ACE_M4A1_ACOG_F","ACE_M4A1_ACOG_PVS14_F","ACE_M4A1_C","ACE_M4SPR_SD","ACE_Mk12mod1","ACE_MP5A4","ACE_MP5A5","ACE_MP5SD","ACE_SOC_M4A1_TWS","ACE_SPAS12","ACE_UMP45","ACE_UMP45_AIM_SD","AK_107_GL_kobra","AK_107_GL_pso","AK_107_kobra","AK_47_M","AK_74","AKS_74_kobra","AKS_74_pso","AKS_74_U","BAF_L85A2_RIS_ACOG","BAF_L85A2_RIS_SUSAT","BAF_L85A2_UGL_ACOG","BAF_L86A2_ACOG","bizon","bizon_silenced","FN_FAL","FN_FAL_ANPVS4","G36K","LeeEnfield","M1014","M4SPR","m8_carbine","m8_carbineGL","m8_compact","m8_sharpshooter","m8_tws","m8_tws_sd","Sa58P_EP1","Sa58V_CCO_EP1","Sa58V_RCO_EP1","Saiga12K","SCAR_H_CQC_CCO","SCAR_H_CQC_CCO_SD","SCAR_H_LNG_Sniper","SCAR_H_LNG_Sniper_SD","SCAR_H_STD_TWS_SD","SCAR_L_CQC_CCO_SD","SCAR_L_STD_EGLM_TWS","SCAR_L_STD_Mk4CQT","SCAR_L_STD_HOLO","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC","ACE_Rucksack_MOLLE_Green","ACE_AS50","ACE_M109","ACE_M110","ACE_M110_SD","ACE_TAC50","ACE_TAC50_SD","BAF_AS50_TWS","BAF_LRR_scoped","DMR","huntingrifle","ksvk","m107","m107_TWS_EP1","M110_NVG_EP1","M110_TWS_EP1","M24","M40A3","PMC_AS50_TWS","SVD","SVD_des_EP1","ACE_VTAC_RUSH72"];


_pos = getpos _log;
_cache = "WeaponHolder" createVehicle _pos;

if (random 100 > 0) then {

	_weapon = _weapons call BIS_fnc_SelectRandom;
	_cache addWeaponCargo [_weapon,1];
	_mag=(getArray (configFile/"Cfgweapons"/_weapon/"magazines")) select 0;
       	_cache addMagazineCargo [_mag,round (random 5)];

} 
else {};

This one will spawn some items:

waituntil {!isnil "bis_fnc_init"};
_log = _this select 0;
_pos = getpos _log;
_cache = "WeaponHolder" createVehicle _pos;
_items = ["ItemMap","ItemWatch","ItemCompass","ItemGPS","NVGoggles","Binocular","ACE_MX2A","ACE_YardAge450","Binocular_Vector","Laserdesignator","ACE_MugLite","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC","ACE_Rucksack_MOLLE_Green","ACE_DAGR","ACE_Earplugs","ACE_GlassesBalaklava","ACE_GlassesBalaklavaGray","ACE_GlassesBalaklavaOlive","ACE_GlassesBlackSun","ACE_GlassesBlueSun","ACE_GlassesGasMask_US","ACE_GlassesGreenSun","ACE_GlassesLHD_glasses","ACE_GlassesRedSun","ACE_GlassesSunglasses","ACE_GlassesTactical","ACE_HuntIR_monitor","ACE_Kestrel4500","ACE_Map","ACE_Map_Tools","ACE_SpottingScope","ACE_WireCutter","ACE_Knicklicht_Proxy","ACE_MugLite","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC"];
if (random 100 > 60) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};
if (random 100 > 70) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};
if (random 100 > 80) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};
if (random 100 > 80) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};
if (random 100 > 90) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};

This one will spawn different items(specifically things that need to be added with addmagazinecargo):

waituntil {!isnil "bis_fnc_init"};
_log = _this select 0;
_pos = getpos _log;
_cache = "WeaponHolder" createVehicle _pos;
_magazines = ["ACE_ANM14","ACE_Bandage","ACE_C4_M","ACE_Knicklicht_B","ACE_Knicklicht_G","ACE_Knicklicht_R","ACE_Knicklicht_Y","ACE_Knicklicht_W","ACE_LargeBandage","ACE_DM25","ACE_DM31","ACE_DM31_M","ACE_DM32","ACE_DM33","ACE_DM34","ACE_DM36","ACE_DM51","ACE_DM51A1","ACE_Epinephrine","ACE_M84","ACE_HuntIR_M203","PMC_ied_v1","BAF_ied_v2","BAF_ied_v3","ACE_BBETTY_M","ACE_CLAYMORE_M","ACE_M34","ACE_TRIPFLARE_M","HandGrenade_West","ACE_M7A3","ACE_M86PDM","ACE_Medkit","ACE_MON50_M","ACE_Morphine","ACE_OSM4_M","ACE_RDGM","ACE_RG60A","HandGrenade_East","PipeBomb","SmokeShell","SmokeShellBlue","SmokeShellGreen","SmokeShellRed","ACE_TORCH_C","ACE_Knicklicht_B","ACE_Knicklicht_G","ACE_Knicklicht_R","ACE_Knicklicht_Y","ACE_Knicklicht_W"];
if (random 100 > 70) 

then {_cache addMagazineCargo [[] call BIS_fnc_SelectRandom,round (random 6)]} 
else {};
if (random 100 > 90) 

then {_cache addMagazineCargo [[] call BIS_fnc_SelectRandom,round (random 3)]} 
else {};

This is the one i'm currently using to add loot to buildings, I've pieced it together from http://forums.bistudio.com/archive/index.php/t-102796.html and https://dev-heaven.net/issues/32590 so i can't take any credit.

//////////////////////////////////BUILDING LOOT//////////////////////////////////////

_weapons = ["ACE_M249_AIM","ACE_M249_PIP_ACOG","ACE_MG36","ACE_MG36_D","ACE_RPK","ACE_RPK74M","ACE_RPK74M_1P29","ACE_RPG22","ACE_RPG27","ACE_RPG29","ACE_RPG7V_PGO7","MAAWS","ACE_M72","SMAW","ACE_BAF_L7A2_GPMG","ACE_M240B","ACE_M240L","ACE_M240L_M145","ACE_M60","Pecheneg","ACE_APS","ACE_APSB","ACE_Flaregun","ACE_Glock18","ACE_P226","ACE_USP","ACE_USPSD","Colt1911","glock17_EP1","M9","M9SD","revolver_EP1","Sa61_EP1","UZI_EP1","UZI_SD_EP1","AA12_PMC","ACE_AK103","ACE_AK103_1P29","ACE_AK103_GL","ACE_AK103_GL_1P29","ACE_AK103_GL_Kobra","ACE_AK103_GL_PSO","ACE_AK103_Kobra","ACE_AK103_PSO","ACE_AK104","ACE_AK104_1P29","ACE_AK104_Kobra","ACE_AK104_PSO","ACE_AK105","ACE_AK105_1P29","ACE_AK105_Kobra","ACE_AK105_PSO","ACE_AK74M","ACE_AK74M_1P29","ACE_AK74M_1P78","ACE_AK74M_1P78_FL","ACE_AK74M_1P78_FL_F","ACE_AK74M_FL","ACE_AK74M_FL_F","ACE_AK74M_GL","ACE_AK74M_GL_1P29","ACE_AK74M_GL_1P78","ACE_AK74M_GL_Kobra","ACE_AK74M_GL_NSPU","ACE_AK74M_GL_PSO","ACE_AK74M_GL_TWS","ACE_AK74M_Kobra","ACE_AK74M_Kobra_FL","ACE_AK74M_Kobra_FL_F","ACE_AK74M_NSPU","ACE_AK74M_NSPU_FL","ACE_AK74M_NSPU_FL_F","ACE_AK74M_PSO","ACE_AK74M_PSO_FL","ACE_AK74M_PSO_FL_F","ACE_AK74M_SD","ACE_AK74M_SD_1P78","ACE_AK74M_SD_Kobra","ACE_AK74M_SD_PSO","ACE_AK74M_SD_TWS","ACE_AKM","ACE_AKM_GL","ACE_AKS74_GP25","ACE_AKS74_UN","ACE_AKS74P_1P29","ACE_G36A1_AG36_UP_F","ACE_G36A1_AG36A1","ACE_G36A2_AG36A2_F","ACE_G36A2_AG36A2_UP","ACE_G36A2_Bipod","ACE_G36A2_D","ACE_G36K_EOTech_D","ACE_G3A3","ACE_G3A3_RSAS","ACE_G3SG1","ACE_gr1","ACE_gr1sd","ACE_gr1sp","ACE_HK416_D10","ACE_HK416_D10_AIM","ACE_HK416_D10_COMPM3","ACE_HK416_D10_COMPM3_SD","ACE_HK416_D10_Holo","ACE_HK416_D10_M320","ACE_HK416_D14","ACE_HK416_D14_COMPM3","ACE_HK416_D14_TWS","ACE_KAC_PDW","ACE_M1014_Eotech","ACE_M14_ACOG","ACE_m16a2_scope","ACE_m16a2gl_scope","ACE_m16a2gl_scope_UP","ACE_M16A2GL_UP","ACE_M16A4_ACG_GL_UP","ACE_M16A4_CCO_GL","ACE_M16A4_CCO_GL_UP","ACE_M16A4_EOT","ACE_M16A4_EOT_GL","ACE_M16A4_EOT_GL_UP","ACE_M16A4_Iron","ACE_M27_IAR","ACE_M27_IAR_ACOG","ACE_M27_IAR_CCO","ACE_M4","ACE_M4_ACOG","ACE_M4_ACOG_F","ACE_M4_ACOG_PVS14","ACE_M4_Aim","ACE_M4_AIM_GL","ACE_M4_AIM_GL_UP","ACE_M4_Eotech","ACE_M4_Eotech_GL","ACE_M4_Eotech_GL_UP_F","ACE_M4_RCO_GL_F","ACE_M4A1_ACOG_F","ACE_M4A1_ACOG_PVS14_F","ACE_M4A1_C","ACE_M4SPR_SD","ACE_Mk12mod1","ACE_MP5A4","ACE_MP5A5","ACE_MP5SD","ACE_SOC_M4A1_TWS","ACE_SPAS12","ACE_UMP45","ACE_UMP45_AIM_SD","AK_107_GL_kobra","AK_107_GL_pso","AK_107_kobra","AK_47_M","AK_74","AKS_74_kobra","AKS_74_pso","AKS_74_U","BAF_L85A2_RIS_ACOG","BAF_L85A2_RIS_SUSAT","BAF_L85A2_UGL_ACOG","BAF_L86A2_ACOG","bizon","bizon_silenced","FN_FAL","FN_FAL_ANPVS4","G36K","LeeEnfield","M1014","M4SPR","m8_carbine","m8_carbineGL","m8_compact","m8_sharpshooter","m8_tws","m8_tws_sd","Sa58P_EP1","Sa58V_CCO_EP1","Sa58V_RCO_EP1","Saiga12K","SCAR_H_CQC_CCO","SCAR_H_CQC_CCO_SD","SCAR_H_LNG_Sniper","SCAR_H_LNG_Sniper_SD","SCAR_H_STD_TWS_SD","SCAR_L_CQC_CCO_SD","SCAR_L_STD_EGLM_TWS","SCAR_L_STD_Mk4CQT","SCAR_L_STD_HOLO","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC","ACE_Rucksack_MOLLE_Green","ACE_AS50","ACE_M109","ACE_M110","ACE_M110_SD","ACE_TAC50","ACE_TAC50_SD","BAF_AS50_TWS","BAF_LRR_scoped","DMR","huntingrifle","ksvk","m107","m107_TWS_EP1","M110_NVG_EP1","M110_TWS_EP1","M24","M40A3","PMC_AS50_TWS","SVD","SVD_des_EP1","ACE_VTAC_RUSH72"];

_items = ["ItemMap","ItemWatch","ItemCompass","ItemGPS","NVGoggles","Binocular","ACE_MX2A","ACE_YardAge450","Binocular_Vector","Laserdesignator","ACE_MugLite","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC","ACE_Rucksack_MOLLE_Green","ACE_DAGR","ACE_Earplugs","ACE_GlassesBalaklava","ACE_GlassesBalaklavaGray","ACE_GlassesBalaklavaOlive","ACE_GlassesBlackSun","ACE_GlassesBlueSun","ACE_GlassesGasMask_US","ACE_GlassesGreenSun","ACE_GlassesLHD_glasses","ACE_GlassesRedSun","ACE_GlassesSunglasses","ACE_GlassesTactical","ACE_HuntIR_monitor","ACE_Kestrel4500","ACE_Map","ACE_Map_Tools","ACE_SpottingScope","ACE_WireCutter","ACE_Knicklicht_Proxy","ACE_MugLite","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC"];

_magazines = ["ACE_ANM14","ACE_Bandage","ACE_C4_M","ACE_Knicklicht_B","ACE_Knicklicht_G","ACE_Knicklicht_R","ACE_Knicklicht_Y","ACE_Knicklicht_W","ACE_LargeBandage","ACE_DM25","ACE_DM31","ACE_DM31_M","ACE_DM32","ACE_DM33","ACE_DM34","ACE_DM36","ACE_DM51","ACE_DM51A1","ACE_Epinephrine","ACE_M84","ACE_HuntIR_M203","PMC_ied_v1","BAF_ied_v2","BAF_ied_v3","ACE_BBETTY_M","ACE_CLAYMORE_M","ACE_M34","ACE_TRIPFLARE_M","HandGrenade_West","ACE_M7A3","ACE_M86PDM","ACE_Medkit","ACE_MON50_M","ACE_Morphine","ACE_OSM4_M","ACE_RDGM","ACE_RG60A","HandGrenade_East","PipeBomb","SmokeShell","SmokeShellBlue","SmokeShellGreen","SmokeShellRed","ACE_TORCH_C","ACE_Knicklicht_B","ACE_Knicklicht_G","ACE_Knicklicht_R","ACE_Knicklicht_Y","ACE_Knicklicht_W"];
hint "placing loot";
_buildings = nearestObjects [player, ["house"], 60000];
_markernum = 0;
{
_building = _x;
hint "placing loot.";
// search more positions
_positions = 0;
_i = 0;
_loop = 1;
while {_loop == 1} do
{
_next = _building buildingPos _i;
if (((_next select 0) == 0) && ((_next select 1) == 0) && ((_next select 2) == 0)) then
{
_loop = 0;
} else {
_positions = _positions + 1;
_i = _i + 1;
};
};
_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;
hint "placing loot..";
if (random 100 > 80) then {
_weapon = _weapons call BIS_fnc_SelectRandom;
_mag=(getArray (configFile/"Cfgweapons"/_weapon/"magazines")) select 0;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addMagazineCargo [_mag,(round (random 5))];
       _weap addWeaponCargo [_weapon,1];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];
};

_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;
hint "placing loot...";
if (random 100 > 70) then {
_weapon = _items call BIS_fnc_SelectRandom;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addWeaponCargo [_weapon,1];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];;
};
if (random 100 > 60) then {
_weapon = _magazines call BIS_fnc_SelectRandom;
       _weap addMagazineCargo [_weapon,(round(random 6))];
};

_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;

if (random 100 > 50) then {
_weapon = _magazines call BIS_fnc_SelectRandom;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addMagazineCargo [_weapon,(round(random 6))];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];;
};

_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;

if (random 100 > 50) then {
_weapon = _magazines call BIS_fnc_SelectRandom;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addMagazineCargo [_weapon,(round(random 6))];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];;
};

_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;

if (random 100 > 50) then {
_weapon = _magazines call BIS_fnc_SelectRandom;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addMagazineCargo [_weapon,(round(random 6))];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];;
};
hint "placing loot....";
} foreach _buildings; hint "Finished! Unless it didn't work...";

It takes a long time to complete.

Share this post


Link to post
Share on other sites

Thanks Cakeonslaught. The first script is exactly what I wanted :D

If I ever want to add any weapons or items I just have to add the item's class name right?

I really know nothing about making scripts :O

The script you posted about spawning different items that need addMagazine didn't work. I have all the logics named WeaponHolder.

It spawns weapons/ammo and items fine. But it won't spawn the different items.

Also is there a way to spawn grenades/smoke grenades/m203 grenades?

Edited by ChadWicky

Share this post


Link to post
Share on other sites
I just spent all day doing something similar. I was using a simple script earlier, but now i've managed to get buildings to spawn stuff.

If you put these in your missions folder and put them in something's init you can effectively make random loot zones. Just set the placement radius to randomize position. You will almost certainly want to modify them, not all the weapons are there and some that you might not have may be in there. To use these just place down a game logic or something else invisible and set it's placement radius to whatever you want, then just put call{[this] execvm "insertscriptnamehere.sqf}; in the init box.

This one will spawn random weapons:

waituntil {!isnil "bis_fnc_init"};
_log = _this select 0;
_weapons = ["ACE_M249_AIM","ACE_M249_PIP_ACOG","ACE_MG36","ACE_MG36_D","ACE_RPK","ACE_RPK74M","ACE_RPK74M_1P29","ACE_RPG22","ACE_RPG27","ACE_RPG29","ACE_RPG7V_PGO7","MAAWS","ACE_M72","SMAW","ACE_BAF_L7A2_GPMG","ACE_M240B","ACE_M240L","ACE_M240L_M145","ACE_M60","Pecheneg","ACE_APS","ACE_APSB","ACE_Flaregun","ACE_Glock18","ACE_P226","ACE_USP","ACE_USPSD","Colt1911","glock17_EP1","M9","M9SD","revolver_EP1","Sa61_EP1","UZI_EP1","UZI_SD_EP1","AA12_PMC","ACE_AK103","ACE_AK103_1P29","ACE_AK103_GL","ACE_AK103_GL_1P29","ACE_AK103_GL_Kobra","ACE_AK103_GL_PSO","ACE_AK103_Kobra","ACE_AK103_PSO","ACE_AK104","ACE_AK104_1P29","ACE_AK104_Kobra","ACE_AK104_PSO","ACE_AK105","ACE_AK105_1P29","ACE_AK105_Kobra","ACE_AK105_PSO","ACE_AK74M","ACE_AK74M_1P29","ACE_AK74M_1P78","ACE_AK74M_1P78_FL","ACE_AK74M_1P78_FL_F","ACE_AK74M_FL","ACE_AK74M_FL_F","ACE_AK74M_GL","ACE_AK74M_GL_1P29","ACE_AK74M_GL_1P78","ACE_AK74M_GL_Kobra","ACE_AK74M_GL_NSPU","ACE_AK74M_GL_PSO","ACE_AK74M_GL_TWS","ACE_AK74M_Kobra","ACE_AK74M_Kobra_FL","ACE_AK74M_Kobra_FL_F","ACE_AK74M_NSPU","ACE_AK74M_NSPU_FL","ACE_AK74M_NSPU_FL_F","ACE_AK74M_PSO","ACE_AK74M_PSO_FL","ACE_AK74M_PSO_FL_F","ACE_AK74M_SD","ACE_AK74M_SD_1P78","ACE_AK74M_SD_Kobra","ACE_AK74M_SD_PSO","ACE_AK74M_SD_TWS","ACE_AKM","ACE_AKM_GL","ACE_AKS74_GP25","ACE_AKS74_UN","ACE_AKS74P_1P29","ACE_G36A1_AG36_UP_F","ACE_G36A1_AG36A1","ACE_G36A2_AG36A2_F","ACE_G36A2_AG36A2_UP","ACE_G36A2_Bipod","ACE_G36A2_D","ACE_G36K_EOTech_D","ACE_G3A3","ACE_G3A3_RSAS","ACE_G3SG1","ACE_gr1","ACE_gr1sd","ACE_gr1sp","ACE_HK416_D10","ACE_HK416_D10_AIM","ACE_HK416_D10_COMPM3","ACE_HK416_D10_COMPM3_SD","ACE_HK416_D10_Holo","ACE_HK416_D10_M320","ACE_HK416_D14","ACE_HK416_D14_COMPM3","ACE_HK416_D14_TWS","ACE_KAC_PDW","ACE_M1014_Eotech","ACE_M14_ACOG","ACE_m16a2_scope","ACE_m16a2gl_scope","ACE_m16a2gl_scope_UP","ACE_M16A2GL_UP","ACE_M16A4_ACG_GL_UP","ACE_M16A4_CCO_GL","ACE_M16A4_CCO_GL_UP","ACE_M16A4_EOT","ACE_M16A4_EOT_GL","ACE_M16A4_EOT_GL_UP","ACE_M16A4_Iron","ACE_M27_IAR","ACE_M27_IAR_ACOG","ACE_M27_IAR_CCO","ACE_M4","ACE_M4_ACOG","ACE_M4_ACOG_F","ACE_M4_ACOG_PVS14","ACE_M4_Aim","ACE_M4_AIM_GL","ACE_M4_AIM_GL_UP","ACE_M4_Eotech","ACE_M4_Eotech_GL","ACE_M4_Eotech_GL_UP_F","ACE_M4_RCO_GL_F","ACE_M4A1_ACOG_F","ACE_M4A1_ACOG_PVS14_F","ACE_M4A1_C","ACE_M4SPR_SD","ACE_Mk12mod1","ACE_MP5A4","ACE_MP5A5","ACE_MP5SD","ACE_SOC_M4A1_TWS","ACE_SPAS12","ACE_UMP45","ACE_UMP45_AIM_SD","AK_107_GL_kobra","AK_107_GL_pso","AK_107_kobra","AK_47_M","AK_74","AKS_74_kobra","AKS_74_pso","AKS_74_U","BAF_L85A2_RIS_ACOG","BAF_L85A2_RIS_SUSAT","BAF_L85A2_UGL_ACOG","BAF_L86A2_ACOG","bizon","bizon_silenced","FN_FAL","FN_FAL_ANPVS4","G36K","LeeEnfield","M1014","M4SPR","m8_carbine","m8_carbineGL","m8_compact","m8_sharpshooter","m8_tws","m8_tws_sd","Sa58P_EP1","Sa58V_CCO_EP1","Sa58V_RCO_EP1","Saiga12K","SCAR_H_CQC_CCO","SCAR_H_CQC_CCO_SD","SCAR_H_LNG_Sniper","SCAR_H_LNG_Sniper_SD","SCAR_H_STD_TWS_SD","SCAR_L_CQC_CCO_SD","SCAR_L_STD_EGLM_TWS","SCAR_L_STD_Mk4CQT","SCAR_L_STD_HOLO","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC","ACE_Rucksack_MOLLE_Green","ACE_AS50","ACE_M109","ACE_M110","ACE_M110_SD","ACE_TAC50","ACE_TAC50_SD","BAF_AS50_TWS","BAF_LRR_scoped","DMR","huntingrifle","ksvk","m107","m107_TWS_EP1","M110_NVG_EP1","M110_TWS_EP1","M24","M40A3","PMC_AS50_TWS","SVD","SVD_des_EP1","ACE_VTAC_RUSH72"];


_pos = getpos _log;
_cache = "WeaponHolder" createVehicle _pos;

if (random 100 > 0) then {

	_weapon = _weapons call BIS_fnc_SelectRandom;
	_cache addWeaponCargo [_weapon,1];
	_mag=(getArray (configFile/"Cfgweapons"/_weapon/"magazines")) select 0;
       	_cache addMagazineCargo [_mag,round (random 5)];

} 
else {};

This one will spawn some items:

waituntil {!isnil "bis_fnc_init"};
_log = _this select 0;
_pos = getpos _log;
_cache = "WeaponHolder" createVehicle _pos;
_items = ["ItemMap","ItemWatch","ItemCompass","ItemGPS","NVGoggles","Binocular","ACE_MX2A","ACE_YardAge450","Binocular_Vector","Laserdesignator","ACE_MugLite","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC","ACE_Rucksack_MOLLE_Green","ACE_DAGR","ACE_Earplugs","ACE_GlassesBalaklava","ACE_GlassesBalaklavaGray","ACE_GlassesBalaklavaOlive","ACE_GlassesBlackSun","ACE_GlassesBlueSun","ACE_GlassesGasMask_US","ACE_GlassesGreenSun","ACE_GlassesLHD_glasses","ACE_GlassesRedSun","ACE_GlassesSunglasses","ACE_GlassesTactical","ACE_HuntIR_monitor","ACE_Kestrel4500","ACE_Map","ACE_Map_Tools","ACE_SpottingScope","ACE_WireCutter","ACE_Knicklicht_Proxy","ACE_MugLite","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC"];
if (random 100 > 60) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};
if (random 100 > 70) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};
if (random 100 > 80) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};
if (random 100 > 80) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};
if (random 100 > 90) 

then {_cache addWeaponCargo [_items call BIS_fnc_SelectRandom,1]} 
else {};

This one will spawn different items(specifically things that need to be added with addmagazinecargo):

waituntil {!isnil "bis_fnc_init"};
_log = _this select 0;
_pos = getpos _log;
_cache = "WeaponHolder" createVehicle _pos;
_magazines = ["ACE_ANM14","ACE_Bandage","ACE_C4_M","ACE_Knicklicht_B","ACE_Knicklicht_G","ACE_Knicklicht_R","ACE_Knicklicht_Y","ACE_Knicklicht_W","ACE_LargeBandage","ACE_DM25","ACE_DM31","ACE_DM31_M","ACE_DM32","ACE_DM33","ACE_DM34","ACE_DM36","ACE_DM51","ACE_DM51A1","ACE_Epinephrine","ACE_M84","ACE_HuntIR_M203","PMC_ied_v1","BAF_ied_v2","BAF_ied_v3","ACE_BBETTY_M","ACE_CLAYMORE_M","ACE_M34","ACE_TRIPFLARE_M","HandGrenade_West","ACE_M7A3","ACE_M86PDM","ACE_Medkit","ACE_MON50_M","ACE_Morphine","ACE_OSM4_M","ACE_RDGM","ACE_RG60A","HandGrenade_East","PipeBomb","SmokeShell","SmokeShellBlue","SmokeShellGreen","SmokeShellRed","ACE_TORCH_C","ACE_Knicklicht_B","ACE_Knicklicht_G","ACE_Knicklicht_R","ACE_Knicklicht_Y","ACE_Knicklicht_W"];
if (random 100 > 70) 

then {_cache addMagazineCargo [[] call BIS_fnc_SelectRandom,round (random 6)]} 
else {};
if (random 100 > 90) 

then {_cache addMagazineCargo [[] call BIS_fnc_SelectRandom,round (random 3)]} 
else {};

This is the one i'm currently using to add loot to buildings, I've pieced it together from http://forums.bistudio.com/archive/index.php/t-102796.html and https://dev-heaven.net/issues/32590 so i can't take any credit.

//////////////////////////////////BUILDING LOOT//////////////////////////////////////

_weapons = ["ACE_M249_AIM","ACE_M249_PIP_ACOG","ACE_MG36","ACE_MG36_D","ACE_RPK","ACE_RPK74M","ACE_RPK74M_1P29","ACE_RPG22","ACE_RPG27","ACE_RPG29","ACE_RPG7V_PGO7","MAAWS","ACE_M72","SMAW","ACE_BAF_L7A2_GPMG","ACE_M240B","ACE_M240L","ACE_M240L_M145","ACE_M60","Pecheneg","ACE_APS","ACE_APSB","ACE_Flaregun","ACE_Glock18","ACE_P226","ACE_USP","ACE_USPSD","Colt1911","glock17_EP1","M9","M9SD","revolver_EP1","Sa61_EP1","UZI_EP1","UZI_SD_EP1","AA12_PMC","ACE_AK103","ACE_AK103_1P29","ACE_AK103_GL","ACE_AK103_GL_1P29","ACE_AK103_GL_Kobra","ACE_AK103_GL_PSO","ACE_AK103_Kobra","ACE_AK103_PSO","ACE_AK104","ACE_AK104_1P29","ACE_AK104_Kobra","ACE_AK104_PSO","ACE_AK105","ACE_AK105_1P29","ACE_AK105_Kobra","ACE_AK105_PSO","ACE_AK74M","ACE_AK74M_1P29","ACE_AK74M_1P78","ACE_AK74M_1P78_FL","ACE_AK74M_1P78_FL_F","ACE_AK74M_FL","ACE_AK74M_FL_F","ACE_AK74M_GL","ACE_AK74M_GL_1P29","ACE_AK74M_GL_1P78","ACE_AK74M_GL_Kobra","ACE_AK74M_GL_NSPU","ACE_AK74M_GL_PSO","ACE_AK74M_GL_TWS","ACE_AK74M_Kobra","ACE_AK74M_Kobra_FL","ACE_AK74M_Kobra_FL_F","ACE_AK74M_NSPU","ACE_AK74M_NSPU_FL","ACE_AK74M_NSPU_FL_F","ACE_AK74M_PSO","ACE_AK74M_PSO_FL","ACE_AK74M_PSO_FL_F","ACE_AK74M_SD","ACE_AK74M_SD_1P78","ACE_AK74M_SD_Kobra","ACE_AK74M_SD_PSO","ACE_AK74M_SD_TWS","ACE_AKM","ACE_AKM_GL","ACE_AKS74_GP25","ACE_AKS74_UN","ACE_AKS74P_1P29","ACE_G36A1_AG36_UP_F","ACE_G36A1_AG36A1","ACE_G36A2_AG36A2_F","ACE_G36A2_AG36A2_UP","ACE_G36A2_Bipod","ACE_G36A2_D","ACE_G36K_EOTech_D","ACE_G3A3","ACE_G3A3_RSAS","ACE_G3SG1","ACE_gr1","ACE_gr1sd","ACE_gr1sp","ACE_HK416_D10","ACE_HK416_D10_AIM","ACE_HK416_D10_COMPM3","ACE_HK416_D10_COMPM3_SD","ACE_HK416_D10_Holo","ACE_HK416_D10_M320","ACE_HK416_D14","ACE_HK416_D14_COMPM3","ACE_HK416_D14_TWS","ACE_KAC_PDW","ACE_M1014_Eotech","ACE_M14_ACOG","ACE_m16a2_scope","ACE_m16a2gl_scope","ACE_m16a2gl_scope_UP","ACE_M16A2GL_UP","ACE_M16A4_ACG_GL_UP","ACE_M16A4_CCO_GL","ACE_M16A4_CCO_GL_UP","ACE_M16A4_EOT","ACE_M16A4_EOT_GL","ACE_M16A4_EOT_GL_UP","ACE_M16A4_Iron","ACE_M27_IAR","ACE_M27_IAR_ACOG","ACE_M27_IAR_CCO","ACE_M4","ACE_M4_ACOG","ACE_M4_ACOG_F","ACE_M4_ACOG_PVS14","ACE_M4_Aim","ACE_M4_AIM_GL","ACE_M4_AIM_GL_UP","ACE_M4_Eotech","ACE_M4_Eotech_GL","ACE_M4_Eotech_GL_UP_F","ACE_M4_RCO_GL_F","ACE_M4A1_ACOG_F","ACE_M4A1_ACOG_PVS14_F","ACE_M4A1_C","ACE_M4SPR_SD","ACE_Mk12mod1","ACE_MP5A4","ACE_MP5A5","ACE_MP5SD","ACE_SOC_M4A1_TWS","ACE_SPAS12","ACE_UMP45","ACE_UMP45_AIM_SD","AK_107_GL_kobra","AK_107_GL_pso","AK_107_kobra","AK_47_M","AK_74","AKS_74_kobra","AKS_74_pso","AKS_74_U","BAF_L85A2_RIS_ACOG","BAF_L85A2_RIS_SUSAT","BAF_L85A2_UGL_ACOG","BAF_L86A2_ACOG","bizon","bizon_silenced","FN_FAL","FN_FAL_ANPVS4","G36K","LeeEnfield","M1014","M4SPR","m8_carbine","m8_carbineGL","m8_compact","m8_sharpshooter","m8_tws","m8_tws_sd","Sa58P_EP1","Sa58V_CCO_EP1","Sa58V_RCO_EP1","Saiga12K","SCAR_H_CQC_CCO","SCAR_H_CQC_CCO_SD","SCAR_H_LNG_Sniper","SCAR_H_LNG_Sniper_SD","SCAR_H_STD_TWS_SD","SCAR_L_CQC_CCO_SD","SCAR_L_STD_EGLM_TWS","SCAR_L_STD_Mk4CQT","SCAR_L_STD_HOLO","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC","ACE_Rucksack_MOLLE_Green","ACE_AS50","ACE_M109","ACE_M110","ACE_M110_SD","ACE_TAC50","ACE_TAC50_SD","BAF_AS50_TWS","BAF_LRR_scoped","DMR","huntingrifle","ksvk","m107","m107_TWS_EP1","M110_NVG_EP1","M110_TWS_EP1","M24","M40A3","PMC_AS50_TWS","SVD","SVD_des_EP1","ACE_VTAC_RUSH72"];

_items = ["ItemMap","ItemWatch","ItemCompass","ItemGPS","NVGoggles","Binocular","ACE_MX2A","ACE_YardAge450","Binocular_Vector","Laserdesignator","ACE_MugLite","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC","ACE_Rucksack_MOLLE_Green","ACE_DAGR","ACE_Earplugs","ACE_GlassesBalaklava","ACE_GlassesBalaklavaGray","ACE_GlassesBalaklavaOlive","ACE_GlassesBlackSun","ACE_GlassesBlueSun","ACE_GlassesGasMask_US","ACE_GlassesGreenSun","ACE_GlassesLHD_glasses","ACE_GlassesRedSun","ACE_GlassesSunglasses","ACE_GlassesTactical","ACE_HuntIR_monitor","ACE_Kestrel4500","ACE_Map","ACE_Map_Tools","ACE_SpottingScope","ACE_WireCutter","ACE_Knicklicht_Proxy","ACE_MugLite","ACE_ALICE_Backpack","ACE_BackPack_ACR","ACE_Backpack_FL","ACE_FAST_PackEDC"];

_magazines = ["ACE_ANM14","ACE_Bandage","ACE_C4_M","ACE_Knicklicht_B","ACE_Knicklicht_G","ACE_Knicklicht_R","ACE_Knicklicht_Y","ACE_Knicklicht_W","ACE_LargeBandage","ACE_DM25","ACE_DM31","ACE_DM31_M","ACE_DM32","ACE_DM33","ACE_DM34","ACE_DM36","ACE_DM51","ACE_DM51A1","ACE_Epinephrine","ACE_M84","ACE_HuntIR_M203","PMC_ied_v1","BAF_ied_v2","BAF_ied_v3","ACE_BBETTY_M","ACE_CLAYMORE_M","ACE_M34","ACE_TRIPFLARE_M","HandGrenade_West","ACE_M7A3","ACE_M86PDM","ACE_Medkit","ACE_MON50_M","ACE_Morphine","ACE_OSM4_M","ACE_RDGM","ACE_RG60A","HandGrenade_East","PipeBomb","SmokeShell","SmokeShellBlue","SmokeShellGreen","SmokeShellRed","ACE_TORCH_C","ACE_Knicklicht_B","ACE_Knicklicht_G","ACE_Knicklicht_R","ACE_Knicklicht_Y","ACE_Knicklicht_W"];
hint "placing loot";
_buildings = nearestObjects [player, ["house"], 60000];
_markernum = 0;
{
_building = _x;
hint "placing loot.";
// search more positions
_positions = 0;
_i = 0;
_loop = 1;
while {_loop == 1} do
{
_next = _building buildingPos _i;
if (((_next select 0) == 0) && ((_next select 1) == 0) && ((_next select 2) == 0)) then
{
_loop = 0;
} else {
_positions = _positions + 1;
_i = _i + 1;
};
};
_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;
hint "placing loot..";
if (random 100 > 80) then {
_weapon = _weapons call BIS_fnc_SelectRandom;
_mag=(getArray (configFile/"Cfgweapons"/_weapon/"magazines")) select 0;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addMagazineCargo [_mag,(round (random 5))];
       _weap addWeaponCargo [_weapon,1];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];
};

_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;
hint "placing loot...";
if (random 100 > 70) then {
_weapon = _items call BIS_fnc_SelectRandom;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addWeaponCargo [_weapon,1];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];;
};
if (random 100 > 60) then {
_weapon = _magazines call BIS_fnc_SelectRandom;
       _weap addMagazineCargo [_weapon,(round(random 6))];
};

_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;

if (random 100 > 50) then {
_weapon = _magazines call BIS_fnc_SelectRandom;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addMagazineCargo [_weapon,(round(random 6))];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];;
};

_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;

if (random 100 > 50) then {
_weapon = _magazines call BIS_fnc_SelectRandom;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addMagazineCargo [_weapon,(round(random 6))];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];;
};

_posnumber = floor (random _positions);
_position = _building buildingpos _posnumber;

if (random 100 > 50) then {
_weapon = _magazines call BIS_fnc_SelectRandom;
       _weap = "weaponHolder" createVehicle [0,0];
       _weap addMagazineCargo [_weapon,(round(random 6))];
       _weap setPos [(_position select 0),(_position select 1),((_position select 2)-.14)];;
};
hint "placing loot....";
} foreach _buildings; hint "Finished! Unless it didn't work...";

It takes a long time to complete.

this is so very useful .lots to learn here. one question, your your building loot script the backpacks dont work even though i can pick them up i cannot put shit inside them. any ideas on how to fix?

Share this post


Link to post
Share on other sites
The script you posted about spawning different items that need addMagazine didn't work. I have all the logics named WeaponHolder.

It spawns weapons/ammo and items fine. But it won't spawn the different items.

Also is there a way to spawn grenades/smoke grenades/m203 grenades?

I'll check it out soon, and most of those items are grenades actually. It's worth noting that i am using ACE and ACEX for these but i'm not sure what versions(not the most recent ones). Make sure to add -showscripterrors to your arma shortcut, it might point you in the right direction.
this is so very useful .lots to learn here. one question, your your building loot script the backpacks dont work even though i can pick them up i cannot put shit inside them. any ideas on how to fix?
Haha, i haven't actually gotten to the point where i've tried to play with the items yet but i'll definately post the fix here if i figure it out. I'm having problems with errors saying _mag is undefined and i tried to add checks for (isnil) weapons because i added some that weren't in my version of ACE which is what i think causes it. Maybe at some point a real scripter will come in and say "Hey, just do it like this...". Even so i think it generates items just fine but it takes an extremely long time to finish.

---------- Post added at 05:38 PM ---------- Previous post was at 05:18 PM ----------

Okay, so the reason that one doesn't work is because i forgot to feed it the list of items to choose from.

Needs to be changed from:

then {_cache addMagazineCargo [[] call BIS_fnc_SelectRandom,round (random 6)]} 
else {};
if (random 100 > 0) 

then {_cache addMagazineCargo [[] call BIS_fnc_SelectRandom,round (random 3)]} 
else {};

To:

if (random 100 > 0) 

then {_cache addMagazineCargo [_magazines call BIS_fnc_SelectRandom,round (random 6)]} 
else {};
if (random 100 > 0) 

then {_cache addMagazineCargo [_magazines call BIS_fnc_SelectRandom,round (random 3)]} 
else {};

I had brackets instead of _magazines before "call BIS_fnc_SelectRandom" (selects randomly from array). Also where it says "if (random 100 > 0) then..." You will want to change the 0 such that you get the odds you want of that set spawning. So "if (random 100 > 90)" would be low chance and "if (random 100 > 0)" means always (or almost always if it can pick 0).

Share this post


Link to post
Share on other sites

Absolutely excellent set of scripts mate!

Could you give me some pointers please?

buildings = nearestObjects [player, ["house"], 60000];

Is the 60000 the distance from the centre of the item that runs the script?

Also, using your final script to spawn weapons/ammo and items in I am getting an error in my rpt file

Error in expression <= _magazines call BIS_fnc_SelectRandom;
_weap addMagazineCargo [_weapon,(round(r>
 Error position: <_weap addMagazineCargo [_weapon,(round(r>
 Error Undefined variable in expression: _weap
File C:\Users\marker\Documents\ArmA 2 Other Profiles\MarKeR\missions\test.Chernarus\buildweapran.sqf, line 52

Sorry for another question, if I want to reduce the number of weapons spawned, what would I change, hoping to spawn around 20 - 30 weapons for the whole of Chernarus!

Thanks

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×