Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// CBA Keybind and Settings
- [
- "WBK_DualWeapons_WhereWeaponAt",
- "LIST",
- "Where secon weapon is shown",
- "WebKnight's Two Primary Weapons",
- [["Pelvis", "Spine"], ["Pelvis", "Spine"], 0],
- nil,
- {
- params ["_value"];
- WBK_LocalParamWhereWeaponIs = _value;
- }
- ] call CBA_fnc_addSetting;
- ["WebKnight's Two Primary Weapons", "WBK_DualWeapons_MainKeybind", ["Weapon on Back/Switch between weapons", "Put a weapon on a back/Switch current weapon with your second primary weapon."], {
- if (((getText (configfile >> "CfgWeapons" >> currentWeapon player >> "reloadAction")) == (gestureState player)) or !(isNull objectParent player) or (lifeState player == "INCAPACITATED") or (captive player) or !(alive player) or (gestureState player == "WBK_TakeOutWeapon_High") or (gestureState player == "WBK_PutWeaponOnBack_Main") or (gestureState player == "WBK_PistolPutBack") or (gestureState player == "DoubleWeapons_High_Out") or (gestureState player == "DoubleWeapons_Low_Out") or (gestureState player == "DoubleWeapons_High_Take") or (gestureState player == "DoubleWeapons_Low_Take")) exitWith {};
- if (!(isNil {player getVariable "WBK_SecondWeapon"})) exitWith {player spawn WBK_CreateSwitchBetweenWeapons;};
- player spawn WBK_CreateWeaponSecond;
- }, {}, [5, [false, false, false]]] call cba_fnc_addKeybind;
- WBK_CreateSoundEffect = {
- _unit = _this select 0;
- _snd = _this select 1;
- _dist = _this select 2;
- _soundCache = "#particlesource" createVehicle position _unit;
- _soundCache attachTo [_unit, [0, 0, 0.2], "Spine3"];
- [_soundCache, _snd, _dist] call CBA_fnc_globalSay3d;
- sleep 4;
- deleteVehicle _soundCache;
- };
- WBK_CreateSwitchBetweenWeapons = {
- _unit = _this;
- if ((isNil {_unit getVariable "WBK_SecondWeapon"})) exitWith {};
- if (primaryWeapon _unit == "") exitWith {
- [_unit,"WBK_Rifle_TakeBack",15] spawn WBK_CreateSoundEffect;
- _crate = (_unit getVariable "WBK_SecondWeapon") select 0;
- deleteVehicle _crate;
- // Variable Definitions
- _weapAttached = (_unit getVariable "WBK_SecondWeapon") select 1;
- _unit setVariable ["WBK_SecondWeapon",nil,true];
- _weapAttached params ["_weapon","_item1","_item2","_item3","_mag1","_mag2","_item4"];
- _mag1 params ["_magAct","_magCnt"];
- _mag2 params ["_mag2Act","_mag2Cnt"];
- _magLaunch = "";
- if (!(isNil "_mag2Act")) then {
- _magLaunch = _mag2 select 0;
- };
- // Add Weapons, Items and Magazine
- _unit addMagazine _magAct;
- _unit addWeapon _weapon;
- {
- _unit addPrimaryWeaponItem _x;
- } forEach [_item1,_item2,_item3,_item4, _magLaunch];
- _unit setAmmo [primaryWeapon _unit, _magCnt];
- _unit selectWeapon _weapon;
- // Animation
- if (WBK_LocalParamWhereWeaponIs == "Pelvis") then {
- _unit playActionNow "DoubleWeapons_Low_Take";
- _unit playActionNow "DoubleWeapons_Low_Take";
- _unit playActionNow "DoubleWeapons_Low_Take";
- }else{
- _unit playActionNow "DoubleWeapons_High_Take";
- _unit playActionNow "DoubleWeapons_High_Take";
- _unit playActionNow "DoubleWeapons_High_Take";
- };
- };
- if (WBK_LocalParamWhereWeaponIs == "Pelvis") then {
- _unit spawn WBK_SwapWeapons_ByPlayer_Pelvis;
- }else{
- _unit spawn WBK_SwapWeapons_ByPlayer_Spine;
- };
- };
- WBK_CreateWeaponSecond = {
- _unit = _this;
- if (!(isNil {_unit getVariable "WBK_SecondWeapon"})) exitWith {};
- if (WBK_LocalParamWhereWeaponIs == "Pelvis") then {
- _unit playActionNow "DoubleWeapons_Low_Out";
- _unit playActionNow "DoubleWeapons_Low_Out";
- _unit playActionNow "DoubleWeapons_Low_Out";
- }
- else
- {
- _unit playActionNow "DoubleWeapons_High_Out";
- _unit playActionNow "DoubleWeapons_High_Out";
- _unit playActionNow "DoubleWeapons_High_Out";
- };
- switch true do {
- case (stance _unit == "CROUCH"): {_unit switchMove "AmovPknlMstpSrasWrflDnon_AmovPknlMstpSnonWnonDnon";_unit playMoveNow "AmovPknlMstpSrasWrflDnon_AmovPknlMstpSnonWnonDnon";};
- case (stance _unit == "PRONE"): {_unit switchMove "AmovPpneMstpSrasWrflDnon_AmovPpneMstpSnonWnonDnon";_unit playMoveNow "AmovPpneMstpSrasWrflDnon_AmovPpneMstpSnonWnonDnon";};
- };
- [_unit,"WBK_PutInSlot",15] spawn WBK_CreateSoundEffect;
- _weap = primaryWeapon _unit;
- _count = _unit ammo primaryWeapon _unit;
- (primaryWeaponItems _unit) params ["_primaryWeaponItems1","_primaryWeaponItems2","_primaryWeaponItems3","_primaryWeaponItems4"];
- (primaryWeaponMagazine _unit) params ["_primaryWeaponMagazine1","_primaryWeaponMagazineGl"];
- _primaryWeaponMagazine2 = [];
- if (!(isNil "_primaryWeaponMagazineGl")) then {
- _primaryWeaponMagazine2 = [_primaryWeaponMagazineGl,getNumber(configFile >> "CfgMagazines" >> _primaryWeaponMagazineGl >> "count")];
- };
- _primaryWeapon = [_weap, _primaryWeaponItems1, _primaryWeaponItems2, _primaryWeaponItems3, [_primaryWeaponMagazine1, _count], _primaryWeaponMagazine2, _primaryWeaponItems4];
- _weaponHolder = createVehicle ["DummyWeapon_Wbk", getPosATL _unit, [], 0, "CAN_COLLIDE"];
- _weaponHolder addWeaponWithAttachmentsCargoGlobal [_primaryWeapon, 1];
- _unit setVariable ["WBK_SecondWeapon",[_weaponHolder,_primaryWeapon],true];
- if (WBK_LocalParamWhereWeaponIs == "Pelvis") then {
- [_unit,_weaponHolder,"Pelvis"] call WBK_AdjustGunPos;
- }
- else
- {
- [_unit,_weaponHolder,"Spine_normal"] call WBK_AdjustGunPos;
- };
- _unit removeWeapon _weap;
- };
- WKB_CreateWeaponSecond_Scripted = {
- Params [
- ["_unit",objNull,[objNull]],
- ["_weap","arifle_MXC_F",[""]],
- ["_primaryWeaponMagazine",["30Rnd_65x39_caseless_mag",""],[[]]],
- ["_silencer","",[""]],
- ["_laser","",[""]],
- ["_optics","",[""]],
- ["_bipod","",[""]]
- ];
- if (!(isNil {_unit getVariable "WBK_SecondWeapon"})) exitWith {};
- _primaryWeaponItems1 = _silencer;
- _primaryWeaponItems2 = _laser;
- _primaryWeaponItems3 = _optics;
- _primaryWeaponItems4 = _bipod;
- _primaryWeaponMagazine params ["_primaryWeaponMagazine1","_primaryWeaponMagazineGl"];
- _primaryWeaponMagazine2 = [];
- if (!(isNil "_primaryWeaponMagazineGl")) then {
- _primaryWeaponMagazine2 = [_primaryWeaponMagazineGl,getNumber(configFile >> "CfgMagazines" >> _primaryWeaponMagazineGl >> "count")];
- };
- _primaryWeapon = [
- _weap,
- _primaryWeaponItems1,
- _primaryWeaponItems2,
- _primaryWeaponItems3,
- [_primaryWeaponMagazine1, getNumber(configFile >> "CfgMagazines" >> _primaryWeaponMagazine1 >> "count")],
- _primaryWeaponMagazine2,
- _primaryWeaponItems4
- ];
- _weaponHolder = createVehicle ["DummyWeapon_Wbk", getPosATL _unit, [], 0, "CAN_COLLIDE"];
- _weaponHolder addWeaponWithAttachmentsCargoGlobal [_primaryWeapon, 1];
- _unit setVariable ["WBK_SecondWeapon",[_weaponHolder,_primaryWeapon],true];
- if (WBK_LocalParamWhereWeaponIs == "Pelvis") then {
- [_unit,_weaponHolder,"Pelvis"] call WBK_AdjustGunPos;
- }
- else
- {
- [_unit,_weaponHolder,"Spine_normal"] call WBK_AdjustGunPos;
- };
- _unit removeWeapon _weap;
- };
- WBK_SwapWeapons_Scripted = {
- _unit = _this;
- if (isNil {_unit getVariable "WBK_SecondWeapon"}) exitWith {};
- _weap = primaryWeapon _unit;
- _count = _unit ammo primaryWeapon _unit;
- (primaryWeaponItems _unit) params ["_primaryWeaponItems1","_primaryWeaponItems2","_primaryWeaponItems3","_primaryWeaponItems4"];
- (primaryWeaponMagazine _unit) params ["_primaryWeaponMagazine1","_primaryWeaponMagazineGl"];
- _primaryWeaponMagazine2 = [];
- if (!(isNil "_primaryWeaponMagazineGl")) then {
- _primaryWeaponMagazine2 = [_primaryWeaponMagazineGl,1];
- };
- _primaryWeapon = [_weap, _primaryWeaponItems1, _primaryWeaponItems2, _primaryWeaponItems3, [_primaryWeaponMagazine1, _count], _primaryWeaponMagazine2, _primaryWeaponItems4];
- _unit removeWeapon _weap;
- _crate = (_unit getVariable "WBK_SecondWeapon") select 0;
- _weapAttached = (_unit getVariable "WBK_SecondWeapon") select 1;
- deleteVehicle _crate;
- _weapAttached params ["_weapon","_item1","_item2","_item3","_mag1","_mag2","_item4"];
- _mag1 params ["_magAct","_magCnt"];
- _mag2 params ["_mag2Act","_mag2Cnt"];
- _magLaunch = "";
- if (!(isNil "_mag2Act")) then {
- _magLaunch = _mag2 select 0;
- };
- _unit addMagazine _magAct;
- _unit addWeapon _weapon;
- {
- _unit addPrimaryWeaponItem _x;
- } forEach [_item1,_item2,_item3,_item4, _magLaunch];
- _unit setAmmo [primaryWeapon _unit, _magCnt];
- _crateNew = createVehicle ["DummyWeapon_Wbk", getPosATL _unit, [], 0, "CAN_COLLIDE"];
- _crateNew addWeaponWithAttachmentsCargoGlobal [_primaryWeapon, 1];
- _unit setVariable ["WBK_SecondWeapon",[_crateNew,_primaryWeapon],true];
- [_unit,_crateNew,"Pelvis"] call WBK_AdjustGunPos;
- };
- WBK_AdjustGunPos = {
- _unit = _this select 0;
- _crate = _this select 1;
- _param = _this select 2;
- _crate lockInventory true;
- _crate setDamage 1;
- if (_param == "Melee_Spine") exitWith {
- _crate attachTo [_unit,[0.1,-0.18,0.26],"Spine3",true];
- _y = 230;
- _p = -80;
- _r = 310;
- _crate setVectorDirAndUp [
- [sin _y * cos _p, cos _y * cos _p, sin _p],
- [[sin _r, -sin _p, cos _r * cos _p], -_y] call BIS_fnc_rotateVector2D
- ];
- };
- if (_param == "Melee_Pelvis") exitWith {
- _crate attachTo [_unit,[-0.25,0,0],"Pelvis",true];
- _y = 180;
- _p = -40;
- _r = 110;
- _crate setVectorDirAndUp [
- [sin _y * cos _p, cos _y * cos _p, sin _p],
- [[sin _r, -sin _p, cos _r * cos _p], -_y] call BIS_fnc_rotateVector2D
- ];
- };
- if (_param == "Spine") exitWith {
- _crate attachTo [_unit,[0.1,-0.2,0.02],"Spine3",true];
- _y = 80;
- _p = 0;
- _r = -82;
- _crate setVectorDirAndUp [
- [sin _y * cos _p, cos _y * cos _p, sin _p],
- [[sin _r, -sin _p, cos _r * cos _p], -_y] call BIS_fnc_rotateVector2D
- ];
- };
- if (_param == "Spine_normal") exitWith {
- _crate attachTo [_unit,[-0.15,-0.185,0],"Spine3",true];
- _y = 110;
- _p = 0;
- _r = -82;
- _crate setVectorDirAndUp [
- [sin _y * cos _p, cos _y * cos _p, sin _p],
- [[sin _r, -sin _p, cos _r * cos _p], -_y] call BIS_fnc_rotateVector2D
- ];
- };
- if (_param == "Pelvis") exitWith {
- _crate attachTo [_unit,[-0.19,-0.17,-0.17],"Pelvis",true];
- _y = 310;
- _p = 150;
- _r = -115;
- _crate setVectorDirAndUp [
- [sin _y * cos _p, cos _y * cos _p, sin _p],
- [[sin _r, -sin _p, cos _r * cos _p], -_y] call BIS_fnc_rotateVector2D
- ];
- };
- };
- WBK_SwapWeapons_ByPlayer_Pelvis = {
- _unit = _this;
- if (isNil {_unit getVariable "WBK_SecondWeapon"}) exitWith {};
- if (WBK_IsCurrentWeaponMainOnPlayer) exitWith {
- WBK_IsCurrentWeaponMainOnPlayer = false;
- [_unit,"WBK_Rifle_PutAway",15] spawn WBK_CreateSoundEffect;
- _weap = currentWeapon _unit;
- if (_weap == handGunWeapon _unit) then {
- _unit playActionNow "WBK_PistolPutBack";
- _unit playActionNow "WBK_PistolPutBack";
- _unit playActionNow "WBK_PistolPutBack";
- sleep 0.5;
- }
- else
- {
- _unit playActionNow "WBK_PutWeaponOnBack_Main";
- _unit playActionNow "WBK_PutWeaponOnBack_Main";
- _unit playActionNow "WBK_PutWeaponOnBack_Main";
- sleep 0.9;
- };
- if (!(currentWeapon _unit == _weap)) exitWith {};
- _weap = primaryWeapon _unit;
- _count = _unit ammo primaryWeapon _unit;
- (primaryWeaponItems _unit) params ["_primaryWeaponItems1","_primaryWeaponItems2","_primaryWeaponItems3","_primaryWeaponItems4"];
- (primaryWeaponMagazine _unit) params ["_primaryWeaponMagazine1","_primaryWeaponMagazineGl"];
- _primaryWeaponMagazine2 = [];
- if (!(isNil "_primaryWeaponMagazineGl")) then {
- _primaryWeaponMagazine2 = [_primaryWeaponMagazineGl,1];
- };
- _primaryWeapon = [_weap, _primaryWeaponItems1, _primaryWeaponItems2, _primaryWeaponItems3, [_primaryWeaponMagazine1, _count], _primaryWeaponMagazine2, _primaryWeaponItems4];
- _unit removeWeapon _weap;
- _crate = (_unit getVariable "WBK_SecondWeapon") select 0;
- _weapAttached = (_unit getVariable "WBK_SecondWeapon") select 1;
- deleteVehicle _crate;
- _weapAttached params ["_weapon","_item1","_item2","_item3","_mag1","_mag2","_item4"];
- _mag1 params ["_magAct","_magCnt"];
- _mag2 params ["_mag2Act","_mag2Cnt"];
- _magLaunch = "";
- if (!(isNil "_mag2Act")) then {
- _magLaunch = _mag2Act;
- };
- _unit addMagazine _magAct;
- _unit addWeapon _weapon;
- {
- _unit addPrimaryWeaponItem _x;
- } forEach [_item1,_item2,_item3,_item4, _magLaunch];
- _unit setAmmo [primaryWeapon _unit, _magCnt];
- _crateNew = createVehicle ["DummyWeapon_Wbk", getPosATL _unit, [], 0, "CAN_COLLIDE"];
- _crateNew addWeaponWithAttachmentsCargoGlobal [_primaryWeapon, 1];
- _unit setVariable ["WBK_SecondWeapon",[_crateNew,_primaryWeapon],true];
- [_unit,_crateNew,"Spine"] call WBK_AdjustGunPos;
- _unit selectWeapon _weapon;
- _unit playActionNow "DoubleWeapons_Low_Take";
- _unit playActionNow "DoubleWeapons_Low_Take";
- _unit playActionNow "DoubleWeapons_Low_Take";
- };
- WBK_IsCurrentWeaponMainOnPlayer = true;
- [_unit,"WBK_Rifle_TakeBack",15] spawn WBK_CreateSoundEffect;
- _weap = currentWeapon _unit;
- if (_weap == handGunWeapon _unit) then {
- _unit playActionNow "WBK_PistolPutBack";
- _unit playActionNow "WBK_PistolPutBack";
- _unit playActionNow "WBK_PistolPutBack";
- }
- else
- {
- _unit playActionNow "DoubleWeapons_Low_Out";
- _unit playActionNow "DoubleWeapons_Low_Out";
- _unit playActionNow "DoubleWeapons_Low_Out";
- sleep 0.7;
- };
- if (!(currentWeapon _unit == _weap)) exitWith {};
- _weap = primaryWeapon _unit;
- _count = _unit ammo primaryWeapon _unit;
- (primaryWeaponItems _unit) params ["_primaryWeaponItems1","_primaryWeaponItems2","_primaryWeaponItems3","_primaryWeaponItems4"];
- (primaryWeaponMagazine _unit) params ["_primaryWeaponMagazine1","_primaryWeaponMagazineGl"];
- _primaryWeaponMagazine2 = [];
- if (!(isNil "_primaryWeaponMagazineGl")) then {
- _primaryWeaponMagazine2 = [_primaryWeaponMagazineGl,1];
- };
- _primaryWeapon = [_weap, _primaryWeaponItems1, _primaryWeaponItems2, _primaryWeaponItems3, [_primaryWeaponMagazine1, _count], _primaryWeaponMagazine2, _primaryWeaponItems4];
- _unit removeWeapon _weap;
- _crate = (_unit getVariable "WBK_SecondWeapon") select 0;
- _weapAttached = (_unit getVariable "WBK_SecondWeapon") select 1;
- deleteVehicle _crate;
- _weapAttached params ["_weapon","_item1","_item2","_item3","_mag1","_mag2","_item4"];
- _mag1 params ["_magAct","_magCnt"];
- _mag2 params ["_mag2Act","_mag2Cnt"];
- _magLaunch = "";
- if (!(isNil "_mag2Act")) then {
- _magLaunch = _mag2Act;
- };
- _unit addMagazine _magAct;
- _unit addWeapon _weapon;
- {
- _unit addPrimaryWeaponItem _x;
- } forEach [_item1,_item2,_item3,_item4, _magLaunch];
- _unit setAmmo [primaryWeapon _unit, _magCnt];
- _crateNew = createVehicle ["DummyWeapon_Wbk", getPosATL _unit, [], 0, "CAN_COLLIDE"];
- _crateNew addWeaponWithAttachmentsCargoGlobal [_primaryWeapon, 1];
- _unit setVariable ["WBK_SecondWeapon",[_crateNew,_primaryWeapon],true];
- [_unit,_crateNew,"Pelvis"] call WBK_AdjustGunPos;
- _unit selectWeapon _weapon;
- _unit playActionNow "WBK_TakeOutWeapon_High";
- _unit playActionNow "WBK_TakeOutWeapon_High";
- _unit playActionNow "WBK_TakeOutWeapon_High";
- };
- WBK_SwapWeapons_ByPlayer_Spine = {
- _unit = _this;
- if (isNil {_unit getVariable "WBK_SecondWeapon"}) exitWith {};
- if (WBK_IsCurrentWeaponMainOnPlayer) exitWith {
- [_unit,"WBK_Rifle_PutAway",15] spawn WBK_CreateSoundEffect;
- WBK_IsCurrentWeaponMainOnPlayer = false;
- _weap = currentWeapon _unit;
- if (_weap == handGunWeapon _unit) then {
- _unit playActionNow "WBK_PistolPutBack";
- _unit playActionNow "WBK_PistolPutBack";
- _unit playActionNow "WBK_PistolPutBack";
- sleep 0.5;
- }
- else
- {
- _unit playActionNow "WBK_PutWeaponOnBack_Main";
- _unit playActionNow "WBK_PutWeaponOnBack_Main";
- _unit playActionNow "WBK_PutWeaponOnBack_Main";
- sleep 0.8;
- };
- if (!(currentWeapon _unit == _weap)) exitWith {};
- _weap = primaryWeapon _unit;
- _count = _unit ammo primaryWeapon _unit;
- (primaryWeaponItems _unit) params ["_primaryWeaponItems1","_primaryWeaponItems2","_primaryWeaponItems3","_primaryWeaponItems4"];
- (primaryWeaponMagazine _unit) params ["_primaryWeaponMagazine1","_primaryWeaponMagazineGl"];
- _primaryWeaponMagazine2 = [];
- if (!(isNil "_primaryWeaponMagazineGl")) then {
- _primaryWeaponMagazine2 = [_primaryWeaponMagazineGl,1];
- };
- _primaryWeapon = [_weap, _primaryWeaponItems1, _primaryWeaponItems2, _primaryWeaponItems3, [_primaryWeaponMagazine1, _count], _primaryWeaponMagazine2, _primaryWeaponItems4];
- _unit removeWeapon _weap;
- _crate = (_unit getVariable "WBK_SecondWeapon") select 0;
- _weapAttached = (_unit getVariable "WBK_SecondWeapon") select 1;
- deleteVehicle _crate;
- _weapAttached params ["_weapon","_item1","_item2","_item3","_mag1","_mag2","_item4"];
- _mag1 params ["_magAct","_magCnt"];
- _mag2 params ["_mag2Act","_mag2Cnt"];
- _magLaunch = "";
- if (!(isNil "_mag2Act")) then {
- _magLaunch = _mag2Act;
- };
- _unit addMagazine _magAct;
- _unit addWeapon _weapon;
- {
- _unit addPrimaryWeaponItem _x;
- } forEach [_item1,_item2,_item3,_item4, _magLaunch];
- _unit setAmmo [primaryWeapon _unit, _magCnt];
- _crateNew = createVehicle ["DummyWeapon_Wbk", getPosATL _unit, [], 0, "CAN_COLLIDE"];
- _crateNew addWeaponWithAttachmentsCargoGlobal [_primaryWeapon, 1];
- _unit setVariable ["WBK_SecondWeapon",[_crateNew,_primaryWeapon],true];
- [_unit,_crateNew,"Spine"] call WBK_AdjustGunPos;
- _unit selectWeapon _weapon;
- _unit playActionNow "DoubleWeapons_High_Take";
- _unit playActionNow "DoubleWeapons_High_Take";
- _unit playActionNow "DoubleWeapons_High_Take";
- };
- WBK_IsCurrentWeaponMainOnPlayer = true;
- [_unit,"WBK_Rifle_TakeBack",15] spawn WBK_CreateSoundEffect;
- _weap = currentWeapon _unit;
- if (_weap == handGunWeapon _unit) then {
- _unit playActionNow "WBK_PistolPutBack";
- _unit playActionNow "WBK_PistolPutBack";
- _unit playActionNow "WBK_PistolPutBack";
- }
- else
- {
- _unit playActionNow "DoubleWeapons_High_Out";
- _unit playActionNow "DoubleWeapons_High_Out";
- _unit playActionNow "DoubleWeapons_High_Out";
- };
- sleep 0.6;
- if (!(currentWeapon _unit == _weap)) exitWith {};
- _weap = primaryWeapon _unit;
- _count = _unit ammo primaryWeapon _unit;
- (primaryWeaponItems _unit) params ["_primaryWeaponItems1","_primaryWeaponItems2","_primaryWeaponItems3","_primaryWeaponItems4"];
- (primaryWeaponMagazine _unit) params ["_primaryWeaponMagazine1","_primaryWeaponMagazineGl"];
- _primaryWeaponMagazine2 = [];
- if (!(isNil "_primaryWeaponMagazineGl")) then {
- _primaryWeaponMagazine2 = [_primaryWeaponMagazineGl,1];
- };
- _primaryWeapon = [_weap, _primaryWeaponItems1, _primaryWeaponItems2, _primaryWeaponItems3, [_primaryWeaponMagazine1, _count], _primaryWeaponMagazine2, _primaryWeaponItems4];
- _unit removeWeapon _weap;
- _crate = (_unit getVariable "WBK_SecondWeapon") select 0;
- _weapAttached = (_unit getVariable "WBK_SecondWeapon") select 1;
- deleteVehicle _crate;
- _weapAttached params ["_weapon","_item1","_item2","_item3","_mag1","_mag2","_item4"];
- _mag1 params ["_magAct","_magCnt"];
- _mag2 params ["_mag2Act","_mag2Cnt"];
- _magLaunch = "";
- if (!(isNil "_mag2Act")) then {
- _magLaunch = _mag2Act;
- };
- _unit addMagazine _magAct;
- _unit addWeapon _weapon;
- {
- _unit addPrimaryWeaponItem _x;
- } forEach [_item1,_item2,_item3,_item4, _magLaunch];
- _unit setAmmo [primaryWeapon _unit, _magCnt];
- _crateNew = createVehicle ["DummyWeapon_Wbk", getPosATL _unit, [], 0, "CAN_COLLIDE"];
- _crateNew addWeaponWithAttachmentsCargoGlobal [_primaryWeapon, 1];
- _unit setVariable ["WBK_SecondWeapon",[_crateNew,_primaryWeapon],true];
- [_unit,_crateNew,"Spine_normal"] call WBK_AdjustGunPos;
- _unit selectWeapon _weapon;
- _unit playActionNow "WBK_TakeOutWeapon_High";
- _unit playActionNow "WBK_TakeOutWeapon_High";
- _unit playActionNow "WBK_TakeOutWeapon_High";
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement