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
ripdok

Каша в скриптах

Здравствуйте. История такая: заглядываю я сегодня в скрипты серва и вижу (НЕ во всех) в некоторых вот такую хрень:

 

 

 

​ion, _x select 0];
};
} count wai_bandit_missions;

/*

{
for "_i" from 1 to (_x select 1) do {
wai_special_mission set [count wai_special_mission, _x select 0];
};
} count wai_special_missions;

*/

// Start mission monitor
while {true} do
{
_cnt = {alive _x} count playableUnits;
_currTime = floor(time);

if (isNil "_h_missionTime") then { _h_missionTime = ((wai_mission_timer select 0) + random((wai_mission_timer select 1) - (wai_mission_timer select 0))); };
if (isNil "_b_missionTime") then { _b_missionTime = ((wai_mission_timer select 0) + random((wai_mission_timer select 1) - (wai_mission_timer select 0))); };
//if (isNil "_s_missionTime") then { _s_missionTime = ((wai_mission_timer select 0) + random((wai_mission_timer select 1) - (wai_mission_timer select 0))); };

if((_currTime - _h_startTime >= _h_missionTime) && (!h_missionrunning)) then { _result = 1; };
if((_currTime - _b_startTime >= _b_missionTime) && (!b_missionrunning)) then { _result = 2; };
//if((_currTime - _s_startTime >= _s_missionTime) && (!s_missionrunning)) then { _result = 3; };

if(h_missionrunning) then { _h_startTime = floor(time); };
if(b_missionrunning) then { _b_startTime = floor(time); };
//if(s_missionrunning) then { _s_startTime = floor(time); };

if((_cnt >= wai_players_online) && (markerready) && ((diag_fps) >= wai_server_fps)) then {

if (_result == 1) then {
h_missionrunning = true;
_h_startTime = floor(time);
_h_missionTime = nil;
_result = 0;

_mission = wai_hero_mission call BIS_fnc_selectRandom;
execVM format ["\z\addons\dayz_server\WAI\missions\hero\%1.sqf",_mission];
};

if (_result == 2) then {
b_missionrunning = true;
_b_startTime = floor(time);
_b_missionTime = nil;
_result = 0;

_mission = wai_bandit_mission call BIS_fnc_selectRandom;
execVM format ["\z\addons\dayz_server\WAI\missions\bandit\%1.sqf",_mission];
};

/*

if (_result == 3) then {
s_missionrunning = true;
_s_startTime = floor(time);
_s_missionTime = nil;
_result = 0;

_mission = wai_special_mission call BIS_fnc_selectRandom;
execVM format ["\z\addons\dayz_server\WAI\missions\special\%1.sqf",_mission];
};

*/
};
sleep 1;
};
};if(isServer) then {

private ["_mines","_difficulty","_mission","_type","_color","_dot","_position","_marker","_name"];

_position = _this select 0;
_difficulty = _this select 1;
_name = _this select 2;
_type = _this select 3;
_mines = _this select 4;

_mission = count wai_mission_data;

if(debug_mode) then { diag_log("WAI: Starting Mission number " + str(_mission + 1)); };

wai_mission_data = wai_mission_data + [[0,_type,[]]];

if(wai_enable_minefield && _mines) then {
call {
if(_difficulty == "easy") exitWith {_mines = [_position,20,37,20] call minefield;};
if(_difficulty == "medium") exitWith {_mines = [_position,35,52,50] call minefield;};
if(_difficulty == "hard") exitWith {_mines = [_position,50,75,100] call minefield;};
if(_difficulty == "extreme") exitWith {_mines = [_position,60,90,150] call minefield;};
};
wai_mission_data select _mission set [2, _mines];
};

_marker = "";
_dot = "";
_color = "";

call {
if(_difficulty == "easy") exitWith {_color = "ColorGreen"};
if(_difficulty == "medium") exitWith {_color = "ColorYellow"};
if(_difficulty == "hard") exitWith {_color = "ColorRed"};
if(_difficulty == "extreme") exitWith {_color = "ColorBlack"};
_color = _difficulty;
};

call {
if(_type == "mainhero") exitWith { _name = "[B] " + _name; };
if(_type == "mainbandit") exitWith { _name = "[H] " + _name; };
if(_type == "special") exitWith { _name = "[S] " + _name; };
};

[_position, _color, _name, _mission] spawn {

private["_position","_color","_name","_running","_mission","_type","_marker","_dot"];

_position = _this select 0;
_color = _this select 1;
_name = _this select 2;
_mission = _this select 3;
_running = true;

while {_running} do {

_type = (wai_mission_data select _mission) select 1;
 

 

 

 

Кто встречал подобную фигню? И в чем собственно причина таких сдвигов?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Нотпад пробовал? Обычный блокнот портит целостнось скриптов.

Share this post


Link to post
Share on other sites



  • 0

Нотпад пробовал? Обычный блокнот портит целостнось скриптов.

Я использую только notepad++

 

Уж несколько месяцев все было нормально, чтобы я не творил со скриптами, но сейчас вдруг у половины скриптов "поехала крыша" :smile: Пришлось брать дефолтные и все переписывать. вирусня тут точно не причем.

***************************************

Короч, либо сдвиг произошел после копирования dayz_server на другой винч (что мало вероятно и не понятно), либо каким-то волшебным "раком" файлы были открыты и запороты обычным текстовым редактором параллельно с нотиком++... Будьте внимательны! :smile:

Edited by ripdok (see edit history)

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 dimquea
      Иногда может понадобиться использовать реальное время в скриптах. Но если в HiveExt.ini стоит static или тем более был внеплановый рестарт, получить его нереально.
       
      Предлагаю вашему вниманию простой способ.
       
      1) Открываем HiveExt.ini, если у вас не Type = Local, заменяем.
       
      Открываем server_functions.sqf, ищем функцию server_timeSync.
      2) В функции server_timeSync перед:
      setDate _date; добавляем:
      _date set [3, 13]; где 13 время которое стояло в HiveExt.ini.
       
      Теперь запросом:
      _key = "CHILD:307:" call server_hiveReadWrite; мы получим массив с реальной датой и верменем вида [год,месяц,день,час,минута].
       
      Теперь реальное время до рестарта.
      1) В самый конец server_functions.sqf добавляем:
      private ["_key","_date","_rTime"]; _key = "CHILD:307:" call server_hiveReadWrite; if((_key select 0) == "PASS") then {_date = _key select 1;_rTime = (((_date select 3)*60)+(_date select 4));}; {if(_rTime > _x)exitWith{_rTime=(240-(_rTime - _x));}}count[1260,1020,780,540,300,60]; rTime = _rTime; где 240 время между рестартами, а [1260,1020,780,540,300,60] массив представляющий из себя время от полуночи до каждого рестарта. В моём случае время между рестартами 4 часа, а первый рестарт в 1:00.
       
      2) В конец server_playerLogin.sqf добавляем:
      (owner _playerObj) publicVariableClient "rTime";  
      Теперь на клиенте можно использовать rTime, в ней и будет находиться время до рестарта.
          Особая благодарность F507DMT.
  • 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.