Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
BigCrazyCat

Добавление зданий на карту

Делал по этому гайду.

Расставил здания в редакторе,сохранил.Скопировал нужные обьекты в файл sectorb.sqf, а сам файл закину в папку maps в дейзсервер.пбо

Выглядит примерно так:

if (isServer) then {

_vehicle_21 = objNull;
if (true) then
{
  _this = createVehicle ["Gue_WarfareBBarracks", [16506.316, 18290.75, 0.00010681152], [], 0, "CAN_COLLIDE"];
  _vehicle_21 = _this;
  _this setDir -50.340839;
  _this setPos [16506.316, 18290.75, 0.00010681152];
};

_vehicle_22 = objNull;
if (true) then
{
  _this = createVehicle ["Base_WarfareBBarrier10xTall", [16342.88, 18336.004, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
  _vehicle_22 = _this;
  _this setDir 35.966526;
  _this setPos [16342.88, 18336.004, 7.6293945e-006];
};

И так далее.

Прописал путь к файлу в server_functions ( [] execVM "\z\addons\dayz_server\maps\sectorb.sqf";)

Захожу на сервер - ничего нет на том месте.Где искать ошибку?

Edited by BigCrazyCat (see edit history)

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Делал по этому гайду.

Расставил здания в редакторе,сохранил.Скопировал нужные обьекты в файл sectorb.sqf, а сам файл закину в папку maps в дейзсервер.пбо

Выглядит примерно так:

if (isServer) then {

_vehicle_21 = objNull;
if (true) then
{
  _this = createVehicle ["Gue_WarfareBBarracks", [16506.316, 18290.75, 0.00010681152], [], 0, "CAN_COLLIDE"];
  _vehicle_21 = _this;
  _this setDir -50.340839;
  _this setPos [16506.316, 18290.75, 0.00010681152];
};

_vehicle_22 = objNull;
if (true) then
{
  _this = createVehicle ["Base_WarfareBBarrier10xTall", [16342.88, 18336.004, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
  _vehicle_22 = _this;
  _this setDir 35.966526;
  _this setPos [16342.88, 18336.004, 7.6293945e-006];
};

И так далее.

Прописал путь к файлу в server_functions ( [] execVM "\z\addons\dayz_server\maps\sectorb.sqf";)

Захожу на сервер - ничего нет на том месте.Где искать ошибку?

скобку закрой, короче в конце ещё допиши

}; 

Edited by droplet (see edit history)

Share this post


Link to post
Share on other sites










  • 0

скобку закрой, короче в конце ещё допиши

}; 

Спасибо,забыл

Share this post


Link to post
Share on other sites
  • 0

Можно еще более оптимизировать.

 

// ********************************************************************************************* >>  Объявляем переменные 
private ["_structure","_trader","_guard"]; // здания, торговцы, охрана....


if (isServer) then {


// ********************************************************************************************* >> Создаем декорации центрального рынка.
  _structure = createVehicle ["CDF_WarfareBContructionSite1", [7119.6836, 10919.202, 3.6239624e-005], [], 0, "CAN_COLLIDE"];
  _structure setDir 27.8971;
  _structure setPos [7119.6836, 10919.202, 3.6239624e-005];
// ********************************************************************************************* >> Создаем декорации центрального рынка.
};
 
_vehicle_22 = objNull;
if (true) then
{
..................................................
 _vehicle_22 = _this;
..................................................
};

Извращения с переменной  _vehicle, смысловой нагрузки не несут, лишь засоряют код и все. 

 

Share this post


Link to post
Share on other sites
  • 0

нонейм зачем все стер? какие еще не по теме сообщения? еще как по теме, название темы перечитай пожалуйста повнимательнее :angry:
лучше свое сообщение удали, позорное, человеку ответили нормально аж в начале лета 14 года...

а ты в файл логов послал человека, в которых он не разберется и ему уже вообще врятли уже надо, поди и сервера уже нет
верни мои и Ника сообщения :crying:


ЗЫ: уже не надо, все решил и так.

Edited by evgeniyk (see edit history)

Share this post


Link to post
Share on other sites
  • 0
11 час назад, evgeniyk сказал:

какие еще не по теме сообщения?

1 тема - 1 вопрос.

В теме был вопрос -

В 31.07.2014 в 13:48, BigCrazyCat сказал:

Захожу на сервер - ничего нет на том месте.Где искать ошибку?

Ответы были даны.

Остальное офф топ.

 

Советую научится читать и пользоваться форумом, а не засирать 1 тему разомастными вопросы, даже если они являются вытекающими, или косвенно касаются темы.

 

Создавайте другую тему.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By BorizzK
      //Функция создания зданий/обьектов BORIZZ.K //Не поставит здание/обьект там где оно уже есть в радиусе 10м!!! //параметры вызова //НазваниеКласса, координаты, коррекция высоты (добавляется к высоте если > 0 - можно поставить здание на здание/поверхность выше земли или повесить в воздухе), Ориентация, Направление. int SpawnBuilding(string m_Building_Class, vector spawn_Point, float alt_Correct, vector spawn_Orient, vector spawn_Dir) //Спавн { Print("::: SpawnBuilding ::: SpawnBuilding(m_Building_Class = " + m_Building_Class + ", spawn_Point = " + spawn_Point.ToString() + ", alt_Correct = " + alt_Correct + ", spawn_Orient = " + spawn_Orient + ", spawn_Dir = " + spawn_Dir + ") :::"); array<Object> nearest_objects = new array<Object>; array<CargoBase> proxy_cargos = new array<CargoBase>; string className; Object object; float radius = 10; Object m_Building; int n_Building_Count = 0; spawn_Point[1] = GetGame().SurfaceY( spawn_Point[0], spawn_Point[2] ); if (alt_Correct > 0) { spawn_Point[1] = spawn_Point[1] + alt_Correct; } GetGame().GetObjectsAtPosition(spawn_Point, radius, nearest_objects, proxy_cargos); Print("::: SpawnBuilding ::: Radius: " + radius.ToString() + ", all nearest_objects: " + nearest_objects.Count().ToString() + " :::"); for ( int i = 0; i < nearest_objects.Count(); i++ ) { object = nearest_objects.Get(i); className = object.GetType(); if ( className == m_Building_Class ) { Print("::: SpawnBuilding ::: Found object: " + object.ToString() + ", className: " + className + ", Position: " + object.GetPosition() + " : Spawn " + m_Building_Class + " cancelled. ::: "); return 0; } } m_Building = GetGame().CreateObject( m_Building_Class, spawn_Point, false, true ); //m_Building.PlaceOnSurface(); if ( spawn_Orient[0] == 0 && spawn_Orient[1] == 0 && spawn_Orient[2] == 0) { m_Building.SetOrientation(m_Building.GetOrientation()); } else { m_Building.SetOrientation(spawn_Orient); } if ( spawn_Dir[0] == 0 && spawn_Dir[1] == 0 && spawn_Dir[2] == 0) { m_Building.SetDirection(m_Building.GetDirection()); } else { m_Building.SetDirection(spawn_Dir); } if (m_Building) { Print("::: SpawnBuilding ::: Result: Object: " + m_Building.ToString() + ", spawn_Point = " + m_Building.GetPosition().ToString() + ", alt_Correct = " + alt_Correct + ", spawn_Orient = " + m_Building.GetOrientation().ToString() + ", spawn_Dir = " + m_Building.GetDirection().ToString() + ") :::"); return 1; } else { Print("::: SpawnBuilding ::: Result: create object error. :::"); } return 0; } void SpawnBuildings() { int Buildings_Count; // пример Buildings_Count = SpawnBuilding("Land_City_FireStation", "6275 0 8013" , 0, "0 0 0", "0 0 40"); // Buildings_Count будет = 0 если здание не поставлено, 1 если поставлено } Простой способ установки
      Вставить в init.c (ВНЕ КЛАССА!)

      Вызывать в конце main()
      вот так
      SpawnBuildings();
       
      в функции SpawnBuildings() по примеру (там есть) прописываем какие здания куда, какая ориентация/и или направление
       
       
    • By Sovest2
      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

      Подготовка
      Для начала нам понадобится подключить кастомный player_death.sqf в compiles.sqf
      Делается это следующим образом:
      В compiles.sqf заменить строку 
      player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf"; на
      player_death = compile preprocessFileLineNumbers "*ВАШ ПУТЬ*\player_death.sqf";  
      Если у вас стоит инфистар,то необходимо заменить строку в AH.sqf
      _death = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_death.sqf'; на
      _death = compile preprocessFileLineNumbers '*ВАШ ПУТЬ*\player_death.sqf';  
      В вашем кастомном player_death.sqf необходимо заменить 
      _array = _this; if (count _array > 0) then { _source = _array select 0; _method = _array select 1; if ((!isNull _source) && (_source != player)) then { _canHitFree = player getVariable ["freeTarget",false]; _isBandit = (player getVariable["humanity",0]) <= -2000; _punishment = _canHitFree || _isBandit; //if u are bandit || start first - player will not recieve humanity drop _humanityHit = 0; if (!_punishment) then { //i'm "not guilty" - kill me && be punished _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000; _humanityHit = -(2000 - _myKills); _kills = _source getVariable ["humanKills",0]; _source setVariable ["humanKills",(_kills + 1),true]; PVDZE_send = [_source,"Humanity",[_source,_humanityHit,300]]; publicVariableServer "PVDZE_send"; } else { //i'm "guilty" - kill me as bandit _killsV = _source getVariable ["banditKills",0]; _source setVariable ["banditKills",(_killsV + 1),true]; }; }; _body setVariable ["deathType",_method,true]; }; на
      _array = _this; if (count _array > 0) then { _source = _array select 0; _method = _array select 1; if ((!isNull _source) && (_source != player)) then { [player,_source]execVM "*ВАШ ПУТЬ*\humanityChange.sqf"; [player,_source]execVM "*ВАШ ПУТЬ*\kill_msg_send.sqf"; }; _body setVariable ["deathType",_method,true]; }; Отображение ника убийцы(Kill message)
       
      Создаем файл и закидываем в миссию файл kill_msg_send.sqf
      С содержанием
      private ["_victim","_killer","_vehicle","_weapon","_pic"]; _victim = _this select 0; _killer = _this select 1; _killerName = name _killer; _victimName = name _victim; _vehicle = typeOf (vehicle _killer); _weapon = currentWeapon _killer; if ((getText (configFile >> "CfgVehicles" >> _vehicle >> "vehicleClass")) in ["CarW","Car","CarD","Armored","Ship","Support","Air","ArmouredW","ArmouredD","SupportWoodland_ACR","AllVehicles"]) then { _pic = gettext(configFile >> 'CfgVehicles' >> _vehicle >> 'picture'); } else { _pic = gettext(configFile >> 'cfgWeapons' >> _weapon >> 'picture'); }; _kill_txt = format ["<t align='left' size='0.5'>%1 </t>",_victimName]; _kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%1'/>",_pic]; _kill_txt = _kill_txt + format ["<t align='left' size='0.5'> %1 </t>",_killerName]; PVDZE_send = [player,"kill_message",[_kill_txt]]; publicVariableServer "PVDZE_send";  
      Далее,нам необходимо отредактировать файл server_sendToClient.sqf ,которой находится в директории сервера
      И добавить после
      case "tagFriendly": { PVDZE_plr_FriendRQ = _arraytosend; _owner publicVariableClient "PVDZE_plr_FriendRQ"; }; Это
      case "kill_message": { custom_kill_message_show = _arraytosend; publicVariable "custom_kill_message_show"; }; Теперь необходимо создать файл kill_msg_show.sqf в папке с вашей миссией
      с содержимым
      private ["_pos","_i"]; arr_kill = ["","","","","",""]; fnc_kill_message = { private ["_finaltxt"]; _finaltxt = _this select 0; for[{_i = 0},{(_i<6)},{_i = _i +1}] do { if((arr_kill select _i) == "") then { arr_kill set [_i,_finaltxt]; [_i] execVM "*ВАШ ПУТЬ*\kill_msg_delete.sqf"; _i = count(arr_kill); }; }; }; "custom_kill_message_show" addPublicVariableEventHandler {(_this select 1) call fnc_kill_message;}; while {true} do { _pos = 0.01; _layout = 1001; { [_x,[safezoneX + 0.01 * safezoneW,2.0],[safezoneY + _pos * safezoneH,0.3],5,0.5,0,_layout] spawn BIS_fnc_dynamicText; _pos = _pos + 0.021; _layout = _layout + 1; } ForEach arr_kill; sleep 1; }; Создать файл kill_msg_delete.sqf с 
      private["_pos"]; _pos = _this select 0; sleep 10; arr_kill set [_pos,""];  
      И вставить в init.sqf после строки
      _playerMonitor = [] execVM "custom\player_monitor.sqf"; строку
      execVM "*ВАШ ПУТЬ*\kill_msg_show.sqf"; Осталось только добавить
      custom_kill_message_show В первую строку файла publicvariable.txt
       
      Все,отображение ника убийцы готово!
       
       
      Изменение человечности за убийство Бандита\Героя
      создать файл humanityChange.sqf с содержимым
      private ["_victim","_killer","_myKills","_humanity","_killerHumanity","_isKillerBandit","_isBandit","_humanityHit","_kills","_killerGunner"]; _victim = _this select 0; _killer = _this select 1; _humanity = _victim getVariable["humanity",0]; _killerHumanity = _killer getVariable["humanity",0]; _isKillerBandit = (_killerHumanity) < 0 ; _isBandit = (_humanity) < 0; _humanityHit = 0; _myKills = 0; _killerVehicle = vehicle _killer; if(((!_isBandit) && _isKillerBandit) || (_isBandit && (!_isKillerBandit))) then { _myKills = round((_humanity) / 10); }; if(!_isBandit) then { _myKills = (_myKills + 200); _kills = _killer getVariable ["humanKills",0]; _killer setVariable ["humanKills",(_kills + 1),true]; } else { _myKills = (_myKills - 200); _kills = _killer getVariable ["banditKills",0]; _killer setVariable ["banditKills",(_kills + 1),true]; }; _killerGunner = gunner _killerVehicle; if(!isNil"_sourceGunner") then { _killer = _killerGunner; }; _humanityHit = _myKills * (-1); PVDZE_send = [_killer,"Humanity",[_killer,_humanityHit,300]]; publicVariableServer "PVDZE_send"; Изменение Человечности готово!
       
      Плюсы Всего этого:
      Отображение ника убийцы теперь работает всегда и корректно.(Если убивают с техники или с одного выстрела).
    • By misha123
      Здравствуйте хотел добавить крафты на сервер. Но не знаю как это сделать. Кто знает как добавить крафты подскажите пожалуйста скрипт. Хочется разнообразить сервер.
      Спасибо за внимание
    • By slava21s
      как добавить здания на сервер в dayz epoch 
    • By etojeflexx
      Доброго времени суток, хотел узнать, как можно подключать дополнительные постройки (допустим построенный город) к основной карте, чтобы не захламлять объектами основной файл миссии? 
  • Our picks

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.