Перейти к публикации
Поиск в
  • Дополнительно...
Искать результаты, содержащие...
Искать результаты в...
  • Нужна помощь?

    Создайте тему в соответствующем разделе
    Не нужно писать всё в чат!
  • Загляните на торговую площадку

    Там вы можете купить
    всё что касается игровых серверов
  • Не хотите бан?

    Пожалуйста, ознакомьтесь с нашими правилами
    Не нарушайте порядок!
  • Продаёте или покупаете?

    Пользуйтесь услугами гаранта
    Мы сделаем вашу сделку безопасной

Таблица лидеров


Популярные публикации

Отображаются публикации с наибольшей репутацией на 05/02/19 в Сообщения

  1. 1 балл
    BorizzK

    Беда с русским языком

    Vergas UTF-8 ONLY!!! Какое нафиг ANSI?
  2. 1 балл
    123new

    Беда с русским языком

    ты то видишь в ANSI, а для программы это другая кодировка, и шрифт может не распознаться игрой, и как следствие - не вывестись на экран.
  3. 1 балл
    danisimus

    Беда с русским языком

    serverDZ.cfg открой notepad++, там выбери кодировку "кодировать в utf-8 (без BOM) и все будет видно.
  4. 1 балл
    BorizzK

    Доски. (Баг)

    1 Код на скидку из рук на земле группируются предметы по типам из колес досок и тп построить пирамидку, ну наверное потребкется ну очень много колес или досок Установка Создаем файл - например Hand_Actions_modded.c Помещаем в 3_Game\Systems\Inventory И помещаем в него следующий код: //MOD AUTHOR: BORIZZ.K s-platoon.ru //02.05.2019.0034 modded class HandActionDrop extends HandActionBase { bool m_HandActionDropMyDebug = true; override void Action (HandEventBase e) { Man player = e.m_Player; EntityAI item = e.m_Entity; string myDebugString = "::: SERVER: [HandActionDrop DEBUG]: "; super.Action(e); if (m_HandActionDropMyDebug) { PlayerIdentity player_Identity = player.GetIdentity(); string player_Name = player_Identity.GetName(); string player_UID = player_Identity.GetPlainId(); EntityAI itemInHands = NULL; itemInHands = player.GetHumanInventory().GetEntityInHands(); Print(myDebugString + "Action: input: HandEventBase e = " + e.ToString() + ": player = " + player_Name + ", player pos: " + player.GetPosition() + " DROP: item = " + item.ToString() + " : item.GetPosition() = " + item.GetPosition() +", itemInHands = " + itemInHands.ToString()); Print(myDebugString + "Current surface alt: " + GetGame().SurfaceY(player.GetPosition()[0], player.GetPosition()[2])); Print(myDebugString + "Current surface normal: " + GetGame().SurfaceGetNormal(player.GetPosition()[0], player.GetPosition()[2]).ToString()); string SurfaceType, SurfaceType3D; GetGame().SurfaceGetType(player.GetPosition()[0], player.GetPosition()[2], SurfaceType); GetGame().SurfaceGetType3D(player.GetPosition()[0], player.GetPosition()[1], player.GetPosition()[2], SurfaceType3D); Print(myDebugString + "Current surface types: SurfaceType = " + SurfaceType + ", SurfaceType3D = " + SurfaceType3D); } if (item) { dBodyEnableGravity(item,true); //works with ItemBase/EntityAI items? if (m_HandActionDropMyDebug) { Print(myDebugString + "Raycast begin."); vector begPos = item.GetPosition(); // begPos \p vector Begin position of raycast (e.g. player position) vector endPos = Vector(begPos[0], begPos[1] - 0.55, begPos[2]); //begPos + (player.GetDirection() * 100); // endPos \p vector End position of raycast (e.g. player direction) vector contactPos; // contactPos \p vector out, world position of first contact vector contactDir; // contactDir \p vector out, direction of first contact (available only when object is hitted) int contactComponent; // contactComponent \p int out, object component index (available only when object is hitted) int iType = 4; // iType \p int, type of intersection, possible values ObjIntersectFire(0), ObjIntersectView(1), ObjIntersectGeom(2), ObjIntersectIFire(3), ObjIntersectNone(4) float radius = 1.0; // radius \p float Radius of the ray, default value set to 0 DayZPhysics.RaycastRV( begPos, endPos, contactPos, contactDir, contactComponent, NULL, NULL, NULL, false, false, iType, radius); Print("::: Begin pos: " + begPos); Print("::: End pos: " + endPos); Print("::: Contact pos: " + contactPos); Print("::: Contact dir: " + contactDir); Print("::: Component: " + contactComponent); Print("::: iType: " + iType); Print("::: Ray radius: " + radius); Print(myDebugString + "Raycast end."); } vector dropPosition = item.GetPosition(); bool mCorrectDropPos = false; array<Object> nearest_objects = new array<Object>; array<CargoBase> proxy_cargos = new array<CargoBase>; GetGame().GetObjectsAtPosition3D(Vector(dropPosition[0],dropPosition[1] - 0.10,dropPosition[2]),1.1,nearest_objects,proxy_cargos); if (nearest_objects.Count() > 2) { for ( int i = 0; i < nearest_objects.Count(); i++ ) { //Print(myDebugString + "Found near object: nearest_objects[i] = " + nearest_objects[i].GetType() + ", nearest_objects[i].GetPosition() = " + nearest_objects[i].GetPosition() + " :needed dropPosition[1] = " + dropPosition[1]); if (nearest_objects[i] != player && nearest_objects[i] != item && nearest_objects[i].GetType() == item.GetType() && nearest_objects[i].GetPosition()[1] > item.GetPosition()[1] - 1) { Print(myDebugString + "Found a suitable near object: nearest_objects[i] = " + nearest_objects[i].GetType() + ", nearest_objects[i].GetPosition() = " + nearest_objects[i].GetPosition()); if (dropPosition[1] > nearest_objects[i].GetPosition()[1]) { dropPosition[1] = nearest_objects[i].GetPosition()[1]; Print(myDebugString + "Correct dropPosition[1] = " + dropPosition[1] + " to object " + nearest_objects[i].GetType()); mCorrectDropPos = true; } } } if (mCorrectDropPos) { Print(myDebugString + "Need drop position correct"); dropPosition[1] = dropPosition[1] + 0.01; dropPosition[0] = dropPosition[0] + Math.RandomFloatInclusive(-0.050,0.050); dropPosition[1] = dropPosition[1] + Math.RandomFloatInclusive(-0.001,0.020); dropPosition[2] = dropPosition[2] + Math.RandomFloatInclusive(-0.050,0.050); Print(myDebugString + "Finally correct dropPosition[1] = " + dropPosition[1]); item.SetPosition(dropPosition); item.SetOrientation(item.GetOrientation()); Print(myDebugString + "new dropPosition = " + dropPosition.ToString()); } } } } } 2 Код на перемещение из инвентаря на землю находим в папке 4_World\Systems\Inventory файл DayZPlayerInventory.c моддить его нельзя, тк там нативный класс посему открываем и ищем функцию bool HandleInputData (bool handling_juncture, bool remote, ParamsReadContext ctx) в ней в выборе switch (type) ищем case - case InventoryCommandType.SYNC_MOVE: в его теле ищем вызов LocationSyncMoveEntity(src, dst); и после него break; и между ними помещаем следующий код: //MY --- place item from inventory to ground //01.05.2019.2005 if (dst.GetType() == 1) { Print("::: SERVER: [DayZPlayerInventory DEBUG]: 5 HandleInputData: InventoryCommandType.SYNC_MOVE: src.GetType()=" + src.GetType() + ": src=" + src.DumpToString() + ", dst.GetType()=" + dst.GetType() + ": dst=" + dst.DumpToString()); Print("::: SERVER: [DayZPlayerInventory DEBUG]: 5 HandleInputData: InventoryCommandType.SYNC_MOVE: item: " + dst.GetItem().GetType() + ", new position on ground: " + dst.GetItem().GetPosition().ToString()); GetManOwner() //--- code ---// bool m_HandActionDropMyDebug = true; string myDebugString = "::: SERVER: [DayZPlayerInventory DEBUG]: "; EntityAI item = NULL; item = dst.GetItem(); if (!item) break; Print(myDebugString + "item GetManOwner() = " + GetManOwner()); if (item) { dBodyEnableGravity(item,true); //works with ItemBase/EntityAI items? if (m_HandActionDropMyDebug) { Print(myDebugString + "Raycast begin."); vector begPos = item.GetPosition(); // begPos \p vector Begin position of raycast (e.g. player position) vector endPos = Vector(begPos[0], begPos[1] - 0.55, begPos[2]); //begPos + (player.GetDirection() * 100); // endPos \p vector End position of raycast (e.g. player direction) vector contactPos; // contactPos \p vector out, world position of first contact vector contactDir; // contactDir \p vector out, direction of first contact (available only when object is hitted) int contactComponent; // contactComponent \p int out, object component index (available only when object is hitted) int iType = 4; // iType \p int, type of intersection, possible values ObjIntersectFire(0), ObjIntersectView(1), ObjIntersectGeom(2), ObjIntersectIFire(3), ObjIntersectNone(4) float radius = 1.0; // radius \p float Radius of the ray, default value set to 0 DayZPhysics.RaycastRV( begPos, endPos, contactPos, contactDir, contactComponent, NULL, NULL, NULL, false, false, iType, radius); Print("::: Begin pos: " + begPos); Print("::: End pos: " + endPos); Print("::: Contact pos: " + contactPos); Print("::: Contact dir: " + contactDir); Print("::: Component: " + contactComponent); Print("::: iType: " + iType); Print("::: Ray radius: " + radius); Print(myDebugString + "Raycast end."); } vector dropPosition = item.GetPosition(); bool mCorrectDropPos = false; array<Object> nearest_objects = new array<Object>; array<CargoBase> proxy_cargos = new array<CargoBase>; GetGame().GetObjectsAtPosition3D(Vector(dropPosition[0],dropPosition[1] - 0.10,dropPosition[2]),1.1,nearest_objects,proxy_cargos); if (nearest_objects.Count() > 2) { for ( int i = 0; i < nearest_objects.Count(); i++ ) { //Print(myDebugString + "Found near object: nearest_objects[i] = " + nearest_objects[i].GetType() + ", nearest_objects[i].GetPosition() = " + nearest_objects[i].GetPosition() + " :needed dropPosition[1] = " + dropPosition[1]); if (/* nearest_objects[i] != player && */ nearest_objects[i] != item && nearest_objects[i].GetType() == item.GetType() && nearest_objects[i].GetPosition()[1] > item.GetPosition()[1] - 1.1) { Print(myDebugString + "Found a suitable near object: nearest_objects[i] = " + nearest_objects[i].GetType() + ", nearest_objects[i].GetPosition() = " + nearest_objects[i].GetPosition()); if (dropPosition[1] > nearest_objects[i].GetPosition()[1]) { dropPosition[1] = nearest_objects[i].GetPosition()[1]; Print(myDebugString + "Correct dropPosition[1] = " + dropPosition[1] + " to object " + nearest_objects[i].GetType()); mCorrectDropPos = true; } } } if (mCorrectDropPos) { Print(myDebugString + "Need drop position correct:"); dropPosition[1] = dropPosition[1] + 0.01; dropPosition[0] = dropPosition[0] + Math.RandomFloatInclusive(-0.050,0.050); dropPosition[1] = dropPosition[1] + Math.RandomFloatInclusive(-0.001,0.020); dropPosition[2] = dropPosition[2] + Math.RandomFloatInclusive(-0.050,0.050); Print(myDebugString + "Finally correct dropPosition[1] = " + dropPosition[1]); item.SetPosition(dropPosition); item.SetOrientation(item.GetOrientation()); Print(myDebugString + "New dropPosition = " + dropPosition.ToString()); } } } //--- code ---// } //MY --- place item from inventory to ground Проверено Работает P.S. Логгирование и тп оставлено - удаляйте самостаятельно
  5. 1 балл
    BorizzK

    Доски. (Баг)

    //MOD AUTHOR: BORIZZ.K s-platoon.ru //01.05.2019.0111 modded class HandActionDrop extends HandActionBase { bool m_HandActionDropMyDebug = true; override void Action (HandEventBase e) { Man player = e.m_Player; EntityAI item = e.m_Entity; vector dropPosition = player.GetPosition(); super.Action(e); if (m_HandActionDropMyDebug) { PlayerIdentity player_Identity = player.GetIdentity(); string player_Name = player_Identity.GetName(); string player_UID = player_Identity.GetPlainId(); EntityAI itemInHands = NULL; itemInHands = player.GetHumanInventory().GetEntityInHands(); Print("::: SERVER: [HandActionDrop DEBUG]: Action: input: HandEventBase e = " + e.ToString() + ": player = " + player_Name + ", player pos: " + dropPosition + " DROP: item = " + item.ToString() + " : item.GetPosition() = " + item.GetPosition() +", itemInHands = " + itemInHands.ToString()); Print("::: SERVER: [HandActionDrop DEBUG]: Current surface alt: " + GetGame().SurfaceY(dropPosition[0], dropPosition[2])); Print("::: SERVER: [HandActionDrop DEBUG]: Current surface normal: " + GetGame().SurfaceGetNormal(dropPosition[0], dropPosition[2]).ToString()); string SurfaceType, SurfaceType3D; GetGame().SurfaceGetType(dropPosition[0], dropPosition[2], SurfaceType); GetGame().SurfaceGetType3D(dropPosition[0], dropPosition[1], dropPosition[2], SurfaceType3D); Print("::: SERVER: [HandActionDrop DEBUG]: Current surface types: SurfaceType = " + SurfaceType + ", SurfaceType3D = " + SurfaceType3D); } if (player) { Print("::: SERVER: [HandActionDrop DEBUG]: Raycast begin."); // Raycasts world by given parameters vector begPos = player.GetPosition(); // begPos \p vector Begin position of raycast (e.g. player position) vector endPos = Vector(begPos[0], begPos[1] - 0.5, begPos[2]); //begPos + (player.GetDirection() * 100); // endPos \p vector End position of raycast (e.g. player direction) vector contactPos; // contactPos \p vector out, world position of first contact vector contactDir; // contactDir \p vector out, direction of first contact (available only when object is hitted) int contactComponent; // contactComponent \p int out, object component index (available only when object is hitted) int iType = 4; // iType \p int, type of intersection, possible values ObjIntersectFire(0), ObjIntersectView(1), ObjIntersectGeom(2), ObjIntersectIFire(3), ObjIntersectNone(4) float radius = 1.0; // radius \p float Radius of the ray, default value set to 0 //returns \p bool return true if raycast hits ground or object DayZPhysics.RaycastRV( begPos, endPos, contactPos, contactDir, contactComponent, NULL, NULL, NULL, false, false, iType, radius); Print("Begin pos: " + begPos); Print("End pos: " + endPos); Print("Contact pos: " + contactPos); Print("Contact dir: " + contactDir); Print("Component: " + contactComponent); Print("iType: " + iType); Print("Ray radius: " + radius); Print("::: SERVER: [HandActionDrop DEBUG]: Raycast end."); } if (item) { array<Object> nearest_objects = new array<Object>; array<CargoBase> proxy_cargos = new array<CargoBase>; //GetGame().GetObjectsAtPosition(Vector(dropPosition[0],dropPosition[1] - 0.05,dropPosition[2]),1.5,nearest_objects,proxy_cargos); GetGame().GetObjectsAtPosition3D(Vector(dropPosition[0],dropPosition[1] - 0.05,dropPosition[2]),1.01,nearest_objects,proxy_cargos); if (nearest_objects.Count() > 1) { for ( int i = 0; i < nearest_objects.Count(); i++ ) { if (nearest_objects[i].GetType() != player.GetType() || nearest_objects[i].GetPosition()[1] > (dropPosition[1] - 0.10)) { Print("::: SERVER: [HandActionDrop DEBUG]: Found neared object: nearest_objects[i] = " + nearest_objects[i].GetType() + ", nearest_objects[i].GetPosition() = " + nearest_objects[i].GetPosition()); if (dropPosition[1] > nearest_objects[i].GetPosition()[1]) { dropPosition[1] = nearest_objects[i].GetPosition()[1]; Print("::: SERVER: [HandActionDrop DEBUG]: Correct dropPosition[1] = " + dropPosition[1] + " to object " + nearest_objects[i].GetType()); } } } dropPosition[1] = dropPosition[1] + 0.01; dropPosition[0] = dropPosition[0] + Math.RandomFloatInclusive(-0.1,0.1); dropPosition[1] = dropPosition[1] + Math.RandomFloatInclusive(-0.010,0.010); dropPosition[2] = dropPosition[2] + Math.RandomFloatInclusive(-0.1,0.1); Print("::: SERVER: [HandActionDrop DEBUG]: Finally correct dropPosition[1] = " + dropPosition[1]); item.SetPosition(dropPosition); item.SetOrientation(item.GetOrientation()); Print("::: SERVER: [HandActionDrop DEBUG]: new dropPosition = " + dropPosition.ToString()); } } } } С логгированием и рейкстом для теста работает вроде норм
×
×
  • Создать...

Важная информация

Используя этот сайт, вы автоматически обязуетесь соблюдать наши Правила и Политика конфиденциальности.
Чтобы сделать этот веб-сайт лучше, мы разместили cookies на вашем устройстве. Вы можете изменить свои настройки cookies, в противном случае мы будем считать, что вы согласны с этим.

Поддержка