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
Sign in to follow this  
malamuc

пример скрипта "рандомный выбор из списка, координаты"

ребята, нужен пример вышеописанного скрипта. хочу в данном файле для некоторых трейдеров задать фиксированные, возможные места появления как у boats.sqf

 

/*
Epoch Dynamic Traders my maca134
http://www.epochservers.com


You will need to go into each file in the traders file and change the model/skin to the relevent trader for the map you are using. 
Look in server_traders.sqf in the mission pbo for more information.


*/
private ["_trader_config", "_markers"];


DT_fnc_ObjectsMapper = compile preprocessFileLineNumbers "\z\addons\dayz_server\DynamicTraders\objectMapper.sqf";
DT_fnc_CreateTrader = compile preprocessFileLineNumbers "\z\addons\dayz_server\DynamicTraders\createTrader.sqf";


_trader_config = [
    [1, "hero.sqf",         "Hero Trader",                     "ColorBlue"],
    [1, "bandit.sqf",         "Bandit Trader",                 "ColorRed"],
    [2, "general.sqf",         "Торговец снаряжением / стройматериалами",     "ColorGreen"],
    [2, "helicopters.sqf",     "Black Trader",                     "ColorYellow"],
    [3, "medical.sqf",         "Medical Trader",                 "ColorGreen"],
    [2, "vehicles.sqf",     "Vehicle Trader",                 "ColorYellow"],
    [3, "weapons.sqf",         "Weapons Trader",                 "ColorYellow"],
    [1, "wholesaler.sqf",     "Бакалейщик",                     "ColorBlack"],
    [3, "boat.sqf",         "Торговец катерами",                         "ColorBlack"]
]; 


_markers = [];
waitUntil { sleep 1; !isNil "sm_done" };
{
    for [{_i=0}, {_i<(_x select 0)}, {_i=_i+1}] do {
        private ["_position", "_found_position", "_j", "_near_trader"];
        waitUntil { !isNil "BIS_fnc_findSafePos" };
        _found_position = false;
        _j = 0;
        while {!_found_position} do {
            _j = _j + 1;
            if ((_x select 1) == "boat.sqf") then {
                _position = [getMarkerPos 'center',0,DynamicVehicleArea,20,0,2000,1] call BIS_fnc_findSafePos;
            } else {
                if (!isNil "RoadList" and {(random 1) > 0.5}) then {
                    waitUntil{!isNil "BIS_fnc_selectRandom"};
                    _position = RoadList call BIS_fnc_selectRandom;
                    _position = _position modelToWorld [0,0,0];
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [_position,5,40,20,0,2000,0] call BIS_fnc_findSafePos;
                } else {
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [getMarkerPos 'center',0,DynamicVehicleArea,20,0,2000,0] call BIS_fnc_findSafePos;
                };
            };
            
            {
                if (((_x select 0) distance _position) < 1000) exitWith {
                    _position = [];
                };
                true
            } count _markers;
            if ((count _position) == 2 or _j > 10) then {
                _found_position = true;
            };
        };


        if ((count _position) == 2) then { 
            diag_log format["Trader Caravans: Spawning %1 at %2 (%3)", _x select 1, _position, mapGridPosition _position];
            _position execVM format["\z\addons\dayz_server\DynamicTraders\traders\%1", _x select 1];
            _markers set [count _markers, [_position, _x select 2, _x select 3]];
        };
    };
    true
} count _trader_config;


PV_TraderMarkers = _markers;
publicVariable "PV_TraderMarkers";
 

 

 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0
 


private ["_trader_config", "_markers"];


DT_fnc_ObjectsMapper = compile preprocessFileLineNumbers "\z\addons\dayz_server\DynamicTraders\objectMapper.sqf";
DT_fnc_CreateTrader = compile preprocessFileLineNumbers "\z\addons\dayz_server\DynamicTraders\createTrader.sqf";


_trader_config = [
[1, "hero.sqf", "Hero Trader", "ColorBlue"],
[1, "bandit.sqf", "Bandit Trader", "ColorRed"],
[2, "general.sqf", "Торговец снаряжением / стройматериалами", "ColorGreen"],
[2, "helicopters.sqf", "Black Trader", "ColorYellow"],
[3, "medical.sqf", "Medical Trader", "ColorGreen"],
[2, "vehicles.sqf", "Vehicle Trader", "ColorYellow"],
[3, "weapons.sqf", "Weapons Trader", "ColorYellow"],
[1, "wholesaler.sqf", "Бакалейщик", "ColorBlack"],
[3, "boat.sqf", "Торговец катерами", "ColorBlack"]
];
_btpos = [
[1000,1000],
[2000,2000]
];

_markers = [];
waitUntil { sleep 1; !isNil "sm_done" };
{
for [{_i=0}, {_i<(_x select 0)}, {_i=_i+1}] do {
private ["_position", "_found_position", "_j", "_near_trader"];
waitUntil { !isNil "BIS_fnc_findSafePos" };
_found_position = false;
_j = 0;
if ((_x select 1) == "bt.sqf") then {
_position = _btpos call BIS_fnc_selectRandom;
} else {
while {!_found_position} do {
_j = _j + 1;
if ((_x select 1) == "boat.sqf") then {
_position = [getMarkerPos 'center',0,DynamicVehicleArea,20,0,2000,1] call BIS_fnc_findSafePos;
} else {
if (!isNil "RoadList" and {(random 1) > 0.5}) then {
waitUntil{!isNil "BIS_fnc_selectRandom"};
_position = RoadList call BIS_fnc_selectRandom;
_position = _position modelToWorld [0,0,0];
waitUntil{!isNil "BIS_fnc_findSafePos"};
_position = [_position,5,40,20,0,2000,0] call BIS_fnc_findSafePos;
} else {
waitUntil{!isNil "BIS_fnc_findSafePos"};
_position = [getMarkerPos 'center',0,DynamicVehicleArea,20,0,2000,0] call BIS_fnc_findSafePos;
};
};

{
if (((_x select 0) distance _position) < 1000) exitWith {
_position = [];
};
true
} count _markers;
if ((count _position) == 2 or _j > 10) then {
_found_position = true;
};
};
};

if ((count _position) == 2) then {
diag_log format["Trader Caravans: Spawning %1 at %2 (%3)", _x select 1, _position, mapGridPosition _position];
_position execVM format["\z\addons\dayz_server\DynamicTraders\traders\%1", _x select 1];
_markers set [count _markers, [_position, _x select 2, _x select 3]];
};
};
true
} count _trader_config;


PV_TraderMarkers = _markers;
publicVariable "PV_TraderMarkers";

Share this post


Link to post
Share on other sites






  • 0

Гайд по динамическим трейдерам на сайте видел? Там можно вроде бы подобное делать. Глянь короче.

Share this post


Link to post
Share on other sites
  • 0

Гайд по динамическим трейдерам на сайте видел? Там можно вроде бы подобное делать. Глянь короче.

этот скрипт как раз из этих трейдеров, места для торговцев ищет функция BIS_fnc_findSafePos.

я же хочу задать возможные точки появления для некоторых трейдеров, как это сделано с boats.sqf по умолчанию:

 

            if ((_x select 1) == "boat.sqf") then {
                _position = [getMarkerPos 'center',0,DynamicVehicleArea,20,0,2000,1] call BIS_fnc_findSafePos;
 

но сделать поиск не по функции findSafePos, а по чему-то навроде BIS_fnc_selectRandom (кусок скрипта суисайд):

 

    player playMove (["ActsPercMstpSnonWpstDnon_suicide1B","ActsPercMstpSnonWpstDnon_suicide2B"] call BIS_fnc_selectRandom);

 

главное то - чтоб выбирало из списка уже заданных точек.

Share this post


Link to post
Share on other sites
  • 0

вот что пытаюсь получить в результате (чтоб работало :))
весь скрипт:

 

 

 

/*
Epoch Dynamic Traders my maca134
http://www.epochservers.com
 
You will need to go into each file in the traders file and change the model/skin to the relevent trader for the map you are using. 
Look in server_traders.sqf in the mission pbo for more information.
 
*/
private ["_trader_config", "_markers"];
 
DT_fnc_ObjectsMapper = compile preprocessFileLineNumbers "\z\addons\dayz_server\DynamicTraders\objectMapper.sqf";
DT_fnc_CreateTrader = compile preprocessFileLineNumbers "\z\addons\dayz_server\DynamicTraders\createTrader.sqf";
 
_trader_config = [
    [1, "hero.sqf",         "Hero Trader",                     "ColorBlue"],
    [1, "bandit.sqf",         "Bandit Trader",                 "ColorRed"],
    [2, "general.sqf",         "Торговец снаряжением / стройматериалами",     "ColorGreen"],
    [1, "bt.sqf",             "Торговец черного рынка",                     "ColorBlack"],
    [3, "medical.sqf",         "Medical Trader",                 "ColorGreen"],
    [2, "vehicles.sqf",     "Vehicle Trader",                 "ColorYellow"],
    [3, "weapons.sqf",         "Weapons Trader",                 "ColorYellow"],
    [1, "wholesaler.sqf",     "Бакалейщик",                     "ColorBlack"],
    [1, "catera.sqf",         "Торговец катерами",                         "ColorBlack"],
    [1, "boat.sqf",         "Торговец лодками",                         "ColorBlack"]
]; 
 
_markers = [];
waitUntil { sleep 1; !isNil "sm_done" };
{
    for [{_i=0}, {_i<(_x select 0)}, {_i=_i+1}] do {
        private ["_position", "_found_position", "_j", "_near_trader", "_btpos"];
        waitUntil { !isNil "BIS_fnc_findSafePos","BIS_fnc_selectRandom" };
        _found_position = false;
        _j = 0;
        _btpos = ["1000,1000,0","2000,2000,0","3000,3000,0",];
        while {!_found_position} do {
            _j = _j + 1;
            if ((_x select 1) == "boat.sqf" or (_x select 1) == "catera.sqf") then {
                _position = [getMarkerPos 'center',0,DynamicVehicleArea,20,0,2000,1] call BIS_fnc_findSafePos;
            };
            if (_x select 1) == "bt.sqf" then {
                _position = _btpos select call BIS_fnc_selectRandom;
            } else {
                if (!isNil "RoadList" and {(random 1) > 0.5}) then {
                    waitUntil{!isNil "BIS_fnc_selectRandom"};
                    _position = RoadList call BIS_fnc_selectRandom;
                    _position = _position modelToWorld [0,0,0];
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [_position,5,40,20,0,2000,0] call BIS_fnc_findSafePos;
                } else {
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [getMarkerPos 'center',0,DynamicVehicleArea,20,0,2000,0] call BIS_fnc_findSafePos;
                };
            };
            
            {
                if (((_x select 0) distance _position) < 1000) exitWith {
                    _position = [];
                };
                true
            } count _markers;
            if ((count _position) == 2 or _j > 10) then {
                _found_position = true;
            };
        };
 
        if ((count _position) == 2) then { 
            diag_log format["Trader Caravans: Spawning %1 at %2 (%3)", _x select 1, _position, mapGridPosition _position];
            _position execVM format["\z\addons\dayz_server\DynamicTraders\traders\%1", _x select 1];
            _markers set [count _markers, [_position, _x select 2, _x select 3]];
        };
    };
    true
} count _trader_config;
 
PV_TraderMarkers = _markers;
publicVariable "PV_TraderMarkers";
 

 


 
 

 

 

 

мои вставки туда:
 

 

 

 


 

        private ["_position", "_found_position", "_j", "_near_trader", "_btpos"];        waitUntil { !isNil "BIS_fnc_findSafePos","BIS_fnc_selectRandom" };
        _found_position = false;
        _j = 0;
        _btpos = ["1000,1000,0","2000,2000,0","3000,3000,0",];
 

 

 
....

 

            if (_x select 1) == "bt.sqf" then {
                _position = _btpos select call BIS_fnc_selectRandom;
            } else {
 

 

 

Edited by malamuc (see edit history)

Share this post


Link to post
Share on other sites
  • 0

 

 
private ["_trader_config", "_markers"];


DT_fnc_ObjectsMapper = compile preprocessFileLineNumbers "\z\addons\dayz_server\DynamicTraders\objectMapper.sqf";
DT_fnc_CreateTrader = compile preprocessFileLineNumbers "\z\addons\dayz_server\DynamicTraders\createTrader.sqf";


_trader_config = [
    [1, "hero.sqf",         "Hero Trader",                     "ColorBlue"],
    [1, "bandit.sqf",         "Bandit Trader",                 "ColorRed"],
    [2, "general.sqf",         "Торговец снаряжением / стройматериалами",     "ColorGreen"],
    [2, "helicopters.sqf",     "Black Trader",                     "ColorYellow"],
    [3, "medical.sqf",         "Medical Trader",                 "ColorGreen"],
    [2, "vehicles.sqf",     "Vehicle Trader",                 "ColorYellow"],
    [3, "weapons.sqf",         "Weapons Trader",                 "ColorYellow"],
    [1, "wholesaler.sqf",     "Бакалейщик",                     "ColorBlack"],
    [3, "boat.sqf",         "Торговец катерами",                         "ColorBlack"]
]; 
_btpos = [
[1000,1000],
[2000,2000]
];

_markers = [];
waitUntil { sleep 1; !isNil "sm_done" };
{
    for [{_i=0}, {_i<(_x select 0)}, {_i=_i+1}] do {
        private ["_position", "_found_position", "_j", "_near_trader"];
        waitUntil { !isNil "BIS_fnc_findSafePos" };
        _found_position = false;
        _j = 0;
		 if ((_x select 1) == "bt.sqf") then { 
		 _position = _btpos call BIS_fnc_selectRandom;
		 } else {
        while {!_found_position} do {
            _j = _j + 1;
            if ((_x select 1) == "boat.sqf") then {
                _position = [getMarkerPos 'center',0,DynamicVehicleArea,20,0,2000,1] call BIS_fnc_findSafePos;
            } else {
                if (!isNil "RoadList" and {(random 1) > 0.5}) then {
                    waitUntil{!isNil "BIS_fnc_selectRandom"};
                    _position = RoadList call BIS_fnc_selectRandom;
                    _position = _position modelToWorld [0,0,0];
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [_position,5,40,20,0,2000,0] call BIS_fnc_findSafePos;
                } else {
                    waitUntil{!isNil "BIS_fnc_findSafePos"};
                    _position = [getMarkerPos 'center',0,DynamicVehicleArea,20,0,2000,0] call BIS_fnc_findSafePos;
                };
            };
            
            {
                if (((_x select 0) distance _position) < 1000) exitWith {
                    _position = [];
                };
                true
            } count _markers;
            if ((count _position) == 2 or _j > 10) then {
                _found_position = true;
            };
        };
       };

        if ((count _position) == 2) then { 
            diag_log format["Trader Caravans: Spawning %1 at %2 (%3)", _x select 1, _position, mapGridPosition _position];
            _position execVM format["\z\addons\dayz_server\DynamicTraders\traders\%1", _x select 1];
            _markers set [count _markers, [_position, _x select 2, _x select 3]];
        };
    };
    true
} count _trader_config;


PV_TraderMarkers = _markers;
publicVariable "PV_TraderMarkers";

спасибо большое

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
Sign in to follow this  

  • Similar Content

    • By ZizionarD
      Здравствуйте! Как отключить выбор пола в ESS v3? Спасибо
    • By BorizzK
      Как и обещал выкладываю код и небольшой гайд
       
      Собственно речь о функции загрузки UID и координат из файла в массив m_playersSpawnPoints класса миссии, который в последствии можно исполдьзовать в других функциях в классе миссии
       
      Отступление
      массив m_playersSpawnPoints это массив типа map
      В данном случае <string,string> где и индекс и значение текстовые строки
      индексом выступает записанный UID,  а значением координаты, которые перед использованием преобразуются из текста в vector c помощью функции ToVector()
      Но об этом позже
       
      Раздел 1. Подключение
       
      КОд функции:
      //Players personal spawn points (for new connected players) ref map<string,string> m_playersSpawnPoints = new map<string,string>; void LoadPlayersSpawnPoints() { /* Файл playersSpawnPoints.lst кладем в папку указанную в параметре запуска сервера -profiles= тогда путь будет "$Profile:" или если кладем в файл в mpmissions\dayzOffline.chernarusplus\_CONF путь будет "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\_CONF\\" Путь меняется в переменной m_SettingsPath - "$Profile:" или "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\_CONF\\" Можете указать свой путь, но он должен быть либо в $Profiles: либо в $CurrentDir:\\mpmissions\\dayzOffline.chernarusplus Формат файла: Steam UID в привычном виде 17 цифр Координаты Комментарий (через пробелы) Помните любая ошибка может привести к крашу сервера Не желательны пустые строки! Пример: 76562298156537008 1300 0 5600 Дима 76561998116927209 3000 0 3000 Вася из Новороссийска Про массив: ref map<string, string> m_playersSpawnPoints = new map<string, string>; m_playersSpawnPoints тут массив типа map, где каждый элемент массива состоит из 2х ячеек. 1. Индекс - тип string 2. Значение - тип string Пример работы с массивом типа map Запись в массив m_playersSpawnPoints.Insert("76562298156537008", "1300 0 5600"); //записываем первый элемент - индекс dayz, значение 10 m_playersSpawnPoints.Insert("76561998116927209", "3000 0 3000"); //записываем второй элемент - индекс dayzf, значение 17 Чтение из массива: Получаем значение 0го элемента string m = m_playersSpawnPoints.GetElement(0); // = "1300 0 5600" Получаем индекс 0го элемента string name = m_playersSpawnPoints.GetKey(0); / /= "76562298156537008" Получаем значение по индексу (в данном случае нас интерисует именно ЭТО) string n = m_playersSpawnPoints.Get("76561998116927209"); // = "3000 0 3000" //затем n переводим в вектор Usage in CreateCharacter function for change default spawn position: string PlayerUID = identity.GetPlainId(); if (PlayerUID) { if (m_playersSpawnPoints.Contains(PlayerUID) { pos = m_playersSpawnPoints.Get(PlayerUID).ToVector(); } } */ string FileName = "playersSpawnPoints.lst"; string m_SettingsPath = "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\_CONF\\"; //Folder with config files - .ini or .lst // Or "$Profiles:\\" FileHandle file; string file_line; array<string> read_line; int linecount = 0; //Comments check bool skipline = false; bool skipblock = false; //Comments check file = OpenFile(m_SettingsPath + FileName, FileMode.READ); if (file != 0) { Print("::: Init.c ::: LoadPlayersSpawnPoints() ::: Read File: " + m_SettingsPath + FileName + " :::"); while (FGets(file, file_line) >= 0) { linecount++; //Comments check and skip if (file_line.IndexOfFrom(0,"//") == 0 || file_line.IndexOfFrom(0,"#") == 0 || file_line.IndexOfFrom(0," ") == 0 || file_line.Length() <= 0) { skipline = true; } else { skipline = false; } if (file_line.IndexOfFrom(0,"/*") == 0) { skipblock = true; } else if (file_line.IndexOfFrom(0,"*/") == 0) { skipblock = false; skipline = true; } //Comments check if (!skipline && !skipblock) { read_line = new array<string>; file_line.Split(" ",read_line); if (read_line.Count() >= 4) { if (read_line.Get(0).Length() == 17) { if (read_line.Get(1).ToFloat() > 0 && read_line.Get(3).ToFloat() > 0) { if (!m_playersSpawnPoints.Contains(read_line.Get(0))) { m_playersSpawnPoints.Insert(read_line.Get(0), read_line.Get(1) + " " + read_line.Get(2) + " " + read_line.Get(3)); // UID, Position Print("::: Init.c ::: LoadPlayersSpawnPoints() ::: Read Line c" + linecount + " Add UID " + read_line.Get(0) + " spawnpoint: " + read_line.Get(1) + " " + read_line.Get(2) + " " + read_line.Get(3) + " to m_playersSpawnPoints"); } else { Print("::: Init.c ::: LoadPlayersSpawnPoints() ::: Read Line c" + linecount + " UID " + read_line.Get(0) + " duplicated, check file!"); } } else { Print("::: Init.c ::: LoadPlayersSpawnPoints() ::: Read Line c" + linecount + " Position error: '" + read_line.Get(1) + " " + read_line.Get(2) + " " + read_line.Get(3) + "' :::"); } } else { Print("::: Init.c ::: LoadPlayersSpawnPoints() ::: Read Line c" + linecount + " UID error: " + file_line + " :::"); } } else { Print("::: Init.c ::: LoadPlayersSpawnPoints() ::: Read Line c" + linecount + " have errors: " + file_line + " :::"); } } } CloseFile(file); if (m_playersSpawnPoints.Count() > 0) { Print("::: Init.c ::: LoadPlayersSpawnPoints() ::: Players personal spawn points count: " + m_playersSpawnPoints.Count() + " :::"); } else { Print("::: Init.c ::: LoadPlayersSpawnPoints() ::: Players personal spawn points is not loaded! :::"); } } else { Print("::: Init.c ::: LoadPlayersSpawnPoints() ::: Error open file: " + m_SettingsPath + FileName + " :::"); } } Комментарии, а так же диагностические принты в лог не убираю сознательно
       
      ПОдключение и использование.
       
      Функцию размещаем в теле класса миссии в init.c или если она вынесена в другой файл (и файл подключени через #include) в том самом файле в теле класса миссии
       
      Вот как-то так:
       
      class CustomMission : MissionServer { //Тут разные функции и определение переменных класса... //Вот тут переопределенный штатно OnInit override void OnInit () { //тут его код ) //Тут определяем наш массив и функцию //Players personal spawn points (for new connected players) ref map<string,string> m_playersSpawnPoints = new map<string,string>; void LoadPlayersSpawnPoints() { //тут ее код } //Тут разные функции... }  
      Ну Вы поняли...
       
      Далее нам надо при запуске и инициализации сервера эту функцию выполнить
      Но прежде надо создать файл по нужному пути в котором будут UID'ы и координаты
      В данной редакции используется путь "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\_CONF\\" и имя файла "playersSpawnPoints.lst"
      те в папке mpmissions\dayzOffline.chernarusplus нужно создать папку _CONF и поместить в нее этот файл
      Но вы можете это переделать как Вам больше нравится
       
      Формат файла:
       
      6561198156925007 2698.36 0 5989.59 USER
      6561198156924007 2698.36 0 5989.59 ВАСЯ
       
      6561198156923007 2698.36 0 5989.59 ПЕТЯ
      //Тут комментарий
      /*
      6561193356923001 3698.36 30 5189.59 ПЕТЯ
      */
       
      //Тут комментарий
      #Тут комментарий
       
      Первое поле - позиция - Это Steam UID (17 цифирь)
      2,3,4 поля позиции числа это координаты X Z Y (Z = высота) - если 0 система поставит перса на землю или ближайшую твердую поверхность под ним
      все что дальше игнорится
       
      Можно каментить строки с помощью // , #
      Можно каментить блоки
      /*
      */
       
      Если первый символ в строке пробел, все остальное то же игнорится
      Пустые строки то же игнорятся
       
      Если в строке с UID и координатами ошибка об этом напишет в лог с указанием номера строки
      Если UID дублируется об этом то же напишет в лог
       
      Ок
      Файл создали
       
      Теперь добавим вызов этой функции в тело функции OnInit в классе миссии (про нее речь шла Выше)
      Функция OnInit ВСЕГДА выполняется при запуске сервера
      Внутрь мы добавим вызов LoadPlayersSpawnPoints()
      В итоге при запуске сервера LoadPlayersSpawnPoints() выполнется и запишет в массив m_playersSpawnPoints UID'ы и координат
       
      Добавляем как-то так:
       
      override void OnInit() { //Тут может быть различный код //Тут вызов нашей функции //Load players personal spawn poins LoadPlayersSpawnPoints(); // => m_playersSpawnPoints // "UID", "Position" //Тут может быть различный код }  
      Запустили  сервер и увидели в логе что файл прочитался и все ок
      .... LoadPlayersSpawnPoints() ::: Players personal spawn points count: итд итп
      Или ошибки
      Если ошибки - читаем все еще раз и/или задаем вопросы в теме (НЕ В ЛИЧКЕ!!!) показывая что куда и как Вы прописали
       
      Отлично
      Тормозим в сервер
       
      Продолжение следует минут через 15
       
       
       
       
    • By PJIIOxa
      Подскажите как создать группировки с помощью скрипта + привязать к ним определенный сет экипировки + собственные точки респа?
    • By almalk454
      В общем тыкнул в init.sqf такого рода код: 
      diag_log( format[" INIT CONFIG: isServer: %1 isDedicated: %2 hasInterface: %3 is3DENMultiplayer: %4 playerName: %5 sidePlayer: %6 newSide: %7 ", (isServer), (isDedicated), (hasInterface), (is3DENMultiplayer), (name player), (side player), (getNumber (configFile >> "CfgVehicles" >> (typeOf player) >> "side"))] ); При первичном выборе роли все норм:
      Если релогнуться в лобби выбрать другую роль и зайти снова, то в логе уже следующее:
      Уже пол недели сижу с этой ошибкой, может знает кто как ее решить...
    • By PAnovich
      В общем, делал я скрипт для гонок и столкнулся со следующей проблемой: 
      Вот отрезок кода:
      _group = group player;
      _group addWaypoint [блаблабла координаты]
      waypoint setWaypointStatements ["true", "start_race = 0; systemChat format ['%1. Время пошло', 'Старт']"];
      При присвоении start_race = 0 запускается дебаг который считает время показывает точку и тд. И вот получается какая интересная вещь, когда вейпоинт проходит какой либо игрок start_race = 0 становится у всех игроков, хотя вейпоинты у всех игроков разные. Т.е. Один игрок уже прошел старт, а второй еще нет, но у второго появился дебаг когда прошел первый. И хрен пойми че делать, я заколебался уже. Получается, что start_race делается каким то образом глобальной публичной переменной. Как сделать чтобы она не была таковой?)
  • 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.