Advertisement
Guest User

Untitled

a guest
May 4th, 2022
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. // Define code: execVM "WhateverYouNamedThisCode.sqf";
  2. // Example spawn: _Group1 = [east,["O_Soldier_F"],5,getPos spawnPosition,getPos attackPosition] call OKS_SpawnAttackGroup;
  3.  
  4. OKS_SpawnAttackGroup = {
  5. if(!isServer) exitWith {};
  6.  
  7. Params ["_Side","_ClassnamesArray","_AmountOfSoldiers","_SpawnPos","_AttackPos"];
  8.  
  9. Private _Group = CreateGroup _Side;
  10. For "_i" from 0 to _AmountOfSoldiers do {
  11. if ( (count (units _Group)) == 0 ) then
  12. {
  13. _Unit = _Group CreateUnit [selectRandom _ClassnamesArray, _SpawnPos getPos [random 10,random 360], [], 0, "NONE"];
  14. _Unit setRank "SERGEANT";
  15. } else {
  16. _Unit = _Group CreateUnit [selectRandom _ClassnamesArray, _SpawnPos getPos [random 10,random 360] [], 0, "NONE"];
  17. _Unit setRank "PRIVATE";
  18. };
  19. };
  20.  
  21. _WP = _Group addWaypoint [_AttackPos, 0];
  22. _WP setWaypointType "SAD";
  23. _WP setWaypointBehaviour "AWARE";
  24.  
  25. _Group;
  26.  
  27. };
  28.  
  29. /*
  30. _Group1 = [east,["O_Soldier_F"],5,getPos spawnPosition,getPos attackPosition] call OKS_SpawnAttackGroup;
  31.  
  32. this code will return the group name into _Group1 so in a single script with numerous spawns you could do a waitUntil all area dead
  33. and fleeing like the example below
  34.  
  35. waitUntil{sleep 5; {Alive _X || !fleeing _X} count units _Group1 == 0};
  36.  
  37. Followed by another attack wave
  38. _Group2 = [east,["O_Soldier_F"],5,getPos spawnPosition,getPos attackPosition] call OKS_SpawnAttackGroup;
  39.  
  40. etc.
  41.  
  42.  
  43. */
  44.  
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement