Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. //set up stuff you need to have set up before units initialise. Put everything inside the if(isServer) since this runs on all clients.
  2. diag_log "preset running";
  3. if (isServer) then {
  4.  
  5. _players = playersNumber west; //west since players are blufor.
  6. _weaponcount = floor (_players/1.3);
  7. _gearcount = floor (_players/3);
  8.  
  9. _unitsAdded = 0; //amount of hostile units
  10.  
  11. //set weapon box count
  12. weaponbox = [];
  13. for "_i" from 1 to 16 do {
  14. weaponbox set [count weaponbox, _i];
  15. };
  16. weaponbox = [weaponbox, 1, _weaponcount] call compile preprocessFile "ai\randomise.sqf";
  17. _unitsAdded = _unitsAdded + (count weaponbox);
  18. publicVariable "weaponbox";
  19.  
  20. gearbox = [];
  21. for "_i" from 1 to 5 do {
  22. gearbox set [count gearbox, _i];
  23. };
  24. gearbox = [gearbox, 1, _gearcount] call compile preprocessFile "ai\randomise.sqf";
  25. _unitsAdded = _unitsAdded + (count gearbox);
  26. publicVariable "gearbox";
  27.  
  28. //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
  29. preSet = true;
  30. publicVariable "preSet";
  31.  
  32. };
  33. diag_log "preset ended";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement