Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Random gear lists
- _uniforms = [""];
- _vests = [""];
- _helmets = [""];
- _goggles = [""];
- _backpacks = [""];
- _genericUnits = [""];
- _typesofUnit = toLower (_this select 0);
- _unit = _this select 1;
- removeBackpack _unit;
- removeAllWeapons _unit;
- removeAllItemsWithMagazines _unit;
- removeAllAssignedItems _unit;
- switch (_typeofUnit) do
- {
- //Copy paste the case below and add the units you need here
- case "r": {
- //ARSENAL CODE HERE
- };
- //Note that these crates are empty, the insides of the crates are generated dynamically from the items/ammo that the units above have
- case "crate_small": {
- clearWeaponCargoGlobal _unit;
- clearMagazineCargoGlobal _unit;
- clearItemCargoGlobal _unit;
- clearBackpackCargoGlobal _unit;
- };
- case "crate_med": {
- clearWeaponCargoGlobal _unit;
- clearMagazineCargoGlobal _unit;
- clearItemCargoGlobal _unit;
- clearBackpackCargoGlobal _unit;
- };
- case "crate_large": {
- clearWeaponCargoGlobal _unit;
- clearMagazineCargoGlobal _unit;
- clearItemCargoGlobal _unit;
- clearBackpackCargoGlobal _unit;
- };
- //Default class
- default {
- _unit addmagazines ["30Rnd_65x39_caseless_mag",7];
- _unit addweapon "arifle_MX_pointer_F";
- _unit selectweapon primaryweapon _unit;
- if (true) exitwith {
- player globalchat format ["DEBUG: Unit = %1. Gear template %2 does not exist, used Rifleman instead.", _unit, _typeofunit]
- };
- };
- };
- //Now we deal with the units that want random clothes
- //i.e we store all of the items in the clothing in an array, replace the clothing and then re-add all the items
- if(_typeofUnit in _genericUnits) then {
- _backpackItems = backpackItems _unit;
- removeBackpack _unit;
- _unit addBackpack selectrandom _backpacks;
- {
- _unit addItemToBackpack _x;
- } forEach _backpackItems;
- _vestitems = vestItems _unit;
- removeVest _unit;
- _unit addvest selectRandom _vests;
- { _unit addItemToVest _x; } forEach _vestitems;
- _uniformitems = uniformItems _unit;
- removeUniform _unit;
- _unit forceAddUniform selectRandom _uniforms;
- {
- _unit addItemToUniform _x;
- } forEach _uniformitems;
- removeGoggles _unit;
- _unit addGoggles selectRandom _goggles;
- removeHeadgear _unit;
- _unit addHeadgear selectRandom _helmets;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement