Last active
June 18, 2017 06:34
-
-
Save wallopthecat/923915788340d5de2d0a3f905f12b9e1 to your computer and use it in GitHub Desktop.
simple headless script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_spawnUnits={ | |
//regularspawnmethod | |
[]execVM "spawnviaScript.sqf"; | |
True | |
}; | |
//check if HC1 is present | |
HC1Present = if (isNil "HC1") then { False } else { True }; | |
//spawn units on HC1 if present | |
if(HC1Present && isMultiplayer) then { | |
if(!isServer && !hasInterface) then { | |
[] call _spawnUnits; | |
}; | |
} | |
// otherwise spawn units on the server | |
else{ | |
if (isServer) then { | |
[] call _spawnUnits; | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
{ | |
if (count (units _x select {isPlayer _x}) == 0) then { | |
_x setGroupOwner owner HC1; | |
}; | |
}forEach allGroups; | |
}, | |
30, | |
[] | |
] call CBA_fnc_addPerFrameHandler; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
needs to be run from init.sqf after checking for HC1