Erzengel

Weaponjam and Supply on smoke

14 posts in this topic

Hi, as i quit exile editing and starting the development of a little own mod i decided to do a quick tutorial on my latest changes, including supplydrops called by the player and jamming weapons with a customizable jamming chance.

 

the installation is as easy as i could be just paste the following code at the bottom of your initPlayerlocal.sqf

Spoiler

		///////////////////////////////////////////////////////
		// Weapon Jam & Supplysmoke
		///////////////////////////////////////////////////////

		player addAction ["", {
			playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0];
		}, "", 0, false, true, "DefaultAction", "isNil 'allowFire'"];

		allowFire = true;

		KK_fnc_playerWeaponMulfunction = {
			_frame = diag_frameno;
			_wep = currentWeapon _this;
			_ammo = _this ammo _wep;
			if (_ammo > 0) then {
			allowFire = nil;
			_this setAmmo [_wep, 0];
			waitUntil {_frame < diag_frameno};
			_this setAmmo [_wep, _ammo];
			["ErrorTitleOnly", ["Your weapon jammed!"]] call ExileClient_gui_toaster_addTemplateToast;
			menu = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) in actionKeys ""ReloadMagazine"") then {allowFire = true;}"];
		};
		};

		player addEventHandler ["Fired", {
			if (random 1 < 0.0033) then {
			player spawn KK_fnc_playerWeaponMulfunction
			};
			if ((_this select 5) isKindOf "smokeShellGreen") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate additemCargoGlobal ["Exile_Item_PlasticBottleFreshWater",10];
			_arsenalCrate additemCargoGlobal ["Exitem_franta",2];
			_arsenalCrate additemCargoGlobal ["Exitem_redgull",2];
			_arsenalCrate additemCargoGlobal ["Exitem_spirit",2];
			_arsenalCrate additemCargoGlobal ["Exitem_bakedbeans",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_crunchin",2];
			_arsenalCrate additemCargoGlobal ["Exitem_canteen_coffee",2];
			_arsenalCrate additemCargoGlobal ["Exitem_canteen_fresh",2];
			_arsenalCrate additemCargoGlobal ["Exitem_canteen",2];
			_arsenalCrate additemCargoGlobal ["Exitem_rice",2];
			_arsenalCrate additemCargoGlobal ["Exitem_container",2];
			_arsenalCrate additemCargoGlobal ["Exitem_container_soup",2];
			_arsenalCrate additemCargoGlobal ["Exitem_container_beef",2];
			_arsenalCrate additemCargoGlobal ["Exitem_tacticalbacon",2];
			_arsenalCrate additemCargoGlobal ["Exitem_spam",2];
			_arsenalCrate additemCargoGlobal ["Exitem_tuna",2];
			_arsenalCrate additemCargoGlobal ["Exitem_spaghetti",2];
			_arsenalCrate additemCargoGlobal ["Exitem_meatballs",2];
			_arsenalCrate additemCargoGlobal ["Exitem_hotdogs",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_bloodsucker",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_honeyhoops",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_squares",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_stars",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_kush",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_rick",2];
			_arsenalCrate addbackpackcargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellRed") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate addWeaponCargoGlobal ["hlc_rifle_FAL5061",1];
			_arsenalCrate additemCargoGlobal ["hlc_20Rnd_762x51_B_fal",8];
			_arsenalCrate addWeaponCargoGlobal ["hlc_lmg_MG42",1];
			_arsenalCrate additemCargoGlobal ["hlc_100Rnd_792x57_B_MG42",6];
			_arsenalCrate addWeaponCargoGlobal ["hlc_rifle_M1903A1_unertl",1];
			_arsenalCrate additemCargoGlobal ["hlc_5rnd_3006_1903",6];
			_arsenalCrate addWeaponCargoGlobal ["hlc_rifle_auga2lsw",1];
			_arsenalCrate additemCargoGlobal ["hlc_40Rnd_556x45_B_AUG",6];
			_arsenalCrate additemCargoGlobal ["hlc_muzzle_snds_a6AUG",1];
			_arsenalCrate addbackpackcargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellBlue") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate addWeaponCargoGlobal ["arifle_SDAR_F",2];
			_arsenalCrate additemCargoGlobal ["20Rnd_556x45_UW_mag",16];
			_arsenalCrate additemCargoGlobal ["Exile_Uniform_Wetsuit_NATO",2];
			_arsenalCrate additemCargoGlobal ["V_RebreatherB",2];
			_arsenalCrate additemCargoGlobal ["Exile_Glasses_Diving_NATO",2];
			_arsenalCrate addbackpackcargoGlobal ["B_FieldPack_blk",2];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellOrange") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate addWeaponCargoGlobal ["hgun_G17_F",1];
			_arsenalCrate additemCargoGlobal ["muzzle_snds_L",1];
			_arsenalCrate additemCargoGlobal ["16Rnd_9x21_Mag",5];
			_arsenalCrate additemCargoGlobal ["Exitem_documents",2];
			_arsenalCrate addbackpackcargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellPurple") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate additemCargoGlobal ["Exile_Item_SafeSmallKit",1];
			_arsenalCrate addbackpackcargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellYellow") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate addWeaponCargoGlobal ["hlc_rifle_awmagnum_FDE",1];
			_arsenalCrate additemCargoGlobal ["hlc_5rnd_300WM_FMJ_AWM",5];
			_arsenalCrate additemCargoGlobal ["H_Ghillie_Suit1",1];
			_arsenalCrate additemCargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
}];

 

iam pretty sure if you know what you are doing you will easly find out on your own how to customize the dropped loot, how ever the jamming rate can be changed by the 0.0033 in the 2nd block of the code and is currently set to 0.33% per bullet.

 

keep in mind that you will have to make this part of your init execute after the client loaded in compltly so consider to add

waitUntil {!isNull findDisplay 46};

above my code in case you dont allready have it in your .sqf

 

If you have anymore questions just ask but keep in mind that i just visit this forum kind of rarely so u might what to add me on steam if you have any questions (post in profilecomments so i can be sure is not csgo scam attemt ^^)

https://steamcommunity.com/id/erzengelgames/

 

Enjoy the script and have a nice day :-)

 

[EVERY SPELLING MISTAKE IS NO MISTAKE IT'S A GERMAN FEATCHER]

Edited by Erzengel
Formatting
  • Like 2

Share this post


Link to post
Share on other sites
Advertisement

The weapon jam part is not working for me.

I added this
 

			waitUntil {!isNull findDisplay 46};
			player addAction ["", {
			playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0];
		}, "", 0, false, true, "DefaultAction", "isNil 'allowFire'"];

		allowFire = true;

		KK_fnc_playerWeaponMulfunction = {
			_frame = diag_frameno;
			_wep = currentWeapon _this;
			_ammo = _this ammo _wep;
			if (_ammo > 0) then {
			allowFire = nil;
			_this setAmmo [_wep, 0];
			waitUntil {_frame < diag_frameno};
			_this setAmmo [_wep, _ammo];
			["ErrorTitleOnly", ["Your weapon jammed!"]] call ExileClient_gui_toaster_addTemplateToast;
			menu = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) in actionKeys ""ReloadMagazine"") then {allowFire = true;}"];
		};
		};

		player addEventHandler ["Fired", {
			if (random 1 < 0.0033) then {
			player spawn KK_fnc_playerWeaponMulfunction
			};

 

Edited by El Rabito

Share this post


Link to post
Share on other sites
On 23/05/2018 at 3:13 AM, Erzengel said:

Hi, as i quit exile editing and starting the development of a little own mod i decided to do a quick tutorial on my latest changes, including supplydrops called by the player and jamming weapons with a customizable jamming chance.

 

the installation is as easy as i could be just paste the following code at the bottom of your initPlayerlocal.sqf

  Reveal hidden contents


		///////////////////////////////////////////////////////
		// Weapon Jam & Supplysmoke
		///////////////////////////////////////////////////////

		player addAction ["", {
			playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0];
		}, "", 0, false, true, "DefaultAction", "isNil 'allowFire'"];

		allowFire = true;

		KK_fnc_playerWeaponMulfunction = {
			_frame = diag_frameno;
			_wep = currentWeapon _this;
			_ammo = _this ammo _wep;
			if (_ammo > 0) then {
			allowFire = nil;
			_this setAmmo [_wep, 0];
			waitUntil {_frame < diag_frameno};
			_this setAmmo [_wep, _ammo];
			["ErrorTitleOnly", ["Your weapon jammed!"]] call ExileClient_gui_toaster_addTemplateToast;
			menu = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) in actionKeys ""ReloadMagazine"") then {allowFire = true;}"];
		};
		};

		player addEventHandler ["Fired", {
			if (random 1 < 0.0033) then {
			player spawn KK_fnc_playerWeaponMulfunction
			};
			if ((_this select 5) isKindOf "smokeShellGreen") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate additemCargoGlobal ["Exile_Item_PlasticBottleFreshWater",10];
			_arsenalCrate additemCargoGlobal ["Exitem_franta",2];
			_arsenalCrate additemCargoGlobal ["Exitem_redgull",2];
			_arsenalCrate additemCargoGlobal ["Exitem_spirit",2];
			_arsenalCrate additemCargoGlobal ["Exitem_bakedbeans",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_crunchin",2];
			_arsenalCrate additemCargoGlobal ["Exitem_canteen_coffee",2];
			_arsenalCrate additemCargoGlobal ["Exitem_canteen_fresh",2];
			_arsenalCrate additemCargoGlobal ["Exitem_canteen",2];
			_arsenalCrate additemCargoGlobal ["Exitem_rice",2];
			_arsenalCrate additemCargoGlobal ["Exitem_container",2];
			_arsenalCrate additemCargoGlobal ["Exitem_container_soup",2];
			_arsenalCrate additemCargoGlobal ["Exitem_container_beef",2];
			_arsenalCrate additemCargoGlobal ["Exitem_tacticalbacon",2];
			_arsenalCrate additemCargoGlobal ["Exitem_spam",2];
			_arsenalCrate additemCargoGlobal ["Exitem_tuna",2];
			_arsenalCrate additemCargoGlobal ["Exitem_spaghetti",2];
			_arsenalCrate additemCargoGlobal ["Exitem_meatballs",2];
			_arsenalCrate additemCargoGlobal ["Exitem_hotdogs",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_bloodsucker",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_honeyhoops",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_squares",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_stars",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_kush",2];
			_arsenalCrate additemCargoGlobal ["Exitem_cereal_rick",2];
			_arsenalCrate addbackpackcargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "SmokeShellGreen" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellRed") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate addWeaponCargoGlobal ["hlc_rifle_FAL5061",1];
			_arsenalCrate additemCargoGlobal ["hlc_20Rnd_762x51_B_fal",8];
			_arsenalCrate addWeaponCargoGlobal ["hlc_lmg_MG42",1];
			_arsenalCrate additemCargoGlobal ["hlc_100Rnd_792x57_B_MG42",6];
			_arsenalCrate addWeaponCargoGlobal ["hlc_rifle_M1903A1_unertl",1];
			_arsenalCrate additemCargoGlobal ["hlc_5rnd_3006_1903",6];
			_arsenalCrate addWeaponCargoGlobal ["hlc_rifle_auga2lsw",1];
			_arsenalCrate additemCargoGlobal ["hlc_40Rnd_556x45_B_AUG",6];
			_arsenalCrate additemCargoGlobal ["hlc_muzzle_snds_a6AUG",1];
			_arsenalCrate addbackpackcargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "SmokeShellRed" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellBlue") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate addWeaponCargoGlobal ["arifle_SDAR_F",2];
			_arsenalCrate additemCargoGlobal ["20Rnd_556x45_UW_mag",16];
			_arsenalCrate additemCargoGlobal ["Exile_Uniform_Wetsuit_NATO",2];
			_arsenalCrate additemCargoGlobal ["V_RebreatherB",2];
			_arsenalCrate additemCargoGlobal ["Exile_Glasses_Diving_NATO",2];
			_arsenalCrate addbackpackcargoGlobal ["B_FieldPack_blk",2];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "smokeShellBlue" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellOrange") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate addWeaponCargoGlobal ["hgun_G17_F",1];
			_arsenalCrate additemCargoGlobal ["muzzle_snds_L",1];
			_arsenalCrate additemCargoGlobal ["16Rnd_9x21_Mag",5];
			_arsenalCrate additemCargoGlobal ["Exitem_documents",2];
			_arsenalCrate addbackpackcargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "smokeShellOrange" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellPurple") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate additemCargoGlobal ["Exile_Item_SafeSmallKit",1];
			_arsenalCrate addbackpackcargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "smokeShellPurple" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
	if ((_this select 5) isKindOf "smokeShellYellow") then {
		_grenadeObj = (_this select 6);
        _doArsenalCrateDrop = [_grenadeObj] spawn
        {
            ///////////////////////////////////////////////////////////////////////////////////////
            private ["_grenadePos","_grenadeObj"];
            params ["_grenadeObj"];
			["SuccessTitleAndText", ["Supplydrop called", "The supply drop is on its way"]] call ExileClient_gui_toaster_addTemplateToast;
            waitUntil {speed _grenadeObj == 0}; // wait until smoke grenade has stopped moving
            _grenadePos = getPosATL _grenadeObj; // get position of smoke grenade
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrateType = selectRandom ["B_supplyCrate_F","O_supplyCrate_F","I_supplyCrate_F"]; // crate type(s)
			_supplyveh = createVehicle ["B_T_VTOL_01_armed_F", [15000,15000,2000], [], 0, "none"];
			createVehicleCrew _supplyveh;
			Helikoptersupply = _supplyveh;
			Helikoptersupply allowDamage false;
            _arsenalParachuteType = selectRandom ["O_Parachute_02_F"]; // parachute type(s)
			Helikoptersupply move _grenadePos;
			Helikoptersupply flyInHeight 265;
			waitUntil {_grenadePos distance Helikoptersupply <= 300};
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalCrate = createVehicle [ _arsenalCrateType, [(_grenadePos select 0),(_grenadePos select 1), (_grenadePos select 2) + 250], [], 0, "CAN_COLLIDE" ]; // create the crate
            _arsenalCrate allowDamage false; // disallow damage to crate
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply move [15000,15000,2000];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {!isNull _arsenalCrate}; // wait until crate actually exists
            ///////////////////////////////////////////////////////////////////////////////////////
            clearWeaponCargoGlobal _arsenalCrate; // empty crate contents
            clearItemCargoGlobal _arsenalCrate; // empty crate contents
            clearBackpackCargoGlobal _arsenalCrate; // empty crate contents
            clearMagazineCargoGlobal _arsenalCrate; // empty crate contents
            ///////////////////////////////////////////////////////////////////////////////////////
			_arsenalCrate addWeaponCargoGlobal ["hlc_rifle_awmagnum_FDE",1];
			_arsenalCrate additemCargoGlobal ["hlc_5rnd_300WM_FMJ_AWM",5];
			_arsenalCrate additemCargoGlobal ["H_Ghillie_Suit1",1];
			_arsenalCrate additemCargoGlobal ["Exitem_Coyote_Backpack",1];
            ///////////////////////////////////////////////////////////////////////////////////////
            _arsenalChute = createVehicle [ _arsenalParachuteType, [(getPosATL _arsenalCrate select 0),(getPosATL _arsenalCrate select 1), (getPosATL _arsenalCrate select 2)], [], 0, "CAN_COLLIDE" ]; // create the parachute
            _arsenalChute allowDamage false; // disallow damage to parachute
            _arsenalCrate attachTo [_arsenalChute, [0,0,0]]; // attach the crate to the parachute
			uiSleep 9;
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			uiSleep 9;
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
            ///////////////////////////////////////////////////////////////////////////////////////
            waitUntil {getPosATL _arsenalCrate select 2 < 0.2};			// wait until the crate is less than 20cm above terrain level
            detach _arsenalCrate; // detach parachtue from box
			Signal = "smokeShellYellow" createVehicle position _arsenalCrate;
			Signal attachTo [_arsenalCrate];
			Helikoptersupply flyInHeight 200;
			waitUntil {Helikoptersupply distance [0,0,200] <= 300};
			{deleteVehicle _x;}forEach crew Helikoptersupply;deleteVehicle Helikoptersupply;
			uiSleep 500; // sleep for 4 minutes
            deleteVehicle _arsenalCrate; // delete crate
            ///////////////////////////////////////////////////////////////////////////////////////
        };
	};
}];

 

iam pretty sure if you know what you are doing you will easly find out on your own how to customize the dropped loot, how ever the jamming rate can be changed by the 0.0033 in the 2nd block of the code and is currently set to 0.33% per bullet.

 

keep in mind that you will have to make this part of your init execute after the client loaded in compltly so consider to add


waitUntil {!isNull findDisplay 46};

above my code in case you dont allready have it in your .sqf

 

If you have anymore questions just ask but keep in mind that i just visit this forum kind of rarely so u might what to add me on steam if you have any questions (post in profilecomments so i can be sure is not csgo scam attemt ^^)

https://steamcommunity.com/id/erzengelgames/

 

Enjoy the script and have a nice day :-)

 

[EVERY SPELLING MISTAKE IS NO MISTAKE IT'S A GERMAN FEATCHER]

This looks so cool. I've been looking for something like this that works in Exile for ages.

Share this post


Link to post
Share on other sites
1 hour ago, Cillo said:

This looks so cool. I've been looking for something like this that works in Exile for ages.

iam happy that i can help out :-)

Share this post


Link to post
Share on other sites

@Erzengel I haven't been able to actually try this yet because I'm on holiday, but if I just want the weapon jamming and not the supply smoke, should this work? 

Spoiler

///////////////////////////////////////////////////////
// Weapon Jam & Supplysmoke
///////////////////////////////////////////////////////

player addAction ["", {
	playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0];
}, "", 0, false, true, "DefaultAction", "isNil 'allowFire'"];

