Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _markers = Markers;
- _squad = group (_this select 0);
- _names = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p"];
- //again this script will fire once for the squad
- num1 = (round(random (count _names))) - 1;
- num2 = ceil(random 99);
- _varCreate = [] call compile format["%1%2 = 0;%1%2 = _numVar;",num1,num2];
- varAlgo =
- {
- _killed = _this select 0;
- _killer = _this select 1;
- _killers = units (group _killer);
- _types = [ ];
- _processed = [ ];
- _tempNum1 = _killed getvariable "support";
- if (_tempNum1 == 1) then {
- { _x setvariable ["support",0];
- }
- foreach units (group _killed);
- {
- if (!((vehicle _x) in _processed)) then {
- _processed = _processed + [(vehicle _x)];
- _tempNum2 = 1;
- _passedIn = 0;
- _tempVeh = _x;
- {
- if ((typeof _tempVeh)==(_x select 0)) then
- {
- _passedIn = 1;
- };
- }
- forEach _types;
- if (_passedIn==0) then {
- _types = _types + [[(typeof _veh),1]];
- } else {
- { if ((_x select 0)==(typeof _tempVeh) then {
- _x set [1,(_x select 1) + 1];
- };
- }
- foreach _types;
- };
- };
- } foreach _killers;
- //killers (friendly) array created
- //block for closest marker select
- _closest = (getmarkerpos (supMarkers select 0)) distance (getpos _killed);
- _closestMarker = 0;
- {
- if (((getpos _killed) distance (getMarkerPos _x))< _closest) then {
- _closestMarker = _forEachIndex;
- };
- }
- forEach supMarkers;
- //spawn support units
- //set general amounts for each type
- _supportType = [["Man",0],["Car",0],["Tank",0],["Helicopter",0],["Plane",0]];
- {
- _tempVeh = _x;
- {
- if ((_x select 0) isKindOf (_tempVeh select 0)) then {
- while {(_x select 1)>0} do {
- _tempVeh set [1,(_tempVeh select 1) + 1];
- _x set [1,(_x select 1) - 1];
- };
- };
- } foreach _types;
- _fixAmount = ceil(((_x select 1)^2)/2 + (_x select 1));
- _x set [1,_fixAmount];
- }
- foreach _supportType;
- //set counter unit by random chance. for example, a tank thread might have an AT squad spawned or another tank.
- };
- {
- _x setVariable ["supportCall",1];
- }
- foreach units (group _squad);
- };
- {
- _eHNum = _x addEventHandler
- [
- "killed",
- {
- _varExec = [] call compile format["%1%2 = 1; publicvariable '%1%2';",num1,num2];
- _varCall = _this call varSpawn;
- {
- _x removeEventHandler ["killed",_eHNum];
- }
- foreach units (group _x);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement