Skip to content

Instantly share code, notes, and snippets.

@wallopthecat
Last active June 18, 2017 06:34
Show Gist options
  • Save wallopthecat/923915788340d5de2d0a3f905f12b9e1 to your computer and use it in GitHub Desktop.
Save wallopthecat/923915788340d5de2d0a3f905f12b9e1 to your computer and use it in GitHub Desktop.
simple headless script
_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;
};
};
[
{
{
if (count (units _x select {isPlayer _x}) == 0) then {
_x setGroupOwner owner HC1;
};
}forEach allGroups;
},
30,
[]
] call CBA_fnc_addPerFrameHandler;
@wallopthecat
Copy link
Author

needs to be run from init.sqf after checking for HC1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment