This short script adds an action for the player to pull a concealed weapon, creating it out of thin air. As ARMA2 defaults to pull a gun as soon as it's equipped, it's hard to have player incognito by default without taking away all their weapons.
As the script fires it adds one of three random weapons and the corresponding magazines to the player's inventory and makes them pull the weapon.
The script's simple enough and you can easily change it to give specific weapons instead of random ones.
Known Bugs:
- as long as a player has not pulled the weapon, other players can activate their action for them when near; probably easy to fix but I'm ignoring it for now
- players have to change firemode/select through weapons ("F") after activating the script and pulling the gun; this is an arma2 thing, probably unfixable.
pullweaponaction.sqf
pullweapon.sqf_unit = _this select 0;
_unit addAction ["<t color='#dddd00'>"+"Pull concealed weapon"+"</t>","scripts\pullweapon.sqf",[]];
Private ["_host","_value","_action"];
_host = _this select 0;
_action = _this select 2;
_value = floor(random 3);
if (_value == 0) then {
{_host addmagazine "20Rnd_B_765x17_Ball"} foreach [1,2];
_host addweapon "Sa61_EP1";
};
if (_value == 1) then {
{_host addmagazine "30Rnd_9x19_UZI"} foreach [1,2];
_host addweapon "UZI_EP1";
};
if (_value == 2) then {
{_host addmagazine "8Rnd_9x18_Makarov"} foreach [1,2,3];
_host addweapon "Makarov";
};
_host removeAction _action;