Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- //_nombre = text _x;
- _nombre = [text _x, true] call fn_location;
- 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)
- {
- _sizeX = getNumber (configFile >> "CfgWorlds" >> worldName >> "Names" >> (text _x) >> "radiusA");
- _sizeY = getNumber (configFile >> "CfgWorlds" >> worldName >> "Names" >> (text _x) >> "radiusB");
- if (_sizeX > _sizeY) then {_size = _sizeX} else {_size = _sizeY};
- _pos = getPos _x;
- if (_size < 200) then {_size = 200};
- _roads = [];
- _numCiv = 0;
- if (worldName != "Altis") then//If Altis, data is picked from a DB in initVar.sqf, if not, is built on the fly.
- {
- _numCiv = (count (nearestObjects [_pos, ["house"], _size]));
- _roadsProv = _pos nearRoads _size;
- //_roads = [];
- {
- _roadcon = roadsConnectedto _x;
- if (count _roadcon == 2) then
- {
- _roads pushBack (getPosATL _x);
- };
- } forEach _roadsProv;
- carreteras setVariable [_nombre,_roads];
- }
- else
- {
- _roads = carreteras getVariable _nombre;
- _numCiv = server getVariable _nombre;
- if (isNil "_numCiv") then {hint format ["A mi no me sale en %1",_nombre]};
- if (typeName _numCiv != typeName 0) then {hint format ["Datos errΓ³neos en %1. Son del tipo %2",_nombre, typeName _numCiv]};
- //if (isNil "_roads") then {hint format ["A mi no me sale en %1",_nombre]};
- };
- _numVeh = round (_numCiv / 3);
- _nroads = count _roads;
- _nearRoadsFinalSorted = [_roads, [], { _pos distance _x }, "ASCEND"] call BIS_fnc_sortBy;
- _pos = _nearRoadsFinalSorted select 0;
- _mrk = createmarker [format ["%1", _nombre], _pos];
- _mrk setMarkerSize [_size, _size];
- _mrk setMarkerShape "RECTANGLE";
- _mrk setMarkerBrush "SOLID";
- _mrk setMarkerColor "ColorGUER";
- _mrk setMarkerText _nombre;
- _mrk setMarkerAlpha 0;
- ciudades pushBack _nombre;
- spawner setVariable [_nombre,false,true];
- _dmrk = createMarker [format ["Dum%1",_nombre], _pos];
- _dmrk setMarkerShape "ICON";
- _dmrk setMarkerType "loc_Cross";
- _dmrk setMarkerColor "ColorGUER";
- if (_nroads < _numVeh) then {_numVeh = _nroads};
- _info = [_numCiv, _numVeh, prestigeOPFOR,prestigeBLUFOR,true];//el ultimo true es para ver si tienen electricidad,lo definiremos con un _powered
- server setVariable [_nombre,_info,true];
- //_nul = [_nombre] call crearControles;
- };
- }foreach (nearestLocations [getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["NameCityCapital","NameCity","NameVillage","CityCenter"], 25000]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement