Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. if (isServer) then {
  2. sleep 10;
  3. _vehicle = _this select 0;
  4. _units = _this select 1;
  5. _startPos = getPos _vehicle;
  6.  
  7. countUnits = {
  8. _units = _this select 0;
  9. _i = 0;
  10. {
  11. if (!isNil _x) then {
  12. _i = _i +1;
  13. };
  14. } foreach _units;
  15. _i
  16. };
  17.  
  18. if (typeName _units == typeName []) then { // list of units
  19. if (([_units] call countUnits) <= 0) then { // despawn
  20. _vehicle setPos (getPos vehiclePen);
  21. waitUntil {sleep 5; ([_units] call countUnits) > 0};
  22. _vehicle setPos _startPos;
  23. };
  24. } else { if (typeName _units == typeName "") then { // group var name
  25. if (isNil _units) then { // despawn
  26. _vehicle setPos (getPos vehiclePen);
  27. waitUntil {sleep 5; (!isNil _units)};
  28. _vehicle setPos _startPos;
  29. };
  30. } };
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement