logan83 11 Posted June 15, 2014 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
PVT Watt.J 14 Posted June 15, 2014 replace player with _x "player" can only refer to players. Share this post Link to post Share on other sites
logan83 11 Posted June 15, 2014 uhm nopes shadow_msog not working with AI's, and not working with players :( Share this post Link to post Share on other sites
Tajin 348 Posted June 16, 2014 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
logan83 11 Posted June 21, 2014 tadaaaaaaaaaaa thanks Tajin!!! Share this post Link to post Share on other sites