Chris Atkins
Valued Member!
thx for the reply I got it working. how do I set it for AI to spawn just at the missions
Did you set DZAI just for the crate or for the vehicle variables also?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
thx for the reply I got it working. how do I set it for AI to spawn just at the missions
That doesn't work. If the player dies , disconnects to the lobby and rejoins, the markers are gone. The only way that method above works is if the player disconnects completely from the game, then rejoins (which is a pain). I've got around it by adding the file to my epoch events, running every minute at the moment until I figure out how to get it to run every 10 minutes (without having to do the 10,20,30,40,50 entry thing)..
Thanks for the help.
_crate = _this select 0;
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
//define lists
_pistolList = ["Colt1911","glock17_EP1","M9","M9SD","Makarov","MakarovSD"];
_sniperList = ["BAF_AS50_scoped_DZ","BAF_LRR_scoped","BAF_LRR_scoped_W","DMR","huntingrifle"];
_mgList = ["M240_DZ","m240_scoped_DZ","M249_DZ","MG36_camo_DZ","MG36_DZ","Mk_48_DZ","M60A4_DZ"];
_primaryList = ["AK_107_GL_kobra","AK_107_GL_pso","AK_107_kobra","AK_107_pso","AK_47_M","AK_47_S",];
_gearList = ["Binocular","Binocular_Vector","NVGoggles","Skin_BanditSkin_DZ","Skin_Camo1_DZ","Skin_Rocket_DZ"];
_bpackList = ["DZ_ALICE_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Backpack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Czech_Vest_Puch","DZ_TK_Assault_Pack_EP1"];
_gshellList = ["1Rnd_SMOKE_GP25","1Rnd_SmokeGreen_GP25","1Rnd_SmokeRed_GP25","1Rnd_SmokeYellow_GP25","FlareGreen_GP25"];
// other
_crate addMagazineCargoGlobal ["HandGrenade", 8];
_crate addMagazineCargoGlobal ["HandGrenade_west", 8];
_crate addMagazineCargoGlobal ["HandRoadFlare", 8];
_crate addMagazineCargoGlobal ["PipeBomb", 8];
// load gear
_scount = count _gearList;
for "_x" from 0 to 9 do {
_sSelect = floor(random _sCount);
_item = _gearList select _sSelect;
_crate addMagazineCargoGlobal [_item,(round(random 4))];
};
// load grenades
_scount = count _gshellList;
for "_x" from 0 to 4 do {
_sSelect = floor(random _sCount);
_item = _gshellList select _sSelect;
_crate addMagazineCargoGlobal [_item,(round(random 4))];
};
_crate addMagazineCargoGlobal ["1Rnd_HE_GP25",8];
_crate addMagazineCargoGlobal ["1Rnd_HE_M203",8];
// load packs
_scount = count _bpackList;
for "_x" from 0 to 1 do {
_sSelect = floor(random _sCount);
_item = _bpackList select _sSelect;
_crate addBackpackCargoGlobal [_item,2];
};
// load pistols
_scount = count _pistolList;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = _pistolList select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),8];
};
};
//load sniper
_scount = count _sniperList;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = _sniperList select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),8];
};
};
//load mg
_scount = count _mgList;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = _mgList select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),8];
};
};
//load primary
_scount = count _primaryList;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = _primaryList select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),8];
};
};
_weaponlist = [] + getArray (configFile >> "cfgWeapons" >> "Class Name");
_aispawn = [[(_coords select 0) + 20, _coords select 1,0],40,4,4,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [[(_coords select 0) + 30, _coords select 1,0],40,4,4,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [[(_coords select 0) + 20, _coords select 1,0],80,6,6,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [[(_coords select 0) + 30, _coords select 1,0],80,6,6,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
Code:_crate = _this select 0; clearWeaponCargoGlobal _crate; clearMagazineCargoGlobal _crate; //define lists _pistolList = ["Colt1911","glock17_EP1","M9","M9SD","Makarov","MakarovSD"]; _sniperList = ["BAF_AS50_scoped_DZ","BAF_LRR_scoped","BAF_LRR_scoped_W","DMR","huntingrifle"]; _mgList = ["M240_DZ","m240_scoped_DZ","M249_DZ","MG36_camo_DZ","MG36_DZ","Mk_48_DZ","M60A4_DZ"]; _primaryList = ["AK_107_GL_kobra","AK_107_GL_pso","AK_107_kobra","AK_107_pso","AK_47_M","AK_47_S",]; _gearList = ["Binocular","Binocular_Vector","NVGoggles","Skin_BanditSkin_DZ","Skin_Camo1_DZ","Skin_Rocket_DZ"]; _bpackList = ["DZ_ALICE_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Backpack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Czech_Vest_Puch","DZ_TK_Assault_Pack_EP1"]; _gshellList = ["1Rnd_SMOKE_GP25","1Rnd_SmokeGreen_GP25","1Rnd_SmokeRed_GP25","1Rnd_SmokeYellow_GP25","FlareGreen_GP25"]; // other _crate addMagazineCargoGlobal ["HandGrenade", 8]; _crate addMagazineCargoGlobal ["HandGrenade_west", 8]; _crate addMagazineCargoGlobal ["HandRoadFlare", 8]; _crate addMagazineCargoGlobal ["PipeBomb", 8]; // load gear _scount = count _gearList; for "_x" from 0 to 9 do { _sSelect = floor(random _sCount); _item = _gearList select _sSelect; _crate addMagazineCargoGlobal [_item,(round(random 4))]; }; // load grenades _scount = count _gshellList; for "_x" from 0 to 4 do { _sSelect = floor(random _sCount); _item = _gshellList select _sSelect; _crate addMagazineCargoGlobal [_item,(round(random 4))]; }; _crate addMagazineCargoGlobal ["1Rnd_HE_GP25",8]; _crate addMagazineCargoGlobal ["1Rnd_HE_M203",8]; // load packs _scount = count _bpackList; for "_x" from 0 to 1 do { _sSelect = floor(random _sCount); _item = _bpackList select _sSelect; _crate addBackpackCargoGlobal [_item,2]; }; // load pistols _scount = count _pistolList; for "_x" from 0 to 3 do { _sSelect = floor(random _sCount); _item = _pistolList select _sSelect; _crate addWeaponCargoGlobal [_item,1]; _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines"); if (count _ammo > 0) then { _crate addMagazineCargoGlobal [(_ammo select 0),8]; }; }; //load sniper _scount = count _sniperList; for "_x" from 0 to 3 do { _sSelect = floor(random _sCount); _item = _sniperList select _sSelect; _crate addWeaponCargoGlobal [_item,1]; _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines"); if (count _ammo > 0) then { _crate addMagazineCargoGlobal [(_ammo select 0),8]; }; }; //load mg _scount = count _mgList; for "_x" from 0 to 3 do { _sSelect = floor(random _sCount); _item = _mgList select _sSelect; _crate addWeaponCargoGlobal [_item,1]; _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines"); if (count _ammo > 0) then { _crate addMagazineCargoGlobal [(_ammo select 0),8]; }; }; //load primary _scount = count _primaryList; for "_x" from 0 to 3 do { _sSelect = floor(random _sCount); _item = _primaryList select _sSelect; _crate addWeaponCargoGlobal [_item,1]; _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines"); if (count _ammo > 0) then { _crate addMagazineCargoGlobal [(_ammo select 0),8]; }; };
_crate = _this select 0;
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
//define lists
_pistolList = ["Colt1911","glock17_EP1","M9","M9SD","Makarov","MakarovSD","revolver_EP1","revolver_gold_EP1"];
_sniperList = ["SVD_CAMO","SCAR_H_LNG_Sniper_SD","DMR","SVD","VSS_vintorez","huntingrifle","M14_EP1","M24","M40A3","SVD_des_EP1"];
_mgList = ["Pecheneg_DZ","M240_DZ","M249_DZ","Mk_48_DZ","UZI_EP1","bizon_silenced","Sa61_EP1","UZI_SD_EP1","MP5A5","MP5SD"];
_primaryList = ["M79_EP1","Sa58P_EP1","Sa58V_CCO_EP1","Sa58V_EP1","Sa58V_RCO_EP1","AKS_74_kobra","AKS_74_U","AKS_GOLD","AK_47_M","AK_74","FN_FAL","FN_FAL_ANPVS4","m8_compact","G36A_camo","m8_sharpshooter","G36C",
"m8_holo_sd","G36C_camo","m8_carbine","G36K_camo","M24_des_EP1","G36_C_SD_camo","LeeEnfield","M16A2","M16A2GL","M16A4_ACG","M4A1","M4A1_Aim","M4A1_AIM_SD_camo","M4A1_HWS_GL_camo","M4A3_CCO_EP1",
"Winchester1866","Saiga12K","M1014","MR43","Remington870_lamp"];
_gearList = ["Binocular_Vector","ItemCrowbar","ItemFishingPole","ItemFlashlightRed","ItemKnife","ItemKeyKit","ItemMatchbox",
"ItemRadio","ItemToolbox","ItemWatch","Binocular","ItemMap","ItemGPS","ItemEtool","ItemCompass","ItemMachete","ItemFlashlight","NVGoggles","ItemHatchet"];
_bpackList = ["CZ_VestPouch_EP1","DZ_ALICE_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Backpack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Czech_Vest_Puch","DZ_Patrol_Pack_EP1","DZ_TK_Assault_Pack_EP1",
"DZ_LargeGunBag_EP1","DZ_GunBag_EP1","DZ_CompactPack_EP1","DZ_TerminalPack_EP1"];
_gshellList = ["HandGrenade_west","PipeBomb","FlareGreen_M203","FlareWhite_M203"];
// other
// _crate addMagazineCargoGlobal ["HandGrenade", 8];
// _crate addMagazineCargoGlobal ["HandGrenade_west", 8];
// _crate addMagazineCargoGlobal ["HandRoadFlare", 8];
// _crate addMagazineCargoGlobal ["PipeBomb", 8];
// load gear
_scount = count _gearList;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = _gearList select _sSelect;
_crate addWeaponCargoGlobal [_item,(round(random 2))];
};
// load grenades
_scount = count _gshellList;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = _gshellList select _sSelect;
_crate addMagazineCargoGlobal [_item,(round(random 2))];
};
// load packs
_scount = count _bpackList;
for "_x" from 0 to 1 do {
_sSelect = floor(random _sCount);
_item = _bpackList select _sSelect;
_crate addBackpackCargoGlobal [_item,2];
};
// load pistols
_scount = count _pistolList;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = _pistolList select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),8];
};
};
//load sniper
_scount = count _sniperList;
for "_x" from 0 to 1 do {
_sSelect = floor(random _sCount);
_item = _sniperList select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),8];
};
};
//load mg
_scount = count _mgList;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = _mgList select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),8];
};
};
//load primary
_scount = count _primaryList;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = _primaryList select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),8];
};
};
private ["_classname","_base","_item","_count","_coreB","_core","_pisB","_pis","_rifB","_rif","_mgB","_mg","_otB","_ot","_ammo","_thing"];
_core = [];
_pis = [];
_rif = [];
_mg = [];
_ot = [];
_coreB = ["ItemCore","Default"]; //Base class which all in this list derive from
_pisB = ["Pistol"];
_rifB = ["Rifle","M16_base"];
_mgB = ["MGun","M240"]; //Hand carried MG based on class rifle. Placing M240 here didn't work as all M240 derivatives already added under rifle. Do Mg Case first?
_otB = [];
_coreB = ["ItemCore"];
_pisB = ["Pistol"];
_count = count (configFile >> "CfgWeapons");
for "_x" from 0 to (_count-1) do
{
_item=((configFile >> "CfgWeapons") select _x);
if (isClass _item) then{
_base = configname (inheritsFrom _item);
if (_base !="Fakeweapon") then{
if (getnumber (_item >> "scope") == 2) then {
_classname = configName _item;
_ammo = [] + getArray (_item >> "magazines");
switch (true) do{
case (_base in _coreB):{
if (_classname != "EvMap" && _classname != "EvMoney" && _classname != "ItemMap_Debug") then {
_core = _core + [_classname];
if (!(_classname in _coreB)) then {
_coreB = _coreb + [_classname];
};
};
};
case (_base in _pisB):{
if (count _ammo > 0 ) then {
_pis = _pis + [_classname];
if (!(_classname in _pisB)) then {
_pisB = _pisb + [_classname];
};
};
};
case (_base in _rifB):{
_rif = _rif + [_classname];
if (!(_classname in _rifB)) then {
_rifB = _rifb + [_classname];
};
};
case (_base in _mgB):{
_mg = _mg + [_classname];
if (!(_classname in _mgB)) then {
_mgB = _mgb + [_classname];
};
};
default {
_ot = _ot + [_classname];
if (!(_classname in _otB)) then {
_otB = _otb + [_classname];
};
};
};
};
};
};
};
hint format ["Core %5 Pistols %1 Rifles %2 MG %3 Other %4",(count _pis),(count _rif), (count _mg), (count _ot), (count _core)]; // hint for totals on completion
sleep 2;
_thing = _rif; //quickly change loop to display class list
for "_x" from 0 to ((count _thing)-1) do {
hint format ["includes %1",(_thing select _x)]; //hint for all items in selected list
sleep .5;
};
i was unable to find this line of code in the first step
fn_bases = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fn_bases.sqf";
Works fine on OW 0.2.5