DMS_Exile/@ExileServer/addons/a3_dms/scripts/FindSuppressor.sqf

50 lines
1.2 KiB
Plaintext
Raw Normal View History

/*
DMS_FindSuppressor
Taken from WAI
2015-08-31 20:28:01 +00:00
Modified by eraser1 & Defent
Usage:
_weaponClassName call DMS_FindSuppressor;
*/
2015-09-02 00:15:42 +00:00
private["_weapon","_result","_weaponName","_rnd338","_rnd93"];
_result = "";
_weapon = _this;
2015-09-02 00:15:42 +00:00
_weaponName = getText (configFile >> "cfgWeapons" >> _weapon >> "displayName");
switch (true) do
2015-09-02 00:15:42 +00:00
{
case ((_weaponName find "6.5") > -1) :
2015-09-02 00:15:42 +00:00
{
if (_weapon find "LMG_Mk200" > -1) then
{
_result = "muzzle_snds_H_MG";
}
else
{
_result = "muzzle_snds_H";
};
};
case ((_weaponName find "5.56") > -1) : {_result = "muzzle_snds_M";};
case ((_weaponName find "7.62") > -1) : {_result = "muzzle_snds_B";};
case ((_weaponName find ".45") > -1) : {_result = "muzzle_snds_acp";};
2015-08-31 20:28:01 +00:00
case ((_weaponName find "9 mm") > -1) : {_result = "muzzle_snds_L";};
case ((_weaponName find ".338") > -1) : {_result = ["muzzle_snds_338_black","muzzle_snds_338_green","muzzle_snds_338_sand"] call BIS_fnc_selectRandom;};
case ((_weaponName find "9.3 mm") > -1) : {_result = ["muzzle_snds_93mmg","muzzle_snds_93mmg_tan"] call BIS_fnc_selectRandom;};
2015-09-02 00:15:42 +00:00
};
2015-08-31 20:28:01 +00:00
// Zafir accepts no suppressors :(
if ((_weapon find "Zafir")>-1) then {_result = "";};
2015-08-31 20:28:01 +00:00
2015-09-02 00:15:42 +00:00
_result