Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. 0 = [] spawn {
  2. sleep 10;
  3.  
  4. private ["_maxZeds","_minDist","_maxDist","_addMed","_ZedsSlow","_ZedsFast","_sZedsNum","_mZedsNum","_fastSlow","_ZedType","_plusX","_plusY"];
  5. _minDist = 50;
  6. _maxDist = 50;
  7. _addMed = 1;
  8.  
  9. _ZedsSlow= ["RyanZombieC_man_1SlowOpfor","RyanZombieC_man_polo_1_FSlowOpfor","RyanZombieC_man_pilot_FSlowOpfor","RyanZombieC_journalist_FSlowOpfor","RyanZombieC_OrestesSlowOpfor","RyanZombieC_NikosSlowOpfor","RyanZombieC_man_polo_2_FSlowOpfor","RyanZombieC_man_polo_4_FSlowOpfor","RyanZombieC_man_polo_5_FSlowOpfor","RyanZombieC_man_polo_6_FSlowOpfor","RyanZombieC_man_p_fugitive_FSlowOpfor","RyanZombieC_man_w_worker_FSlowOpfor","RyanZombieC_scientist_FSlowOpfor","RyanZombieC_man_hunter_1_FSlowOpfor"];
  10. _ZedsFast = ["RyanZombieC_man_1MediumOpfor","RyanZombieC_man_polo_1_FMediumOpfor","RyanZombieC_man_pilot_FMediumOpfor","RyanZombieC_journalist_FMediumOpfor","RyanZombieC_OrestesMediumOpfor","RyanZombieC_NikosMediumOpfor","RyanZombieC_man_polo_2_FMediumOpfor","RyanZombieC_man_polo_4_FMediumOpfor","RyanZombieC_man_polo_5_FMediumOpfor","RyanZombieC_man_polo_6_FMediumOpfor","RyanZombieC_man_p_fugitive_FMediumOpfor","RyanZombieC_man_w_worker_FMediumOpfor","RyanZombieC_scientist_FMediumOpfor","RyanZombieC_man_hunter_1_FMediumOpfor"];
  11. _sZedsNum = count _ZedsSlow;
  12. _mZedsNum = count _ZedsFast;
  13. zAmbientGroup = createGroup east;
  14.  
  15. // Checking if player alive
  16. while {alive player} do {
  17.  
  18. // Checking if group is present
  19. if (isNull zAmbientGroup) then {zAmbientGroup = createGroup east};
  20.  
  21. // Selecting number of zeds, more players - less zombies, too keep net load balanced.
  22. if ((count allPlayers) < 5) then {_maxZeds = 9 - (count allPlayers)} else {_maxZeds = 4};
  23.  
  24. // Checking if limit reached
  25. if (count units zAmbientGroup < _maxZeds) then {
  26.  
  27. // Selecting type and position
  28. _fastSlow = (floor(random 3))+1;
  29. _ZedType = _ZedsSlow select (floor(random _sZedsNum ));
  30.  
  31. if ( _fastSlow > 2 and _addMed == 1) then {
  32. _ZedType =_ZedsFast select (floor(random _mZedsNum ));
  33. };
  34.  
  35. _plusX = random 2;
  36. if (_plusX > 1) then {_plusX = 1};
  37. if (_plusX < 1) then {_plusX = -1};
  38.  
  39. _plusY = random 2;
  40. if (_plusY > 1) then {_plusY = 1};
  41. if (_plusY < 1) then {_plusY = -1};
  42.  
  43. _posX = (_minDist + random _maxDist) * _plusX;
  44. _posY = (_minDist + random _maxDist) * _plusY;
  45.  
  46. while {true} do {
  47. //selecting position
  48. sleep 1;
  49. spawnPos = getPos player;
  50. spawnPos = [(spawnPos select 0) + _posX, (spawnPos select 1) + _posY,0];
  51. objPos = getPos Player;
  52. // Spawning zombie
  53. if ({_x distance2D spawnPos < (_minDist*0.75)} count allPlayers == 0) exitWith {
  54. zUnit = zAmbientGroup createUnit [_ZedType,spawnPos,[],1,"NONE"];
  55. };
  56. };
  57. };
  58. //Checking if zombie is dead or player moved too far
  59. {if (((player distance2D _x) > (_minDist+_maxDist)*1.5) || !(alive _x)) then {deleteVehicle _x}} forEach units zAmbientGroup;
  60. // Removing oldest waypoint
  61. while {(count (waypoints zAmbientGroup)) > 1} do {deleteWaypoint ((waypoints zAmbientGroup) select 0)};
  62. // Adding waypoint
  63. wp = zAmbientGroup addWaypoint [objPos,0];
  64. wp setWaypointSpeed "Full";
  65. wp setWaypointType "MOVE";
  66. wp setWaypointBehaviour "COMBAT";
  67. sleep 10;
  68. };
  69. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement