arma2-epoch-server/@DayZ_Epoch_Server/addons/dayz_server/AdminTools/ServerFunctions/crateSpawn.sqf

195 lines
35 KiB
Plaintext
Raw Permalink Normal View History

2022-04-21 16:15:41 +03:00
private ["_playerUID","_clientKey","_worldspace","_activatingPlayer","_weapon","_key_colors","_wpn_type","_magazine","_mag_type"];
// Macros for repeatable code
#define CRATE_SETUP _spawnCrate = "DZ_AmmoBoxFlatUS" createVehicle _pos; _spawnCrate setDir _dir; _spawnCrate setposATL _pos; clearWeaponCargoGlobal _spawnCrate; clearMagazineCargoGlobal _spawnCrate; clearBackpackCargoGlobal _spawnCrate;
#define ADD_BACKPACK _spawnCrate addBackpackCargoGlobal ["LargeGunBag_DZE2", 1];
#define ADD {_spawnCrate addMagazineCargoGlobal _x;} forEach
#define ADD_1X {_spawnCrate addWeaponCargoGlobal [_x, 1];} forEach
#define ADD_5X {_spawnCrate addWeaponCargoGlobal [_x, 5];} forEach
// Backpack crate
#define BACKPACKS ["Patrol_Pack_DZE1","Patrol_Pack_DZE2","GymBag_Camo_DZE1","GymBag_Camo_DZE2","GymBag_Green_DZE1","GymBag_Green_DZE2","Czech_Vest_Pouch_DZE1","Czech_Vest_Pouch_DZE2","Assault_Pack_DZE1","Assault_Pack_DZE2","TerminalPack_DZE1","TerminalPack_DZE2","TinyPack_DZE1","TinyPack_DZE2","ALICE_Pack_DZE1","ALICE_Pack_DZE2","TK_Assault_Pack_DZE1","TK_Assault_Pack_DZE2","School_Bag_DZE1","School_Bag_DZE2","CompactPack_DZE1","CompactPack_DZE2","British_ACU_DZE1","British_ACU_DZE2","GunBag_DZE1","GunBag_DZE2","PartyPack_DZE1","PartyPack_DZE2","NightPack_DZE1","NightPack_DZE2","SurvivorPack_DZE1","SurvivorPack_DZE2","AirwavesPack_DZE1","AirwavesPack_DZE2","CzechBackpack_DZE1","CzechBackpack_DZE2","CzechBackpack_Camping_DZE1","CzechBackpack_Camping_DZE2","CzechBackpack_OD_DZE1","CzechBackpack_OD_DZE2","CzechBackpack_DES_DZE1","CzechBackpack_DES_DZE2","CzechBackpack_3DES_DZE1","CzechBackpack_3DES_DZE2","CzechBackpack_WDL_DZE1","CzechBackpack_WDL_DZE2","CzechBackpack_MAR_DZE1","CzechBackpack_MAR_DZE2","CzechBackpack_DMAR_DZE1","CzechBackpack_DMAR_DZE2","CzechBackpack_UCP_DZE1","CzechBackpack_UCP_DZE2","CzechBackpack_6DES_DZE1","CzechBackpack_6DES_DZE2","CzechBackpack_TAK_DZE1","CzechBackpack_TAK_DZE2","CzechBackpack_NVG_DZE1","CzechBackpack_NVG_DZE2","CzechBackpack_BLK_DZE1","CzechBackpack_BLK_DZE2","CzechBackpack_DPM_DZE1","CzechBackpack_DPM_DZE2","CzechBackpack_FIN_DZE1","CzechBackpack_FIN_DZE2","CzechBackpack_MTC_DZE1","CzechBackpack_MTC_DZE2","CzechBackpack_NOR_DZE1","CzechBackpack_NOR_DZE2","CzechBackpack_WIN_DZE1","CzechBackpack_WIN_DZE2","CzechBackpack_ATC_DZE1","CzechBackpack_ATC_DZE2","CzechBackpack_MTL_DZE1","CzechBackpack_MTL_DZE2","CzechBackpack_FTN_DZE1","CzechBackpack_FTN_DZE2","WandererBackpack_DZE1","WandererBackpack_DZE2","LegendBackpack_DZE1","LegendBackpack_DZE2","CoyoteBackpack_DZE1","CoyoteBackpack_DZE2","CoyoteBackpackDes_DZE1","CoyoteBackpackDes_DZE2","CoyoteBackpackWdl_DZE1","CoyoteBackpackWdl_DZE2","CoyoteBackpack_Camping_DZE1","CoyoteBackpack_Camping_DZE2","LargeGunBag_DZE1","LargeGunBag_DZE2"]
// Items
//local _bloodbag = ["bloodBagONEG","ItemBloodbag"] select dayz_classicBloodBagSystem;
#define TOOLBELT ["Binocular","Binocular_Vector","ItemCompass","ItemCrowbar","ItemEtool","ItemFishingPole","ItemFlashlight","ItemFlashlightRed","ItemGPS","ItemHatchet","ItemKeyKit","ItemKnife","ItemMap","ItemMatchBox","ItemRadio","ItemSledge","ItemSledgeHammer","ItemToolbox","ItemWatch","NVGoggles","NVGoggles_DZE","ItemShovel","ItemPickaxe","ItemMachete","ItemAPSI_DZE","ItemPilotmask_DZE","ItemGasmask1_DZE","ItemGasmask2_DZE","ItemSolder_DZE","Cuffs_DZE","Hammer_DZE","Handsaw_DZE","Smartphone_DZE","Scissors_DZE","Screwdriver_DZE","Wrench_DZE"]
// Building Crates
#define BUILDING_TOOLS ["ItemCrowbar","ItemEtool","ItemHatchet","ItemMatchBox","ItemSledge","ItemToolbox","ChainSaw"]
#define ADMIN_BUILD_CRATE [["plot_pole_kit", 10],["bulk_empty", 10],["bulk_ItemTankTrap", 20],["bulk_ItemWire", 10],["CinderBlocks", 30],["cinder_door_kit", 10],["cinder_garage_kit", 10],["full_cinder_wall_kit", 60],["glass_floor_kit", 8],["glass_floor_half_kit", 16],["glass_floor_quarter_kit", 32],["metal_floor_half_kit", 16],["metal_floor_quarter_kit", 32],["metal_floor4x_kit", 2],["metal_pillar_kit", 4],["half_cinder_wall_gap_kit", 4],["cinderwall_window_kit", 6],["cinderwall_window_locked_kit", 2],["cinder_door_frame_kit", 6],["cinder_door_kit_locked", 2],["cinder_door_hatch_kit", 4],["cinder_door_hatch_kit_locked", 2],["cinder_garage_frame_kit", 6],["cinder_garage_kit_locked", 1],["cinder_garage_top_open_frame_kit", 2],["cinder_garage_top_open_kit", 6],["cinder_garage_top_open_kit_locked", 1],["cinder_gate_frame_kit", 2],["cinder_gate_kit", 6],["cinder_gate_kit_locked", 1],["cinder_bunker_kit", 6],["cinder_bunker_kit_locked", 1],["metal_drawbridge_kit", 6],["metal_drawbridge_kit_locked", 1],["deer_stand_kit", 10],["desert_large_net_kit", 10],["desert_net_kit", 10],["forest_large_net_kit", 10],["forest_net_kit", 10],["fuel_pump_kit", 10],["ItemBurlap", 10],["ItemCanvas", 10],["ItemComboLock", 10],["ItemCorrugated", 10],["ItemFireBarrel_Kit", 10],["ItemFuelBarrelEmpty", 10],["ItemGenerator", 10],["ItemGunRackKit", 10],["ItemHotwireKit", 10],["ItemJerrycan", 10],["ItemLockbox", 10],["ItemPole", 10],["ItemSandbag", 50],["ItemSandbagExLarge", 20],["ItemSandbagExLarge5x", 20],["ItemSandbagLarge", 20],["ItemScaffoldingKit", 10],["BagFenceRound_DZ_kit",20],["ItemTankTrap", 10],["ItemTent", 5],["ItemDesertTent", 5],["ItemVault", 10],["ItemWire", 10],["ItemWoodFloor", 30],["ItemWoodFloorHalf", 30],["ItemWoodFloorQuarter", 30],["ItemWoodLadder", 30],["ItemWoodStairs", 10],["ItemWoodStairsSupport", 10],["ItemWoodWall", 30],["ItemWoodWallDoor", 10],["ItemWoodWallDoorLg", 10],["ItemWoodWallGarageDoor", 10],["ItemWoodWallGarageDoorLocked", 10],["ItemWoodWallLg", 30],["ItemWoodWallThird", 20],["ItemWoodWallWindow", 20],["ItemWoodWallWindowLg", 30],["ItemWoodWallWithDoor", 10],["ItemWoodWallwithDoorLg", 10],["ItemWoodWallWithDoorLgLocked", 10],["ItemWoodWallWithDoorLocked", 10],["door_frame_kit", 10],["door_kit", 10],["door_locked_kit", 10],["ItemWoodFloor4x", 10],["ItemWoodFloorStairs", 10],["ItemTriangleWoodFloor", 10],["ItemWoodHandRail", 16],["ItemWoodPillar", 16],["ItemTriangleWoodWall", 8],["ItemWoodOpenTopGarageDoor", 4],["ItemWoodOpenTopGarageDoor", 10],["ItemWoodOpenTopGarageDoorLocked", 10],["ItemWoodGateFrame", 4],["ItemWoodGate", 10],["ItemWoodGateLocked", 10],["light_pole_kit", 10],["m240_nest_kit", 5],["metal_floor_kit", 60],["metal_panel_kit", 20],["MortarBucket", 5],["outhouse_kit", 5],["park_bench_kit", 5],["PartGeneric", 30],["PartPlankPack", 30],["PartPlywoodPack", 30],["PartWoodLumber", 30],["PartWoodPile", 30],["PartWoodPlywood", 30],["rusty_gate_kit", 5],["sandbag_nest_kit", 30],["stick_fence_kit", 5],["storage_shed_kit", 10],["sun_shade_kit", 10],["wooden_shed_kit", 10],["wood_ramp_kit", 10],["wood_shack_kit", 10],["workbench_kit", 5]]
#define SM_CINDER_KIT [["plot_pole_kit", 1],["bulk_ItemTankTrap", 1],["ItemPole", 4],["bulk_ItemWire", 1],["CinderBlocks", 32],["MortarBucket", 8],["cinder_door_kit", 1],["cinder_garage_kit", 1],["full_cinder_wall_kit", 8],["half_cinder_wall_kit", 8],["metal_floor_kit", 8],["glass_floor_kit", 4],["glass_floor_half_kit", 8],["glass_floor_quarter_kit", 16],["metal_floor_half_kit", 8],["metal_floor_quarter_kit", 16],["metal_floor4x_kit", 2],["metal_pillar_kit", 4],["half_cinder_wall_gap_kit", 4],["cinderwall_window_kit", 4],["cinder_door_frame_kit", 4],["cinder_door_hatch_kit", 4],["cinder_garage_frame_kit", 2],["cinder_garage_top_open_frame_kit", 2],["cinder_gate_frame_kit", 2],["cinder_bunker_kit", 2],["metal_drawbridge_kit", 2],["ItemComboLock", 2],["bulk_ItemSandbag", 1],["ItemVault", 1],["ItemGunRackKit", 1],["workbench_kit", 1],["ItemWoodCrateKit",1],["ItemFireBarrel_Kit",1],["metal_panel_kit", 8],["ItemCorrugated",8],["ItemMixOil", 1],["ItemJerrycan", 1],["storage_shed_kit", 1],["light_pole_kit", 1]]
#define MD_CINDER_KIT [["plot_pole_kit", 1],["bulk_ItemTankTrap", 2],["ItemPole", 8],["bulk_ItemWire", 2],["CinderBlocks", 64],["MortarBucket", 16],["cinder_door_kit", 2],["cinder_garage_kit", 2],["full_cinder_wall_kit", 16],["half_cinder_wall_kit", 16],["metal_floor_kit", 16],["glass_floor_kit", 4],["glass_floor_half_kit", 8],["glass_floor_quarter_kit", 16],["metal_floor_half_kit", 8],["metal_floor_quarter_kit", 16],["metal_floor4x_kit", 2],["metal_pillar_kit", 4],["half_cinder_wall_gap_kit", 4],["cinderwall_window_kit", 4],["cinder_door_frame_kit", 4],["cinder_door_hatch_kit", 4],["cinder_garage_frame_kit", 2],["cinder_garage_top_open_frame_kit", 2],["cinder_gate_frame_kit", 2],["cinder_bunker_kit", 2],["metal_drawbridge_kit", 2],["ItemComboLock", 4],["bulk_ItemSandbag", 2],["ItemVault", 2],["ItemGunRackKit", 2],["workbench_kit", 1],["ItemWoodCrateKit",2],["ItemFireBarrel_Kit",1],["metal_panel_kit", 16],["ItemCorrugated",16],["ItemMixOil", 2],["ItemJerrycan", 1],["storage_shed_kit", 2],["light_pole_kit", 2]]
#define LG_CINDER_KIT [["plot_pole_kit", 1],["bulk_ItemTankTrap", 3],["ItemPole", 12],["bulk_ItemWire", 3],["CinderBlocks", 96],["MortarBucket", 24],["cinder_door_kit", 3],["cinder_garage_kit", 3],["full_cinder_wall_kit", 24],["half_cinder_wall_kit", 24],["metal_floor_kit", 24],["glass_floor_kit", 4],["glass_floor_half_kit", 8],["glass_floor_quarter_kit", 16],["metal_floor_half_kit", 8],["metal_floor_quarter_kit", 16],["metal_floor4x_kit", 2],["metal_pillar_kit", 4],["half_cinder_wall_gap_kit", 4],["cinderwall_window_kit", 4],["cinder_door_frame_kit", 4],["cinder_door_hatch_kit", 4],["cinder_garage_frame_kit", 2],["cinder_garage_top_open_frame_kit", 2],["cinder_gate_frame_kit", 2],["cinder_bunker_kit", 2],["metal_drawbridge_kit", 2],["ItemComboLock", 6],["bulk_ItemSandbag", 3],["ItemVault", 3],["ItemGunRackKit", 3],["workbench_kit", 1],["ItemWoodCrateKit",3],["ItemFireBarrel_Kit",1],["metal_panel_kit", 24],["ItemCorrugated",24],["ItemMixOil", 3],["ItemJerrycan", 1],["storage_shed_kit", 3],["light_pole_kit", 3]]
#define SM_WOOD_KIT [["ItemWoodFloor", 4],["ItemWoodFloorHalf", 4],["ItemWoodFloorQuarter", 4],["ItemWoodLadder", 2],["ItemWoodStairs", 2],["ItemWoodWallDoorLg", 1],["ItemWoodWallGarageDoor", 1],["ItemWoodWallLg", 4],["ItemWoodWallThird", 3],["ItemWoodWallWindowLg", 4],["ItemWoodWallwithDoorLg", 1],["ItemWoodFloorStairs", 1],["ItemTriangleWoodFloor", 2],["ItemWoodHandRail", 4],["ItemWoodPillar", 4],["ItemTriangleWoodWall", 2],["ItemWoodOpenTopGarageDoor", 1],["ItemWoodGateFrame", 1],["ItemComboLock", 2],["ItemLockbox", 1],["ItemGunRackKit", 1],["workbench_kit", 1],["ItemWoodCrateKit",1],["ItemFireBarrel_Kit",1],["ItemMixOil", 1],["ItemJerrycan", 1]]
#define MD_WOOD_KIT [["ItemWoodFloor", 8],["ItemWoodFloorHalf", 8],["ItemWoodFloorQuarter", 8],["ItemWoodLadder", 4],["ItemWoodStairs", 4],["ItemWoodWallDoorLg", 2],["ItemWoodWallGarageDoor", 2],["ItemWoodWallLg", 8],["ItemWoodWallThird", 6],["ItemWoodWallWindowLg", 8],["ItemWoodWallwithDoorLg", 2],["ItemWoodFloorStairs", 2],["ItemTriangleWoodFloor", 4],["ItemWoodHandRail", 8],["ItemWoodPillar", 8],["ItemTriangleWoodWall", 4],["ItemWoodOpenTopGarageDoor", 2],["ItemWoodGateFrame", 2],["ItemComboLock", 4],["ItemLockbox", 2],["ItemGunRackKit", 2],["workbench_kit", 1],["ItemWoodCrateKit",2],["ItemFireBarrel_Kit",1],["ItemMixOil", 2],["ItemJerrycan", 2]]
#define LG_WOOD_KIT [["ItemWoodFloor", 16],["ItemWoodFloorHalf", 16],["ItemWoodFloorQuarter", 16],["ItemWoodLadder", 6],["ItemWoodStairs", 6],["ItemWoodWallDoorLg", 3],["ItemWoodWallGarageDoor", 3],["ItemWoodWallLg", 16],["ItemWoodWallThird", 12],["ItemWoodWallWindowLg", 16],["ItemWoodWallwithDoorLg", 3],["ItemWoodFloorStairs", 4],["ItemTriangleWoodFloor", 8],["ItemWoodHandRail", 16],["ItemWoodPillar", 16],["ItemTriangleWoodWall", 8],["ItemWoodOpenTopGarageDoor", 4],["ItemWoodGateFrame", 4],["ItemComboLock", 6],["ItemVault", 1],["ItemGunRackKit", 3],["workbench_kit", 1],["ItemWoodCrateKit",3],["ItemFireBarrel_Kit",1],["ItemMixOil", 3],["ItemJerrycan", 3]]
#define VANILLA_KIT [["woodfence_foundation_kit", 10],["woodfence_frame_kit", 10],["woodfence_quaterpanel_kit", 10],["woodfence_halfpanel_kit", 10],["woodfence_thirdpanel_kit", 10],["woodfence_1_kit", 10],["woodfence_2_kit", 10],["woodfence_3_kit", 10],["woodfence_4_kit", 10],["woodfence_5_kit", 10],["woodfence_6_kit", 10],["woodfence_7_kit", 10],["metalfence_foundation_kit", 10],["metalfence_frame_kit", 10],["metalfence_halfpanel_kit", 10],["metalfence_thirdpanel_kit", 10],["metalfence_1_kit", 10],["metalfence_2_kit", 10],["metalfence_3_kit", 10],["metalfence_4_kit", 10],["metalfence_5_kit", 10],["metalfence_6_kit", 10],["metalfence_7_kit", 10],["woodfence_gate_foundation_kit", 10],["woodfence_gate_1_kit", 10],["woodfence_gate_2_kit", 10],["woodfence_gate_3_kit", 10],["woodfence_gate_4_kit", 10]];
// Epoch Weapons
#define EPOCH_WEPS ["AK74_Kobra_DZ","AK74_Kobra_SD_DZ","AK74_GL_Kobra_DZ","AK74_GL_Kobra_SD_DZ","AK74_DZ","AK74_SD_DZ","AK74_GL_DZ","AK74_GL_SD_DZ","AK74_PSO1_DZ","AK74_PSO1_SD_DZ","AK74_GL_PSO1_DZ","AK74_GL_PSO1_SD_DZ","AK107_Kobra_DZ","AK107_DZ","AK107_GL_DZ","AK107_PSO_DZ","AK107_GL_PSO_DZ","AK107_GL_Kobra_DZ","AN94_DZ","AN94_GL_DZ","AKS74U_Kobra_DZ","AKS74U_Kobra_SD_DZ","AKS74U_DZ","AKS74U_SD_DZ","AKM_DZ","AKM_Kobra_DZ","AKM_PSO1_DZ","AKS_Gold_DZ","AKS_Silver_DZ","AKS_DZ","RK95_DZ","RK95_SD_DZ","RK95_CCO_SD_DZ","RK95_ACOG_SD_DZ","RK95_CCO_DZ","RK95_ACOG_DZ","Groza9_DZ","Groza9_Sniper_DZ","Groza9_GL_DZ","Groza9_GL_Sniper_DZ","Groza9_SD_DZ","Groza9_Sniper_SD_DZ","Groza1_DZ","Groza1_Sniper_DZ","Groza1_SD_DZ","Groza1_Sniper_SD_DZ","SCAR_H_AK_DZ","SCAR_H_AK_CCO_DZ","SCAR_H_B_AK_CCO_DZ","SCAR_H_AK_HOLO_DZ","SCAR_H_AK_ACOG_DZ","RPK_DZ","RPK_Kobra_DZ","RPK_PSO1_DZ","DMR_DZ","DMR_SKN","DMR_Gh_DZ","DMR_DZE","DMR_Gh_DZE","RSASS_DZ","RSASS_TWS_DZ","RSASS_SD_DZ","RSASS_TWS_SD_DZ","FNFAL_DZ","FNFAL_CCO_DZ","FNFAL_Holo_DZ","FNFAL_ANPVS4_DZ","FN_FAL_ANPVS4_DZE","G3_DZ","G36K_Camo_DZ","G36K_Camo_SD_DZ","G36A_Camo_DZ","G36A_Camo_SD_DZ","G36C_DZ","G36C_SD_DZ","G36C_CCO_DZ","G36C_CCO_SD_DZ","G36C_Holo_DZ","G36C_Holo_SD_DZ","G36C_ACOG_DZ","G36C_ACOG_SD_DZ","G36C_Camo_DZ","G36C_Camo_Holo_SD_DZ","MG36_DZ","MG36_Camo_DZ","M4A1_DZ","M4A1_FL_DZ","M4A1_MFL_DZ","M4A1_SD_DZ","M4A1_SD_FL_DZ","M4A1_SD_MFL_DZ","M4A1_GL_DZ","M4A1_GL_FL_DZ","M4A1_GL_MFL_DZ","M4A1_GL_SD_DZ","M4A1_GL_SD_FL_DZ","M4A1_GL_SD_MFL_DZ","M4A1_CCO_DZ","M4A1_CCO_FL_DZ","M4A1_CCO_MFL_DZ","M4A1_CCO_SD_DZ","M4A1_CCO_SD_FL_DZ","M4A1_CCO_SD_MFL_DZ","M4A1_GL_CCO_DZ","M4A1_GL_CCO_FL_DZ","M4A1_GL_CCO_MFL_DZ","M4A1_GL_CCO_SD_DZ","M4A1_GL_CCO_SD_FL_DZ","M4A1_GL_CCO_SD_MFL_DZ","M4A1_Holo_DZ","M4A1_Holo_FL_DZ","M4A1_Holo_MFL_DZ","M4A1_Holo_SD_DZ","M4A1_Holo_SD_FL_DZ","M4A1_Holo_SD_MFL_DZ","M4A1_GL_Holo_DZ","M4A1_GL_Holo_FL_DZ","M4A1_GL_Holo_MFL_DZ","M4A1_GL_Holo_SD_DZ","M4A1_GL_Holo_SD_FL_DZ","M4A1_GL_Holo_SD_MFL_DZ","M4A1_ACOG_DZ","M4A1_ACOG_FL_DZ","M4A1_ACOG_MFL_DZ","M4A1_ACOG_SD_DZ","M4A1_ACOG_SD_FL_DZ","M4A1_ACOG_SD_MFL_DZ","M4A1_GL_ACOG_DZ","M4A1_GL_ACOG_FL_DZ","M4A1_GL_ACOG_MFL_DZ","M4A1_GL_ACOG_SD_DZ","M4A1_GL_ACOG_SD_FL_DZ","M4A1_GL_ACOG_SD_MFL_DZ","M4A1_Rusty_DZ","M4A1_Camo_CCO_DZ","M4A1_Camo_CCO_SD_DZ","M4A1_Camo_Holo_GL_DZ","M4A1_Camo_Holo_GL_SD_DZ","M4A3_DES_CCO_DZ","M4A3_ACOG_GL_DZ","M4A3_Camo_DZ","M4A3_Camo_ACOG_DZ","HK416_DZ","HK416_SD_DZ","HK416_GL_DZ","HK416_GL_SD_DZ","HK416_CCO_DZ","HK416_CCO_SD_DZ","HK416_GL_CCO_DZ","HK416_GL_CCO_SD_DZ","HK416_Holo_DZ","HK416_Holo_SD_DZ","HK416_GL_Holo_DZ","HK416C_DZ","HK416C_GL_DZ","HK416C_CCO_DZ","HK416C_GL_CCO_DZ","HK416C_Holo_DZ","HK416C_GL_Holo_DZ","HK416C_ACOG_DZ","HK416C_GL_ACOG_DZ","SteyrAug_A3_Green_DZ","SteyrAug_A3_Black_DZ","SteyrAug_A3_Blue_DZ","SteyrAug_A3_ACOG_Green_DZ","SteyrAug_A3_ACOG_Black_DZ","SteyrAug_A3_ACOG_Blue_DZ","SteyrAug_A3_Holo_Green_DZ","SteyrAug_A3_Holo_Black_DZ","SteyrAug_A3_Holo_Blue_DZ","SteyrAug_A3_GL_Green_DZ","SteyrAug_A3_GL_Black_DZ","SteyrAug_A3_GL_Blue_DZ","SteyrAug_A3_ACOG_GL_Green_DZ","SteyrAug_A3_ACOG_GL_Black_DZ","SteyrAug_A3_ACOG_GL_Blue_DZ","SteyrAug_A3_Holo_GL_Green_DZ","SteyrAug_A3_Holo_GL_Black_DZ","SteyrAug_A3_Holo_GL_Blue_DZ","HK53A3_DZ","HK53A3_CCO_DZ","HK53A3_Holo_DZ","PDR_DZ","PDR_CCO_DZ","PDR_Holo_DZ","Famas_DZ","Famas_CCO_DZ","Famas_Holo_DZ","Famas_SD_DZ","Famas_CCO_SD_DZ","Famas_Holo_SD_DZ","ACR_WDL_DZ","ACR_WDL_SD_DZ","ACR_WDL_GL_DZ","ACR_WDL_GL_SD_DZ","ACR_WDL_CCO_DZ","ACR_WDL_CCO_SD_DZ","ACR_WDL_CCO_GL_DZ","ACR_WDL_CCO_GL_SD_DZ","ACR_WDL_Holo_DZ","ACR_WDL_Holo_SD_DZ","ACR_WDL_Holo_GL_DZ","ACR_WDL_Holo_GL_SD_DZ","ACR_WDL_ACOG_DZ","ACR_WDL_ACOG_SD_DZ","ACR_WDL_ACOG_GL_DZ","ACR_WDL_ACOG_GL_SD_DZ","ACR_WDL_TWS_DZ","ACR_WDL_TWS_GL_DZ","ACR_WDL_TWS_SD_DZ","ACR_WDL_TWS_GL_SD_DZ","ACR_WDL_NV_DZ","ACR_WDL_NV_SD_DZ","ACR_WDL_NV_GL_DZ","ACR_WDL_NV_GL_SD_DZ","ACR_BL_DZ","ACR_BL_SD_DZ","ACR_BL_GL_DZ","ACR_BL_GL_SD_DZ","ACR_BL_CCO_DZ","ACR_BL_CCO_SD_DZ","ACR_BL_CCO_GL_DZ","ACR_BL_CCO_GL_SD_DZ","ACR_BL_Holo_DZ","ACR_BL_Holo_SD_DZ","ACR_BL_Holo_GL_DZ","ACR_BL_Holo_GL_SD_DZ","ACR_BL_ACOG_DZ","AC
// Overwatch Weapons
#define OW_WEPS ["RH_m9","RH_m9c","RH_m93r","RH_M9sd","RH_m9csd","RH_browninghp","vil_B_HP","RH_anac","RH_anacg","RH_python","RH_deagle","RH_Deagleg","RH_Deaglem","RH_Deaglemzb","RH_Deaglemz","RH_Deagles","vil_Glock","RH_g17","vil_Glock_o","RH_g17sd","RH_g18","RH_g19","RH_g19t","RH_tec9","RH_m1911","RH_m1911sd","RH_m1911old","RH_mk22","RH_mk22sd","RH_mk22v","RH_mk22vsd","RH_p38","RH_ppk","RH_mk2","RH_p226","RH_p226s","RH_bull","RH_tt33","RH_usp","RH_uspm","RH_uspsd","vil_USP45","vil_USP45SD","vil_USP","vil_USPSD","RH_vz61", "vil_AEK2","vil_AEK_GL","vil_AeK_3","vil_AeK_23","vil_AeK_3_K","vil_AK_105","Vil_AK_105_c","vil_AK_101","vil_AK_103","vil_AK_107","Vil_AK_107_c","vil_ak12","vil_ak12_ap","vil_ak12_gp","vil_AK_47","vil_AK_47_49","vil_AK_47_m1","vil_AK_47","vil_AK_74_N","vil_AK_74P","vil_AK_74m","vil_AK_74m_p29","vil_AK_74m_EOT_Alfa","vil_AK_74m_gp_29","vil_AK_74m_gp","vil_AK_74m_EOT","vil_AK_74m_EOT_FSB","vil_AK_74m_EOT_FSB_60","vil_AK_74m_EOT_FSB_45","vil_AK_74m_c","vil_AK_74m_k","vil_AK_74m_PSO","vil_AKM","vil_AKM_GL","vil_AKMS","vil_AKMS_GP25","vil_AKMSB","vil_AKS_47","vil_AKS_74","vil_AKS_74_gp","vil_AKS_74p_gp","vil_AKS_74p","vil_AKS_74p_45","vil_AKs_74_u","vil_AKs_74_u45","Vil_AKS_74_UB","Vil_AKS_74_UN_kobra","vil_AMD63","vil_AMD","vil_Abakan","vil_Abakan_P29","vil_Abakan_gp","vil_AK_nato_m1","vil_ASH82","vil_MPi","vil_PMI74S","vil_PMI","vil_PMIS","vil_type88_1","vil_M64","vil_M70","vil_M70B","vil_AK_nato_m80", "vil_Galil","vil_Galil_arm","vil_SKS","gms_k98","gms_k98_knife","gms_k98_rg","gms_k98zf39","FH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CO","SCAR_H_CQC_CCO_SD","SCAR_H_STD_EGLM_Spect","SCAR_H_LNG_Sniper","SCAR_H_LNG_Sniper_SD","vil_9a91","vil_9a91_c","vil_9a91_csd","vil_VAL","vil_VAL_C","vil_Groza_HG","vil_Groza_GL","vil_Groza_SC","vil_Groza_SD","vil_Vikhr","vil_vsk94","vil_MP5_EOTech","vil_MP5SD_EOTech","vil_uzimini","vil_uzimini_SD","vil_uzi","vil_uzi_c","vil_uzi_SD", "USSR_cheytacM200","USSR_cheytacM200
//_activatingPlayer = _this select 0;
//_params = _this select 1;
//_clientKey = _this select 2;
local _selectDelay = _params select 0;
local _crate = _params select 1;
local _dir = _params select 2;
local _pos = _params select 3;
//_playerUID = getPlayerUID _activatingPlayer;
local _spawnCrate = "";
_exitReason = [_this,"EAT_crateSpawn",(_worldspace select 1),_clientKey,_playerUID,_activatingPlayer] call server_verifySender;
if (_exitReason != "") exitWith {diag_log _exitReason};
call
{
if (_crate == "Items") exitWith {
CRATE_SETUP
ADD_BACKPACK
local _parents = ["FakeMagazine","ItemAntibiotic","ItemSodaEmpty","ItemWaterBottle","TrashTinCan"];
local _ignore = ["bloodBagBase","SkinBase","wholeBloodBagBase","ItemAntibiotic_base","ItemAntibioticEmpty","ItemBriefcase_Base","ItemBriefcaseEmpty","ItemSilvercase_Base","ItemSodaEmpty","TrashTinCan","ItemFuelcanEmpty","ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
local _cfg = configFile >> "cfgMagazines";
for "_i" from 0 to (count _cfg) - 1 do {
local _type = _cfg select _i;
local _item = configName _type;
if (isClass _type && {getNumber (_type >> "scope") > 1} && {!(_item in _ignore)} && {!(configName(inheritsFrom _type) in _parents)} && {!(["Rnd",_item] call fnc_inString)} && {!(["_Swing",_item] call fnc_inString)} && {!(["cinder_",_item] call fnc_inString)} && {!(["metal_",_item] call fnc_inString)} && {!(["ItemWood",_item] call fnc_inString)} && {!(["PartWood",_item] call fnc_inString)}) then {
_spawnCrate addMagazineCargoGlobal [_item, 5];
};
};
local _cfg = configFile >> "cfgWeapons";
local _parents = ["FakeWeapon","ItemMatchbox"];
local _ignore = ["ItemCore","ItemKnife_Base","ItemMatchbox_base"];
for "_i" from 0 to (count _cfg) - 1 do {
local _type = _cfg select _i;
local _item = configName _type;
if (isClass _type && {isNumber (_type >> "type")} && {!(configName(inheritsFrom(_type)) in _parents)} && {!isNumber (_type >> "keyid")} && {!(_item in _ignore)}) then {
if (getNumber (_type >> "type") == 131072) then {
_spawnCrate addWeaponCargoGlobal [_item, 1];
};
};
};
};
if (_crate == "Backpack") exitWith {
CRATE_SETUP
{_spawnCrate addBackpackCargoGlobal [_x, 1];} forEach BACKPACKS;
};
if (_crate == "AllItemsBuilding") exitWith {
CRATE_SETUP
ADD_5X BUILDING_TOOLS;
ADD ADMIN_BUILD_CRATE;
ADD_BACKPACK
};
if (_crate == "smallCinderBuildingKit") exitWith {
CRATE_SETUP
ADD_1X BUILDING_TOOLS;
ADD SM_CINDER_KIT;
ADD_BACKPACK
};
if (_crate == "mediumCinderBuildingKit") exitWith {
CRATE_SETUP
ADD_1X BUILDING_TOOLS;
ADD MD_CINDER_KIT;
ADD_BACKPACK
};
if (_crate == "largeCinderBuildingKit") exitWith {
CRATE_SETUP
ADD_1X BUILDING_TOOLS;
ADD LG_CINDER_KIT;
ADD_BACKPACK
};
if (_crate == "smallWoodBuildingKit") exitWith {
CRATE_SETUP
ADD_1X BUILDING_TOOLS;
ADD SM_WOOD_KIT;
ADD_BACKPACK
};
if (_crate == "mediumWoodBuildingKit") exitWith {
CRATE_SETUP
ADD_1X BUILDING_TOOLS;
ADD MD_WOOD_KIT;
ADD_BACKPACK
};
if (_crate == "largeWoodBuildingKit") exitWith {
CRATE_SETUP
ADD_1X BUILDING_TOOLS;
ADD LG_WOOD_KIT;
ADD_BACKPACK
};
if (_crate == "VanillaBuildKit") exitWith {
CRATE_SETUP
ADD_1X ["ItemToolbox","ItemEtool"];
ADD VANILLA_KIT;
ADD_BACKPACK
};
if (_crate == "EpochWeapons") exitWith {
CRATE_SETUP
local _tArr = []; // Create temp array to prevent duplicate magazine spawning
local _mag = "";
{
_spawnCrate addWeaponCargoGlobal [_x, 1];
local _ammo = getArray (configFile >> "cfgWeapons" >> _x >> "magazines");
if (count _ammo > 0) then {
_mag = _ammo select 0;
if !(_mag in _tArr) then {
_spawnCrate addMagazineCargoGlobal [_mag, 30];
_tArr set [count _tArr, _mag];
};
};
} forEach EPOCH_WEPS;
ADD_BACKPACK
};
if (_crate == "OverwatchWeapons") exitWith {
CRATE_SETUP
local _tArr = []; // Create temp array to prevent duplicate magazine spawning
local _mag = "";
{
_spawnCrate addWeaponCargoGlobal [_x, 1];
local _ammo = getArray (configFile >> "cfgWeapons" >> _x >> "magazines");
if (count _ammo > 0) then {
_mag = _ammo select 0;
if !(_mag in _tArr) then {
_spawnCrate addMagazineCargoGlobal [_mag, 30];
_tArr set [count _tArr, _mag];
};
};
} forEach OW_WEPS;
ADD_BACKPACK
};
if (_crate == "RocketLaunchers") exitWith {
CRATE_SETUP
ADD_BACKPACK
local _tArr = []; // Create temp array to prevent duplicate magazine spawning
local _mag = "";
local _ignore = ["LauncherCore","Launcher"];
local _cfg = configFile >> "cfgWeapons";
for "_i" from 0 to (count _cfg) - 1 do {
local _type = _cfg select _i;
local _item = configName _type;
if (isClass _type && {isNumber (_type >> "type")} && {!(_item in _ignore)}) then {
if (getNumber (_type >> "type") == 4) then { // type 4 is launcher
_spawnCrate addWeaponCargoGlobal [_item, 1];
local _ammo = getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_mag = _ammo select 0;
if !(_mag in _tArr) then {
_spawnCrate addMagazineCargoGlobal [_mag, 5];
_tArr set [count _tArr, _mag];
};
};
};
};
};
};
};
if (_selectDelay != 0) exitWith {
[_selectDelay,_spawnCrate] spawn {
uiSleep (_this select 0);
deleteVehicle (_this select 1);
};
};