Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //set up stuff you need to have set up before units initialise. Put everything inside the if(isServer) since this runs on all clients.
- diag_log "preset running";
- if (isServer) then {
- _players = playersNumber west; //west since players are blufor.
- _weaponcount = floor (_players/1.3);
- _gearcount = floor (_players/3);
- _unitsAdded = 0; //amount of hostile units
- //set weapon box count
- weaponbox = [];
- for "_i" from 1 to 16 do {
- weaponbox set [count weaponbox, _i];
- };
- weaponbox = [weaponbox, 1, _weaponcount] call compile preprocessFile "ai\randomise.sqf";
- _unitsAdded = _unitsAdded + (count weaponbox);
- publicVariable "weaponbox";
- gearbox = [];
- for "_i" from 1 to 5 do {
- gearbox set [count gearbox, _i];
- };
- gearbox = [gearbox, 1, _gearcount] call compile preprocessFile "ai\randomise.sqf";
- _unitsAdded = _unitsAdded + (count gearbox);
- publicVariable "gearbox";
- //This tells everyone the preset is done so the server can start its init, because I don't trust BI to take precautions against race conditions
- preSet = true;
- publicVariable "preSet";
- };
- diag_log "preset ended";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement