Jump to content
Sign in to follow this  
pineapple-yetti

CRRC Detection

Recommended Posts

Hi Guys,

This my first thred on the BI fourms but is first of many i suspect. Im working on a mission for the clan i belong to Z Special Unit amd have hit a snag. im tring to creat a small script to make a CRRC invisable unless certain variables are true.

this is what i have so far:

if ((a11 in CRRC1) or (a12 in CRRC1) or (a13 in CRRC1) or (a14 in CRRC1) or (am in CRRC1)) then
{
   if (speed CRRC1 > 20) then
   {
	 {_x setcaptive false} foreach units a11;
   }
   else
{
	sleep 30;
	{_x setcaptive true} foreach units a11;
	a11 addEventHandler ["Fired", {_x setcaptive false} foreach units a11;];
	a12 addEventHandler ["Fired", {_x setcaptive false} foreach units a11;];
	a13 addEventHandler ["Fired", {_x setcaptive false} foreach units a11;];
	a14 addEventHandler ["Fired", {_x setcaptive false} foreach units a11;];
	am addEventHandler ["Fired", {_x setcaptive false} foreach units a11;];

   };
}
else
{
{_x setcaptive false} foreach units a11;
a11 removeEventHandler ["Fired" , {_x setcaptive false} foreach units a11;];
a12 removeEventHandler ["Fired" , {_x setcaptive false} foreach units a11;];
a13 removeEventHandler ["Fired" , {_x setcaptive false} foreach units a11;];
a14 removeEventHandler ["Fired" , {_x setcaptive false} foreach units a11;];
am removeEventHandler ["Fired" , {_x setcaptive false} foreach units a11;];
};

as im a scripting noob i dont know how this works as it stands but that is the idea atleast. if any of you scripting genius's out there and could take a look at this and tell me how it could fail and what you think i should try it would be much appreciated

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  

×