Search the Community
Showing results for tags 'alert'.
Found 1 result
-
Detecting all weapons But not supressed
logan83 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi guys! I'm not skilled in scripting and I have messed trying to make a Alert System based in some codes that i have in my old Arma 3 folder... the idea is to detect all shooting weapons, granadelaunchers, granades, etc... except the silenced shoots. Well Im in the way but its too dirty and im stuck. I put in my Init.sqf this line to add all units in game the event handler: {if((side _x in [blufor,opfor]) && (local _x)) then {_x addEventHandler ["fired", {if ((_this call fnc_suppressorCheck) or (configname (inheritsFrom (configFile >> "cfgWeapons" >> "throw" >>(_this select 2) )) isEqualTo "ThrowMuzzle")) then {FusShot = true; publicVariable "FusShot";HINT "UNSUPPRESSED!"};}];};} foreach allunits; and this is the fnC_SupressorCheck Function: fnc_suppressorCheck = { private ["_suppressor"]; _weaponFired = _this select 1; _Soldado = _this select 0; _weaponItems = weaponsItems _Soldado; _suppressor = False; { if ((_weaponFired == _x select 0) && ((_x select 1) == "")) then { _suppressor = true; }; } forEach _weaponItems; _suppressor }; if(true) exitWith{}; This works, detect the like handgrenades, chemlights, smoke grenades, RPGS , rifle shoots (but correctly ignores the supressed), pistol shoots (but correctly ignores the supressed), but, don't detect, grenade launchers, and satchels.... Any Help whit that?? Thank you So much!!