allowFire = true;

KK_fnc_playerWeaponMulfunction = {
	_frame = diag_frameno;
	_wep = currentWeapon _this;
	_ammo = _this ammo _wep;
	if (_ammo > 0) then {
	allowFire = nil;
	_this setAmmo [_wep, 0];
	waitUntil {_frame < diag_frameno};
	_this setAmmo [_wep, _ammo];
	["ErrorTitleOnly", ["Your weapon jammed!"]] call ExileClient_gui_toaster_addTemplateToast;
	menu = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) in actionKeys ""ReloadMagazine"") then {allowFire = true;}"];
	};
};

player addEventHandler ["Fired", {
	if (random 1 < 0.0033) then {
	player spawn KK_fnc_playerWeaponMulfunction
	};
};

 

I'm still a bit of an amateur at scripting! Thanks.

  • Like 1

Share this post


Link to post
Share on other sites
On 30.5.2018 at 1:09 AM, Cillo said:

@Erzengel I haven't been able to actually try this yet because I'm on holiday, but if I just want the weapon jamming and not the supply smoke, should this work? 

  Hide contents


///////////////////////////////////////////////////////
// Weapon Jam & Supplysmoke
///////////////////////////////////////////////////////

player addAction ["", {
	playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0];
}, "", 0, false, true, "DefaultAction", "isNil 'allowFire'"];

allowFire = true;

KK_fnc_playerWeaponMulfunction = {
	_frame = diag_frameno;
	_wep = currentWeapon _this;
	_ammo = _this ammo _wep;
	if (_ammo > 0) then {
	allowFire = nil;
	_this setAmmo [_wep, 0];
	waitUntil {_frame < diag_frameno};
	_this setAmmo [_wep, _ammo];
	["ErrorTitleOnly", ["Your weapon jammed!"]] call ExileClient_gui_toaster_addTemplateToast;
	menu = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) in actionKeys ""ReloadMagazine"") then {allowFire = true;}"];
	};
};

player addEventHandler ["Fired", {
	if (random 1 < 0.0033) then {
	player spawn KK_fnc_playerWeaponMulfunction
	};
};

 

I'm still a bit of an amateur at scripting! Thanks.

as am i :-) yeah thats just the jamming funktion. should work like that.

 

i saw you are using mods, i would maybe think about using the ace weaponjam instead. its a bit more advanced

Edited by Erzengel

Share this post


Link to post
Share on other sites

Yeah I've thought about ACE lots of times but I'd rather do stuff with scripts if possible and keep the number of mods  down. I've not encountered a script this simple before, so I'm looking forward to giving it a trial run next week. :D

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.