Jump to content

Sign in to follow this  
Ilias38rus

Set captive action adding non stop

Recommended Posts

I checked it like 20 times already, can't fing anything, Set captive action adding non stop.

lvun = 0;
_lu = 0;
laun = [];
laun1 = [];
laun2 = [];
laun3 = [];
laun4 = [];
_la = ["arifle_MX_GL_F", "arifle_MX_GL_ACO_F", "arifle_MX_GL_ACO_pointer_F", "arifle_MX_GL_Hamr_pointer_F", "arifle_MX_GL_Holo_pointer_snds_F", "arifle_MX_GL_Black_F", "arifle_MX_GL_Black_Hamr_pointer_F"];
lvuglc2 = 0;
lvuglc3 = 0;
lauglc = [];
lauglc2 = [];
lauglc3 = [];

while {true} do {
{
	if (_x isKindOf "CAManBase") then {
		if ((_x isKindOf "B_UAV_AI") or (_x isKindOf "O_UAV_AI") or (_x isKindOf "I_UAV_AI")) then {}
		else {
			_lu = _x;
			if ((primaryWeapon _x == "") and (handgunWeapon _x == "") and (secondaryWeapon _x == "")) then {
				lvun = (laun find _x);
				if (lvun == -1) then {
					laun1 = [_x];
//					laun2 = [];
					_x addaction ["Set captive","additionals\sunarmedsc.sqf","_x"];
					laun = laun + laun1;
				};
			} else {
				if (lvun != -1) then {
					_x setcaptive false;
//					{_lu removeAction _x;} foreach laun2;
					removeAllActions _x;
					laun = laun - laun1;
					lauglc = lauglc - laun1;
				};
				lvuglc2 = _la find (primaryweapon _x);
				lvuglc3 = (lauglc find _x);
				if ((lvuglc2 != -1) and (lvuglc3 == -1) and (_x != player)) then {
					lauglc2 = [_x];
//					lauglc3 = ["","",""
//					];
					_x addaction ["Select grenade launcher",{(_this select 0) selectWeapon "GL_3GL_F";},"_x"];
					_x addaction ["Fire grenade launcher",{(_this select 0) fire "GL_3GL_F";},"_x"];
					_x addaction ["Flare","additionals\sffc.sqf","_x"];
					lauglc = lauglc + lauglc2;
				} else {
					if ((lvuglc2 != -1) and (lvuglc3 == -1)) then {
//						{_lu removeAction _x} foreach lauglc3;
						removeAllActions _x;
						laun = laun - lauglc2;
						lauglc = lauglc - lauglc2;
					};
				};
			};
		};
	};
} foreach allunits;
};

Share this post


Link to post
Share on other sites

Again something broked, ugl actions do not adding:

Working everything, but Ai do not targewting air with flares, if that's in code, i would be realy grateful for saind where:

laa = [];
laun = [];
_lvun = 0;
_la = ["arifle_MX_GL_F", "arifle_MX_GL_ACO_F", "arifle_MX_GL_ACO_pointer_F", "arifle_MX_GL_Hamr_pointer_F", "arifle_MX_GL_Holo_pointer_snds_F", "arifle_MX_GL_Black_F", "arifle_MX_GL_Black_Hamr_pointer_F"];
lvuglc = 0;
lauglc = [];
lvuglc1 = 0;

while {true} do {
{
	if (_x isKindOf "CAManBase") then {
		if ((_x isKindOf "B_UAV_AI") or (_x isKindOf "O_UAV_AI") or (_x isKindOf "I_UAV_AI")) then {}
		else {
			laa = [_x];
			_lvun = (laun find _x);
			if ((primaryWeapon _x == "") and (handgunWeapon _x == "") and (secondaryWeapon _x == "")) then {
				if (_lvun == -1) then {
					removeAllActions _x;
					lauglc = lauglc - laa;
					_x addaction ["Set captive","sunarmedsc.sqf","_x"];
					laun = laun + laa;
				};
			} else {
				if (_lvun != -1) then {
					_x setcaptive false;
					removeAllActions _x;
					laun = laun - laa;
					lauglc = lauglc - laa;
				};
				lvuglc = (_la find primaryweapon _x);
				lvuglc1 = (lauglc find _x);
				if ((lvuglc != -1) and (lvuglc1 == -1) and (_x != player)) then {
					_x addaction ["Select grenade launcher",{(_this select 0) selectWeapon "GL_3GL_F";},"_x"];
					_x addaction ["Fire grenade launcher",{(_this select 0) fire "GL_3GL_F";},"_x"];
					_x addaction ["Flare","sffc.sqf","_x"];
					lauglc = lauglc + laa;
				} else {
					if ((lvuglc1 != -1) and (lvuglc == -1)) then {
						removeAllActions _x;
						laun = laun - laa;
						lauglc = lauglc - laa;
					};
				};
			};
		};
	};
} foreach allunits;
sleep 1;
};

sffc.sqf

_lo = 0;
_lu = (_this select 0);

_lo = "Land_HeliPadEmpty_F" createvehicle [(getposATL _lu select 0) + 5, (getposATL _lu select 1) + 5, 15];
_lo setpos [(getposATL _lu select 0) + 5, (getposATL _lu select 1) + 5, 15];

_this select 0 reveal _lo;
sleep 1;
_this select 0 dotarget _lo;
sleep 5;
//_this select 0 fire "GL_3GL_F";
sleep 20;
//_this select 0 dotarget objNull;
deleteVehicle _lo;

Share this post


Link to post
Share on other sites

I have to agree, your variable name are a horror for debugging. In addition, please use proper thread names, so people can actually help you.

  • Like 1

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  

×