SmokeyMeadow
Well-Known Member
Here is my update for the FN FAL selfaction. It doesn't require the NV goggles, but I'm updating that version too. The script now requires the weapon to be unloaded before you can work on it. Basically got the idea from an addition Frank McGee made to the suicide script in another thread. Hope he doesn't mind I borrowed it. I'll be updating each of the weapon scripts in this way.
Code:
// FN ADD START
private ["_rifle"];
_rifle = currentWeapon player;
if ((_rifle in ["FN_FAL"]) && (player ammo _rifle == 0)) then {
hasRifle = true;
} else {
hasRifle = false;
};
if (player ammo _rifle == 0) then {
weaponSafe = true;
} else {
weaponSafe = false;
};
if((speed player <= 1) && hasRifle && weaponSafe && _canDo) then {
if (addNV < 0) then {
addNV = player addAction [("<t color=""#0096ff"">" + ("Add Night Vision Scope") +"</t>"),"scripts\AddFN.sqf",_rifle,0,false,true,"", ""];
};
} else {
player removeAction addNV;
addNV = -1;
};
// FN ADD END
// FN REMOVE START
private ["_rifle"];
_rifle = currentWeapon player;
if ((_rifle in ["FN_FAL_ANPVS4"]) && (player ammo _rifle == 0)) then {
hasRifle = true;
} else {
hasRifle = false;
};
if (player ammo _rifle == 0) then {
weaponSafe = true;
} else {
weaponSafe = false;
};
if((speed player <= 1) && hasRifle && weaponSafe && _canDo) then {
if (RemNV < 0) then {
RemNV = player addAction [("<t color=""#0096ff"">" + ("Remove Night Vision Scope") +"</t>"),"scripts\RemFN.sqf",_rifle,0,false,true,"", ""];
};
} else {
player removeAction RemNV;
RemNV = -1;
};
// FN REMOVE END