Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- span class="re5"> WieldweaponAct = -1;
- vOutweaponEH = -1;
- waffebefestigen={
- private _weapon = (missionNamespace getVariable ["NN_Melee_Weapon",objNull]);
- private _weaponType = typeOf _weapon;
- if (_weaponType isEqualTo "Land_Axe_F") exitWith {
- _weapon attachTo[player,[-0.01,0.12,0.005],"rightHandMiddle1"];
- _weapon setDir 90;
- _weapon setVectorUp[-12,-0.0,1];
- };
- if (_weaponType isEqualTo "Land_Axe_fire_F") exitWith {
- _weapon attachTo[player,[-0.01,0.12,0.07],"rightHandMiddle1"];
- _weapon setDir 90;
- _weapon setVectorUp[-12,-0.0,1];
- };
- if (_weaponType isEqualTo "Land_Shovel_F") exitWith {
- _weapon attachTo[player,[-0.01,0.1,0.01],"rightHandMiddle1"];
- _weapon setDir 0;
- _weapon setVectorUp[6,-0.0,0];
- };
- if (_weaponType isEqualTo "Land_Saw_F") exitWith {
- _weapon attachTo[player,[0.01,0.1,-0.05],"leftHandMiddle1"];
- _weapon setDir 220;
- _weapon setVectorUp[10,0,1];
- };
- if (_weaponType isEqualTo "Land_Tableware_01_knife_F") exitWith {
- _weapon attachTo[player,[0.01,0,-0.03],"leftHandMiddle1"];
- _weapon setDir 90;
- _weapon setVectorUp[-12,0,1];
- };
- if (_weaponType isEqualTo "Land_Hammer_F") exitWith {
- _weapon attachTo[player,[-0.01,0.045,0.005],"rightHandMiddle1"];
- _weapon setDir 0;
- _weapon setVectorUp[0,-0.0,1];
- };
- if (_weaponType isEqualTo "Land_Wrench_F") exitWith {
- _weapon attachTo[player,[-0.018,0.045,0.005],"rightHandMiddle1"];
- _weapon setDir 0;
- _weapon setVectorUp[4,0,1];
- };
- };
- pickupWeapon={
- private _weapon=_this;
- private _found = false;
- {
- if (_x isEqualTo (missionNamespace getVariable ["NN_Melee_Weapon",objNull])) exitWith {_found = true;};
- } forEach attachedObjects player;
- if (_found) exitWith {["Du hast bereits eine Nahkampft Waffe an dir!","error"] call life_fnc_notification_4;};
- if ((currentWeapon player) isNotEqualTo "") exitWith {["Pack deine Waffe erstmal Weg!","error"] call life_fnc_notification_4;};
- if (stance player!="PRONE") then {
- [player,"AmovPercMstpSnonWnonDnon_AinvPknlMstpSnonWnonDnon",false] remoteExecCall ["life_fnc_animSync",-2];
- uisleep 0.5;
- };
- removeAllActions _weapon;
- missionNamespace setVariable ["NN_Melee_Weapon",_weapon];
- call waffebefestigen;
- weaponDie = player addEventHandler["Killed",{
- call dropWeapon;
- }];
- vInWeaponEH = player addEventHandler["GetInMan",{
- (findDisplay 46)displayRemoveEventHandler["MouseButtonDown",chopWeaponEH];
- call vHideweapon;
- }];
- chopWeaponEH = (findDisplay 46)displayAddEventHandler["MouseButtonDown",{
- if ((_this select 1) isNotEqualTo 0) exitWith {};
- if((animationState player in ["AwopPercMstpSgthWnonDnon_start","AwopPercMstpSgthWnonDnon_throw","AwopPercMstpSgthWnonDnon_end"]) || (stance player=="PRONE"))exitWith{};
- [player] spawn chopWeapon;
- }];
- DropWeaponAct = player addAction["Waffe fallen lassen",{call dropWeapon; (_this select 0)removeAction DropWeaponAct; (_this select 0)removeAction CarryweaponAct;}];
- CarryWeaponAct = player addAction["Waffe holstern",{(_this select 0)removeAction DropweaponAct; (_this select 0) removeAction CarryweaponAct; call weaponBack;}];
- uiSleep 0.1;
- [player,"ainvpknlmstpslaywrfldnon_amovpercmstpsnonwnondnon",false] remoteExecCall ["life_fnc_animSync",-2];
- 0 spawn {
- for "_i" from 0 to 1 step 0 do {
- if ((currentWeapon player) isNotEqualTo "" && !((missionNamespace getVariable ["NN_Melee_Weapon",objNull]) getVariable ["angeholstert",false])) exitWith {
- call dropWeapon;
- player removeAction DropWeaponAct;
- player removeAction CarryweaponAct;
- };
- _found = false;
- {
- if (_x isEqualTo (missionNamespace getVariable ["NN_Melee_Weapon",objNull])) exitWith {_found = true;};
- } forEach attachedObjects player;
- if (!_found) exitWith {};
- };
- };
- };
- vHideweapon={
- player removeEventHandler["GetInMan",vInweaponEH];
- [(missionNamespace getVariable ["NN_Melee_Weapon",objNull]),true] remoteExecCall ["hideObjectGlobal",2];
- vOutweaponEH = player addEventHandler["GetOutMan",{call vShowweapon;}];
- player removeAction DropweaponAct;
- player removeAction CarryweaponAct;
- if (isNil "WieldweaponAct") exitWith {};
- player removeAction WieldweaponAct;
- };
- vShowweapon={
- [(missionNamespace getVariable ["NN_Melee_Weapon",objNull]),false] remoteExecCall ["hideObjectGlobal",2];
- player removeEventHandler["GetOutMan",vOutweaponEH];
- vInweaponEH=player addEventHandler["GetInMan",{
- (findDisplay 46)displayRemoveEventHandler["MouseButtonDown",chopweaponEH];
- call vHideweapon;
- }];
- call weaponBack;
- };
- dropweapon={
- (findDisplay 46)displayRemoveEventHandler["MouseButtonDown",chopweaponEH];
- if(stance player isNotEqualTo "PRONE" && alive player)then{
- 0 spawn {
- [player,"AmovPercMstpSnonWnonDnon_AinvPknlMstpSnonWnonDnon",false] remoteExecCall ["life_fnc_animSync",-2];
- uisleep 0.5;
- [player,"ainvpknlmstpslaywrfldnon_amovpercmstpsnonwnondnon",false] remoteExecCall ["life_fnc_animSync",-2];
- };
- };
- detach (missionNamespace getVariable ["NN_Melee_Weapon",objNull]);
- player removeAction DropweaponAct;
- player removeAction WieldweaponAct;
- player removeEventHandler["GetInMan",vInweaponEH];
- player removeEventHandler["GetOutMan",vOutweaponEH];
- player removeEventHandler["Killed",weaponDie];
- PickupweaponAct = (missionNamespace getVariable ["NN_Melee_Weapon",objNull]) addAction[format ["%1 nehmen",(([typeOf (missionNamespace getVariable ["NN_Melee_Weapon",objNull])] call life_fnc_fetchCfgDetails) select 1)],{
- if((_this select 1)distance(_this select 0)<1.5)then{
- (_this select 0)removeAction PickupweaponAct;
- (_this select 0)removeAction DropweaponAct;
- (_this select 0)removeAction WieldweaponAct;
- (_this select 0)removeAction CarryweaponAct;
- (missionNamespace getVariable ["NN_Melee_Weapon",objNull]) call pickupweapon;
- };
- }];
- if (!alive player) exitWith {
- deleteVehicle (missionNamespace getVariable ["NN_Melee_Weapon",objNull]);
- };
- };
- chopweapon={
- if (time < (missionNamespace getVariable ["NN_Melee_Weapon_CD",time]) || dialog) exitWith {};
- missionNamespace setVariable ["NN_Melee_Weapon_CD",time + 1.75];
- 0 spawn {
- uiSleep 0.2;
- [player,"miss0",20,1] remoteExec ["life_fnc_say3D",-2];
- };
- player setAnimSpeedCoef 0.85;
- [player,"AwopPercMstpSgthWnonDnon_end",false] remoteExecCall ["life_fnc_animSync",-2];
- uisleep 0.2;
- player setAnimSpeedCoef 1;
- private _tarCond=objNull;
- {
- if((alive _x) && (_x isNotEqualTo player)) exitWith {
- _tarCond = _x;
- };
- }forEach (nearestObjects[player,["Man"],2]);
- if(isNull _tarCond)exitWith{};
- if([getPosATL player,getDir player,90,getPosATL _tarCond]call BIS_fnc_inAngleSector && (alive _tarCond) && !(_tarCond getVariable ["dead",false]) && player distance _tarCond<2.2)then{
- private _tSnd=createVehicle["Land_HelipadEmpty_F",getPos _tarCond,[],0,"NONE"];
- [_tSnd,"hit0",20,1] remoteExec ["life_fnc_say3D",-2];
- _tarCond setDamage((damage _tarCond)+(0.65));
- deleteVehicle _tSnd;
- };
- };
- weaponBack={
- if (isNull (missionNamespace getVariable ["NN_Melee_Weapon",objNull])) exitWith {
- (findDisplay 46)displayRemoveEventHandler["MouseButtonDown",chopweaponEH];
- };
- (missionNamespace getVariable ["NN_Melee_Weapon",objNull]) setVariable ["angeholstert",true];
- if((stance player!="PRONE") && (isNull objectParent player))then{
- [player,"AmovPercMstpSnonWnonDnon_AinvPercMstpSnonWnonDnon",false] remoteExecCall ["life_fnc_animSync",-2];
- };
- private _weapon=(missionNamespace getVariable ["NN_Melee_Weapon",objNull]);
- (findDisplay 46)displayRemoveEventHandler["MouseButtonDown",chopweaponEH];
- DropweaponAct=player addAction["Waffe fallen lassen",{(_this select 0)removeAction DropweaponAct; (_this select 1)removeAction DropweaponAct; (_this select 0)removeAction WieldweaponAct; (_this select 0)removeAction CarryweaponAct; call dropweapon;}];
- WieldweaponAct=player addAction["Waffe entholstern",{(_this select 0)removeAction DropweaponAct;(_this select 1)removeAction DropweaponAct;(_this select 0)removeAction WieldweaponAct;(_this select 1)removeAction WieldweaponAct;(_this select 0)removeAction CarryweaponAct;(_this select 1)removeAction CarryweaponAct;call wieldweapon;}];
- call {
- private _weapon = (missionNamespace getVariable ["NN_Melee_Weapon",objNull]);
- private _weaponType = typeOf _weapon;
- if (_weaponType isEqualTo "Land_Axe_F") exitWith {
- _weapon attachTo[player,[0.2,-0.03,-0.1],"launcher"];
- _weapon setDir 90;
- _weapon setVectorUp[1,6.0,-1];
- };
- if (_weaponType isEqualTo "Land_Axe_fire_F") exitWith {
- _weapon attachTo[player,[0.2,-0.03,-0.1],"launcher"];
- _weapon setDir 90;
- _weapon setVectorUp[1,6.0,-1];
- };
- if (_weaponType isEqualTo "Land_Shovel_F") exitWith {
- _weapon attachTo[player,[-0.01,0.1,0.01],"rightHandMiddle1"];
- _weapon setDir 0;
- _weapon setVectorUp[6,-0.0,0];
- };
- if (_weaponType isEqualTo "Land_Saw_F") exitWith {
- _weapon attachTo[player,[-0.18,-0.05,0],"pelvis"];
- _weapon setDir 70;
- _weapon setVectorUp[-12,0,1];
- };
- if (_weaponType isEqualTo "Land_Tableware_01_knife_F") exitWith {
- _weapon attachTo[player,[-0.18,-0.05,0],"pelvis"];
- _weapon setDir 0;
- _weapon setVectorUp[-12,0,1];
- };
- if (_weaponType isEqualTo "Land_Hammer_F") exitWith {
- _weapon attachTo[player,[-0.18,-0.05,0],"pelvis"];
- _weapon setDir 70;
- _weapon setVectorUp[-12,0,1];
- };
- if (_weaponType isEqualTo "Land_Wrench_F") exitWith {
- _weapon attachTo[player,[-0.18,-0.05,0],"pelvis"];
- _weapon setDir 70;
- _weapon setVectorUp[-12,0,1];
- };
- };
- };
- wieldweapon={
- if ((currentWeapon player) isNotEqualTo "") exitWith {};
- private _weapon=(missionNamespace getVariable ["NN_Melee_Weapon",objNull]);
- call waffebefestigen;
- chopweaponEH=(findDisplay 46)displayAddEventHandler["MouseButtonDown",{
- if ((_this select 1) isNotEqualTo 0) exitWith {};
- if((animationState player in ["AwopPercMstpSgthWnonDnon_start","AwopPercMstpSgthWnonDnon_throw","AwopPercMstpSgthWnonDnon_end"]) || (stance player=="PRONE"))exitWith{};
- [player] spawn chopWeapon;
- }];
- DropweaponAct=player addAction["Waffe fallen lassen",{(_this select 0)removeAction DropweaponAct;(_this select 1)removeAction DropweaponAct;(_this select 0)removeAction WieldweaponAct;(_this select 0)removeAction CarryweaponAct;call dropweapon;}];
- CarryweaponAct=player addAction["Waffe holstern",{(_this select 0)removeAction DropweaponAct;(_this select 0)removeAction WieldweaponAct;(_this select 0)removeAction CarryweaponAct;call weaponBack;}];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement