All pastes #507749 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-24 18:40 UTC
rendered paste body
////////////////////////////////////////////////////////////////////////////////
/// <header>
/// This SQF Function created using Project: JADE v0.6 on 2007-04-28 08:41:30Z
/// 
/// <author>Sickboy</author>
/// <filename>fObjHandler.sqf</filename>
/// <version>1.0.0</version>
/// 
/// <summary>
/// This function will Handle Objectives
/// </summary>
/// 
/// <parameters>
/// 
/// </parameters>
/// 
/// <returns>{Edit Me}</returns>
/// </header>
////////////////////////////////////////////////////////////////////////////////
private ["_conf","_obj","_objId","_objC"];

_obj=_this select 0;
_objID=_this select 1;
_objC=_this select 2;
_conf=_this select 3;

if(six_debug_miss&&six_isClient)then{server globalChat format["SIX_AIM_ObjHandler: Objtype: %1, ID: %2, Amount: %3, Conf: %4",_obj,_objID,_objC,_conf];};

_obj call compile preprocessFile (SIX_AIM_P+"c\cfg_ObjHandler.sqf");

// This is from above mentioned cfg_ObjHandler.sqf
// from fObjHandler: private ["_conf","_obj","_objId","_objC"];
private ["_c","_i","_y","_w","_p","_units","_capts","_pg","_pp","_trg","_basepos"];
switch _this do
{
	case 0:
	{
		// Rescue
		if("D" in _conf)then
		{
			_capts=call compile format["six_aim_obj%1_ar",_objID];
			_pg=_conf select 0;
			{_x enableAI "MOVE";_x setCaptive false;[_x] join _pg;} forEach _capts;
			if(six_debug_miss&&six_isClient)then{server globalChat format["%1 joined %2",_capts,_pg];};
		}else{
			if("E" in _conf)then
			{
				_capts=call compile format["six_aim_obj%1_ar",_objID];
				{deleteVehicle _x} forEach _capts;
				call compile format["deleteVehicle six_aim_obj%1_trg;six_aim_obj%1_d=true;publicVariable 'six_aim_obj%1_d';deleteMarker 'six_aim_obj%1_m';deleteMarker 'six_aim_obj%1_e'",_objId];
			}else{
				_capts=call compile format["six_aim_obj%1_ar",_objID];
				_i=0;_units=_conf select 0;_c=count _units;
				while{_i<_c}do{_p=_units select _i;if(alive _p&&isPlayer _p)then{_i=9999;}else{_i=_i+1;};};
				if(_i==9999)then
				{
					format["six_aim_obj%1_m",_objId] setMarkerColor "ColorBlack";
					format["six_aim_obj%1_e",_objId] setMarkerColor "ColorBlue";
					_basepos=_conf select 1;
					call compile format ["deleteVehicle six_aim_obj%1_trg",_objID];
					_trg=createTrigger ["EmptyDetector", _basepos ];
					_trg setTriggerActivation [format["%1",side (_capts select 0)], "PRESENT", true];
					_trg setTriggerArea [40, 40, 0, false ];
					player sidechat format["if(({_x in ThisList} count six_aim_obj%2_ar)==(count six_aim_obj%2_ar))then{d=[%1,%2,%3,['E']] spawn six_fObjHandler};",_obj,_objID,_objC];
					_trg setTriggerStatements ["this", format["if(({_x in ThisList} count six_aim_obj%2_ar)==(count six_aim_obj%2_ar))then{d=[%1,%2,%3,['E']] spawn six_fObjHandler;}",_obj,_objID,_objC], ""];
					_trg setTriggerTimeout [10, 10, 10, false ];
					call compile format["six_aim_obj%1_trg=_trg",_objId];
					if(six_debug_miss&&six_isClient)then{server globalChat format["SIX_AIM_ObjHandler: Found player %1, Joining %2 with playerteam",name _p,_capts];};
					[_obj,_objID,_objC,[group _p,'D']] call six_fObjHandler;
				};
			};
		};
	};
	case 1:
	{
		// Recover
		if("E" in _conf)then
		{
			_capts=call compile format["six_aim_obj%1_ar",_objID];
			{deleteVehicle _x} forEach _capts;
			call compile format["deleteVehicle six_aim_obj%1_trg;six_aim_obj%1_d=true;publicVariable 'six_aim_obj%1_d';deleteMarker 'six_aim_obj%1_m';deleteMarker 'six_aim_obj%1_e'",_objId];
		}else{
			_capts=call compile format["six_aim_obj%1_ar",_objID];
			_i=0;_units=_conf select 0;_c=count _units;
			while{_i<_c}do{_p=_units select _i;if(alive _p&&isPlayer _p)then{_i=9999;}else{_i=_i+1;};};
			if(_i==9999)then
			{
				format["six_aim_obj%1_m",_objId] setMarkerColor "ColorBlack";
				format["six_aim_obj%1_e",_objId] setMarkerColor "ColorBlue";
				_basepos=_conf select 1;
				call compile format ["deleteVehicle six_aim_obj%1_trg",_objID];
				_trg=createTrigger ["EmptyDetector", _basepos ];
				_trg setTriggerActivation [format["%1",side (_capts select 0)], "PRESENT", true];
				_trg setTriggerArea [40, 40, 0, false ];
				_trg setTriggerStatements ["this", format["if(({_x in ThisList} count six_aim_obj%2_ar)==(count six_aim_obj%2_ar))then{d=[%1,%2,%3,['E']] spawn six_fObjHandler;}",_obj,_objID,_objC], ""];
				_trg setTriggerTimeout [10, 10, 10, false ];
				call compile format["six_aim_obj%1_trg=_trg",_objId];
				if(six_debug_miss&&six_isClient)then{server globalChat format["SIX_AIM_ObjHandler: Found player %1, Joining %2 with playerteam",name _p,_capts];};
			};
		};
	};
	case 2:
	{
		// Destroy
		if("E" in _conf)then
		{
			_capts=call compile format["six_aim_obj%1_ar",_objID];
			{deleteVehicle _x} forEach _capts;
			call compile format["six_aim_obj%1_d=true;publicVariable 'six_aim_obj%1_d';deleteMarker 'six_aim_obj%1_m';deleteMarker 'six_aim_obj%1_e'",_objId];
		}else{
			_capts=call compile format["six_aim_obj%1_ar",_objID];
			format["six_aim_obj%1_m",_objId] setMarkerColor "ColorBlack";
			format["six_aim_obj%1_e",_objId] setMarkerColor "ColorBlue";
			_basepos=_conf select 1;
			call compile format ["deleteVehicle six_aim_obj%1_trg",_objID];
			_trg=createTrigger ["EmptyDetector", _basepos ];
			_trg setTriggerActivation [format["%1",side (_capts select 0)], "PRESENT", true];
			_trg setTriggerArea [40, 40, 0, false ];
			_trg setTriggerStatements ["this", format["if((leader six_aim_obj%1_caller) in ThisList)then{d=[%1,%2,%3,['E']] spawn six_fObjHandler;}",_obj,_objID,_objC], ""];
			_trg setTriggerTimeout [10, 10, 10, false ];
			call compile format["six_aim_obj%1_trg=_trg",_objId];
			if(six_debug_miss&&six_isClient)then{server globalChat format["SIX_AIM_ObjHandler: Found player %1, Joining %2 with playerteam",name _p,_capts];};
		};
	};
};