Jump to content
Sign in to follow this  
logan83

Addeventhandler to a side

Recommended Posts

Hi to all!

Im trying to add a event Handler Fired to a side or to all Units (i prefer to a side....) but i havent no resoults... i try simething like this...

{_x addEventHandler ["Fired", { if (_this select 1 == "arifle_mas_akms") then {FusShot=true}];} forEach (allunits);

and dont works... how can i add a envent handler to a side or to all units???

Share this post


Link to post
Share on other sites

You're missing a }

{
if (side _x == BLUFOR) then 
{
	_x addEventHandler ["Fired",
	{
		if ((_this select 1) == "arifle_mas_akms") then 
		{
			FusShot = true;
		};
	};
};
}forEach allUnits;

Share this post


Link to post
Share on other sites

ok thanks for your help Cuel!!! this is the right form if someone need the secuence... :)

{
   if (side _x == BLUFOR) then
   {
       _x addEventHandler ["Fired",
       {
           if ((_this select 1) == "arifle_mas_akms") then
           {
               FusShot = true;
           };
         }
      ];         // Missed Bracket
   };
}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  

×