Advertisement
Guest User

Untitled

a guest
Mar 24th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. {
  2. //_nombre = text _x;
  3. _nombre = [text _x, true] call fn_location;
  4. if ((_nombre != "") and (_nombre != "sagonisi") and (_nombre != "hill12")) then//sagonisi is blacklisted in Altis for some reason. If your island has a city in a small island you should blacklist it (road patrols will try to reach it)
  5. {
  6. _sizeX = getNumber (configFile >> "CfgWorlds" >> worldName >> "Names" >> (text _x) >> "radiusA");
  7. _sizeY = getNumber (configFile >> "CfgWorlds" >> worldName >> "Names" >> (text _x) >> "radiusB");
  8. if (_sizeX > _sizeY) then {_size = _sizeX} else {_size = _sizeY};
  9. _pos = getPos _x;
  10. if (_size < 200) then {_size = 200};
  11. _roads = [];
  12. _numCiv = 0;
  13. if (worldName != "Altis") then//If Altis, data is picked from a DB in initVar.sqf, if not, is built on the fly.
  14. {
  15. _numCiv = (count (nearestObjects [_pos, ["house"], _size]));
  16. _roadsProv = _pos nearRoads _size;
  17. //_roads = [];
  18. {
  19. _roadcon = roadsConnectedto _x;
  20. if (count _roadcon == 2) then
  21. {
  22. _roads pushBack (getPosATL _x);
  23. };
  24. } forEach _roadsProv;
  25. carreteras setVariable [_nombre,_roads];
  26. }
  27. else
  28. {
  29. _roads = carreteras getVariable _nombre;
  30. _numCiv = server getVariable _nombre;
  31. if (isNil "_numCiv") then {hint format ["A mi no me sale en %1",_nombre]};
  32. if (typeName _numCiv != typeName 0) then {hint format ["Datos errΓ³neos en %1. Son del tipo %2",_nombre, typeName _numCiv]};
  33. //if (isNil "_roads") then {hint format ["A mi no me sale en %1",_nombre]};
  34. };
  35. _numVeh = round (_numCiv / 3);
  36. _nroads = count _roads;
  37. _nearRoadsFinalSorted = [_roads, [], { _pos distance _x }, "ASCEND"] call BIS_fnc_sortBy;
  38. _pos = _nearRoadsFinalSorted select 0;
  39. _mrk = createmarker [format ["%1", _nombre], _pos];
  40. _mrk setMarkerSize [_size, _size];
  41. _mrk setMarkerShape "RECTANGLE";
  42. _mrk setMarkerBrush "SOLID";
  43. _mrk setMarkerColor "ColorGUER";
  44. _mrk setMarkerText _nombre;
  45. _mrk setMarkerAlpha 0;
  46. ciudades pushBack _nombre;
  47. spawner setVariable [_nombre,false,true];
  48. _dmrk = createMarker [format ["Dum%1",_nombre], _pos];
  49. _dmrk setMarkerShape "ICON";
  50. _dmrk setMarkerType "loc_Cross";
  51. _dmrk setMarkerColor "ColorGUER";
  52. if (_nroads < _numVeh) then {_numVeh = _nroads};
  53.  
  54. _info = [_numCiv, _numVeh, prestigeOPFOR,prestigeBLUFOR,true];//el ultimo true es para ver si tienen electricidad,lo definiremos con un _powered
  55. server setVariable [_nombre,_info,true];
  56.  
  57. //_nul = [_nombre] call crearControles;
  58. };
  59. }foreach (nearestLocations [getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["NameCityCapital","NameCity","NameVillage","CityCenter"], 25000]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement