Skip to content

Instantly share code, notes, and snippets.

@commy2
Last active April 25, 2020 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commy2/f681d4329542371c44efdfc5e0af38b2 to your computer and use it in GitHub Desktop.
Save commy2/f681d4329542371c44efdfc5e0af38b2 to your computer and use it in GitHub Desktop.
// init.sqf
["weaponMode", {
params ["_unit", "_newWeaponMode", "_oldWeaponMode"];
private _weapon = currentMuzzle _unit;
if (_newWeaponMode != "Single") then {
private _weapons = ["arifle_MX_F", "hlc_rifle_CQBR"];
private _cfgWeapons = configFile >> "CfgWeapons";
if (_weapons findIf {_weapon isKindOf [_x, _cfgWeapons]} != -1) then {
[_unit, _weapon, "Single"] call CBA_fnc_selectWeapon;
};
};
}, true] call CBA_fnc_addPlayerEventHandler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment