Jump to content
Sign in to follow this  
logan83

Supressor Function help

Recommended Posts

Hi buddies i have this function, works perfect in single player detecting all weapons fired without supressor, but in MP only detect the Weapons fired without supressors by players... how can modify to works correctly with players and ia's in MP¿?

TAG_fnc_suppressorCheck = {
   private ["_suppressor"];
   _weaponFired = _this select 1;
   _weaponItems = weaponsItems player;
   _suppressor = False;

   {
       if ((_weaponFired == _x select 0) && ((_x select 1) == "")) then {
           _suppressor = true;
       };
   } forEach _weaponItems;


   _suppressor
};

if(true) exitWith{};

i use these lines to make work the function

{if (side _x == Blufor) then{_x addEventHandler ["fired", {if (_this call TAG_fnc_suppressorCheck) then {FusShot=true}}];}}foreach allunits;

{if (side _x == opfor) then{_x addEventHandler ["fired", {if (_this call TAG_fnc_suppressorCheck) then {FusShot=true}}];}}foreach allunits;

any Help?

Share this post


Link to post
Share on other sites

uhm nopes shadow_msog not working with AI's, and not working with players :(

Share this post


Link to post
Share on other sites

That depends on where you execute those lines.

IF you run them on every client&server, then keep your function unchanged and use this as init:

{
if ( (side _x in [blufor,opfor]) && (local _x) ) then {
	_x addEventHandler ["fired", {
		if (_this call TAG_fnc_suppressorCheck) then {
			FusShot = true;
			publicVariable "FusShot";
		};
	}];
};
} foreach allunits;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×