Advertisement
Guest User

Untitled

a guest
May 29th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. AS_GANG_faction1 = _this select 0;
  2. AS_GANG_faction2 = _this select 1;
  3. AS_GANG_region = _this select 2;
  4. AS_GANG_fight = true;publicVariable "AS_GANG_fight";
  5. {
  6. if ((_x select 1) == AS_GANG_region) then {AS_GANG_region_pos = _x select 0;AS_GANG_region_x = _x select 2;AS_GANG_region_y = _x select 3;};
  7. } forEach AS_GANG_zones;
  8. AS_GANG_killsTeam1 = 0;
  9. AS_GANG_killsTeam2 = 0;
  10. _time = 0;
  11. while {_time < 20} do {_time = _time + 4;AS_GANG_region setMarkerColor "ColorRed";sleep 2;AS_GANG_region setMarkerColor "ColorGrey";sleep 2};
  12. AS_GANG_region setMarkerColor "ColorRed";
  13. // Game End
  14.  
  15. _winner = objNull;
  16. _loser = objNull;
  17. if (AS_GANG_killsTeam1 > AS_GANG_killsTeam2) then {_winner = (units AS_GANG_faction1) select 0;_loser = (units AS_GANG_faction2) select 0;};
  18. if (AS_GANG_killsTeam2 > AS_GANG_killsTeam1) then {_winner = (units AS_GANG_faction2) select 0;_loser = (units AS_GANG_faction1) select 0;};
  19. if (AS_GANG_killsTeam2 == AS_GANG_killsTeam1) then {_winner = (units AS_GANG_faction2) select 0;_loser = (units AS_GANG_faction1) select 0;};
  20.  
  21. [[1,format ["A gang war has just ended! The region %1 has been captured by the gang of %2",AS_GANG_region,name _winner]],"life_fnc_broadcast",true,false] spawn life_fnc_mp;
  22. [AS_GANG_region,group _winner] spawn TON_fnc_AS_GANG_takeTerr;
  23. sleep 0.1;
  24. AS_GANG_fight = false;publicVariable "AS_GANG_fight";
  25. sleep 1800;
  26. _name = AS_GANG_region;
  27. _toSelect = [];
  28. _index = -1;
  29. {
  30. _index = _index + 1;
  31. if ((_x select 1) isEqualTo _name) exitWith {_toSelect = _x;};
  32. } forEach AS_GANG_zones;
  33. AS_GANG_zones set [_index,[_toSelect select 0,_toSelect select 1,_toSelect select 2,_toSelect select 3,_toSelect select 4,_toSelect select 5,_toSelect select 6,_toSelect select 7, _toSelect select 8,false]];
  34. AS_GANG_fight = false;publicVariable "AS_GANG_fight";
  35.  
  36. diag_log "A gangwar has ended";
  37.  
  38. { [[_toSelect select 4],"life_fnc_AS_GANG_end"] spawn life_fnc_mp;[[],"life_fnc_AS_GANG_update"] spawn life_fnc_mp; } forEach (units (group _winner));
  39. { [[],"life_fnc_AS_GANG_update"] spawn life_fnc_mp; } forEach (units (group _loser));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement