Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. if (!isServer)exitWith{};
  2. private ["_heliTurrets","_wpnum","_radius","_gunner2","_skillarray","_startingpos","_heli_class","_startPos","_unitGroup","_pilot","_skill","_position","_wp","_veh"];
  3. _position = _this select 0;
  4. _startingpos = _this select 1;
  5. _radius = _this select 2;
  6. _wpnum = _this select 3;
  7. _heli_class = _this select 4;
  8. _skill = _this select 5;
  9. _skillarray = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
  10.  
  11. _unitGroup = createGroup east;
  12. _pilot = _unitGroup createUnit ["Bandit1_DZ", [0,0,0], [], 1, "NONE"];
  13. [_pilot] joinSilent _unitGroup;
  14. ai_vehicle_units = (ai_vehicle_units + 1);
  15.  
  16. _veh = ["patrol"] call DZMSGetVeh;
  17. _veh = createVehicle [_veh, [(_startingpos select 0),(_startingpos select 1), 0], [], 0, "CAN_COLLIDE"];
  18. [_veh] call DZMSSetupVehicle;
  19. _veh setFuel 1;
  20. _veh engineOn true;
  21. _veh setVehicleAmmo 1;
  22. _veh addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
  23. _veh allowCrewInImmobile true;
  24. _veh lock true;
  25.  
  26. clearWeaponCargoGlobal _veh;
  27. clearMagazineCargoGlobal _veh;
  28.  
  29. PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh];
  30.  
  31. _pilot assignAsDriver _veh;
  32. _pilot moveInDriver _veh;
  33.  
  34. _gunner = _unitGroup createUnit ["Bandit1_DZ", [0,0,0], [], 1, "NONE"];
  35. _gunner assignAsGunner _veh;
  36. _gunner moveInTurret [_veh,[0]];
  37. [_gunner] joinSilent _unitGroup;
  38.  
  39. //Lets set the skills
  40. switch (_skill) do {
  41. case 0: {_aicskill = DZMSSkills0;};
  42. case 1: {_aicskill = DZMSSkills1;};
  43. case 2: {_aicskill = DZMSSkills2;};
  44. case 3: {_aicskill = DZMSSkills3;};
  45. };
  46.  
  47. {_gunner setSkill [(_x select 0),(_x select 1)]} forEach _aicskill;
  48. ai_vehicle_units = (ai_vehicle_units + 1);
  49.  
  50. {_pilot setSkill [(_x select 0),(_x select 1)]} forEach _aicskill;
  51. {_x addweapon "Makarov";_x addmagazine "8Rnd_9x18_Makarov";_x addmagazine "8Rnd_9x18_Makarov";} forEach (units _unitgroup);
  52. {_x addEventHandler ["Killed",{[_this select 0, _this select 1, "vehicle"] call on_kill;}];} forEach (units _unitgroup);
  53. [_veh] spawn veh_monitor;
  54.  
  55. _unitGroup allowFleeing 0;
  56. _unitGroup setBehaviour "AWARE";
  57. //_unitGroup setSpeedMode "FULL";
  58. _unitGroup setCombatMode "RED";
  59. for "_i" from 1 to _wpnum do {
  60. _wp = _unitGroup addWaypoint [[(_position select 0),(_position select 1),0],_radius];
  61. _wp setWaypointType "SAD";
  62. _wp setWaypointCompletionRadius 200;
  63. };
  64.  
  65. _wp = _unitGroup addWaypoint [[(_position select 0),(_position select 1),0],100];
  66. _wp setWaypointType "CYCLE";
  67. _wp setWaypointCompletionRadius 200;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement