Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Define code: execVM "WhateverYouNamedThisCode.sqf";
- // Example spawn: _Group1 = [east,["O_Soldier_F"],5,getPos spawnPosition,getPos attackPosition] call OKS_SpawnAttackGroup;
- OKS_SpawnAttackGroup = {
- if(!isServer) exitWith {};
- Params ["_Side","_ClassnamesArray","_AmountOfSoldiers","_SpawnPos","_AttackPos"];
- Private _Group = CreateGroup _Side;
- For "_i" from 0 to _AmountOfSoldiers do {
- if ( (count (units _Group)) == 0 ) then
- {
- _Unit = _Group CreateUnit [selectRandom _ClassnamesArray, _SpawnPos getPos [random 10,random 360], [], 0, "NONE"];
- _Unit setRank "SERGEANT";
- } else {
- _Unit = _Group CreateUnit [selectRandom _ClassnamesArray, _SpawnPos getPos [random 10,random 360] [], 0, "NONE"];
- _Unit setRank "PRIVATE";
- };
- };
- _WP = _Group addWaypoint [_AttackPos, 0];
- _WP setWaypointType "SAD";
- _WP setWaypointBehaviour "AWARE";
- _Group;
- };
- /*
- _Group1 = [east,["O_Soldier_F"],5,getPos spawnPosition,getPos attackPosition] call OKS_SpawnAttackGroup;
- 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
- and fleeing like the example below
- waitUntil{sleep 5; {Alive _X || !fleeing _X} count units _Group1 == 0};
- Followed by another attack wave
- _Group2 = [east,["O_Soldier_F"],5,getPos spawnPosition,getPos attackPosition] call OKS_SpawnAttackGroup;
- etc.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement