Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. If you're only using one city (instead of dynamically finding cities that belong to a side), you can use this as a quick method to determine if one side has more groups nearby than the other.
  2.  
  3. Ex. using East and West
  4.  
  5. //-- Define necessary information
  6. _position = getPos player; //-- Town pos
  7. _distance = 500; //-- Distance to check for groups
  8.  
  9. //-- Get nearby west groups
  10. _westInf = count ([_position, _distance, ["WEST","entity"]] call ALIVE_fnc_getNearProfiles);
  11. _westVeh = count ([_position, _distance, ["WEST","vehicle"]] call ALIVE_fnc_getNearProfiles);
  12. _west = _westInf + _westVeh;
  13.  
  14. //-- Get nearby east groups
  15. _eastInf = count ([_position, _distance, ["WEST","entity"]] call ALIVE_fnc_getNearProfiles);
  16. _eastVeh = count ([_position, _distance, ["WEST","vehicle"]] call ALIVE_fnc_getNearProfiles);
  17. _east = _eastInf + _eastVeh;
  18.  
  19. if (_west > _east) then {hint "West is in control of the area"} else {hint "East is in control of the area"};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement