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

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

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

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

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

Рекомендованные сообщения

png&fsize=144730&hid=ce9ea92988ecb8f1377

 

Этот скрипт похожий на старую версию сейфзон, но переделан под новую версию Эпохи.

Установка:
1) 
Создать файл с названием safezone.sqf и скопировать содержимое из спойлера в этот файл 

Скрытый текст

/*
   by: http://infiSTAR.de || http://DayzAntiHack.com
   *updated on 13.12.2016 by juandayz for epoch 1.6 community
    //all credits for infi   
*/
USE_CANBUILD = false;        // if you don't want to define your own positions
USE_TraderCity = false;    //    if you don't want to define your own positions (Epoch 1.0.5)
USE_POSITIONS = true;    // to use own positions and radius
USE_AI_REMOVER = false;    // use this to remove Missionbots (AI) within 100m of a player if the player is in a SafeZone
USE_AntiSteal = true;    // use this to block opening gear if another player is within 3m!
USE_SPEEDLIMIT = true;    // very secret function, nobody is supposed to find out what it does.
    SPEEDLIMIT = 25;        // Only used if USE_SPEEDLIMIT is true.
USE_SIGNS = false;        // use this to build signs around the SafeZone
LOG_EnterLeave = true;    // This will log to your .rpt when a player enters or leaves a SafeZone! (only works with infiSTAR.de Admintools / AntiHack)
/* You can use USE_CANBUILD or/and (works together) the custom positions below (USE_POSITIONS) [position or zone,radius] */
_infiSZ =
[
    [[6325.6772,7807.7412,0],150,true],//stary
    [[4063.4226,11664.19,0],150,true],//bash
    [[11447.472,11364.504,0],150,true],//klen
    [[1606.6443,7803.5156,0],150,true],//bandit
    [[12944.227,12766.889,0],150,true],//hero
    [[4361.4937,2259.9526,0],50,true],//wholesalerSouth
    [[12060,12640,0],200,true]//air dealear
];

{
	DZE_SafeZonePosArray set [(count DZE_SafeZonePosArray), [(_x select 0), (_x select 1)]];
} forEach _infiSZ;

if (isServer) exitWith


{
    if (USE_SIGNS) then
    {
        {
            _center = _x select 0;
            _radius = _x select 1;
            _lSign = _x select 2;
            if (_lSign) then
            {
                for '_i' from 0 to 360 step (270 / _radius)*2 do
                {
                    _location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    //    _object = createVehicle ['SignM_FARP_Winchester_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    //    _object setVehicleInit 'this setObjectTexture [0,''Addons\SafeZones\sign.paa''];';
                    _object setDir _dir;
                };
            };
        } forEach _infiSZ;
    };
};
waitUntil {((!isNil 'dayz_animalCheck') || (!isNil 'dayz_medicalH') || (!isNil 'dayz_slowCheck') || (!isNil 'dayz_gui'))};
if (isNil 'inSafeZone') then { inSafeZone = false; } else { if (typename inSafeZone != 'BOOL') then { inSafeZone = false; }; };
[_infiSZ] spawn {
    _infiSZ = _this select 0;
    _startSafeZone =
    {
        if (isNil 'outNow') then
        {
            _msg = 'You entered a Safe Zone!';
            hint _msg;
            taskHint [_msg, [0,1,0,1], 'taskDone'];
            inNow = nil;
            outNow = true;
            
            if (LOG_EnterLeave) then
            {
                PVDZ_send = [player,'SafeZoneState',[1]];
                publicVariableServer 'PVDZ_send';
            };
        };
        player_fired = {
            deleteVehicle (nearestObject [_this select 0,_this select 4]);
            cutText ['You can not fire in a SafeZone!','WHITE IN'];
        };
        //wild_spawnZombies = {};
        zombie_generate = {};
        
        fnc_usec_damageHandler = {};
        player removeAllEventHandlers 'handleDamage';
        player addEventHandler ['handleDamage', {false}];
        player allowDamage false;
        _veh = vehicle player;
        _szs = _veh getVariable ['inSafeZone',0];
        if (_szs == 0) then
        {
            _veh setVariable ['inSafeZone',1,true];
            if (player != _veh) then
            {
                _veh removeAllEventHandlers 'Fired';
                _veh addEventHandler ['Fired', {_this call player_fired;}];
                {
                    _x removeAllEventHandlers 'Fired';
                    _x addEventHandler ['Fired', {_this call player_fired;}];
                } forEach (crew _veh);
                fnc_veh_handleDam = {false};
                _veh removeAllEventHandlers 'HandleDamage';
                _veh addeventhandler ['HandleDamage',{ _this call fnc_veh_handleDam } ];
                _veh allowDamage false;
            };
        };
        _notInSafeZone =
        [
    
            'MAAWS','RPG7V','M136','RPG18','STINGER',
            'MeleeBaseball','MeleeHatchet','MeleeCrowbar','MeleeMachete','MeleeFishingPole','MeleeSledge',
            'MeleeBaseBallBatNails','MeleeBaseBallBatBarbed','MeleeBaseBallBat'
        ];
        _cwep = currentWeapon player;
        if (_cwep in _notInSafeZone) then
        {
            _swep = '';
            {
                if ((getNumber (configFile >> 'CfgWeapons' >> _x >> 'Type')) == 2) exitWith
                {
                    _swep = _x;
                };
            } forEach (weapons player);
            if (_swep == '') then
            {
                player playActionNow 'PutDown';
                _iPos = getPosATL player;
                _radius = 1;
                _removed = ([player,_cwep,1] call BIS_fnc_invRemove);
                if (_removed == 1) then
                {
                    _item = createVehicle ['WeaponHolder', _iPos, [], _radius, 'CAN_COLLIDE'];
                    _item addWeaponCargoGlobal [_cwep,1];
                };
            }
            else
            {
                player selectweapon _swep;
            };
        };
    };
    _endSafeZone =
    {
        if (isNil 'inNow') then
        {
            if (str fnc_usec_damageHandler == '{}') then
            {
                _msg = 'You left the Safe Zone!';
                hint _msg;
                taskHint [_msg, [1,0,0.1,1], 'taskFailed'];
            };
            inNow = true;
            outNow = nil;
            
            if (LOG_EnterLeave) then
            {
                PVDZ_send = [player,'SafeZoneState',[0]];
                publicVariableServer 'PVDZ_send';
            };
        };
        //wild_spawnZombies = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\wild_spawnZombies.sqf';
        zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf";
        //
        
        player_fired = {
            _this call compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_fired.sqf';
            _unit = _this select 0;
            _weapon = _this select 1;
            _muzzle = _this select 2;
            _mode = _this select 3;
            _ammo = _this select 4;
            _magazine = _this select 5;
            _projectile = _this select 6;
            _screenToWorld = screenToWorld [0.5,0.5];
            _near = _screenToWorld nearEntities ['AllVehicles',100];
            {
                if (isPlayer _x) then
                {
                    _szs = _x getVariable ['inSafeZone',0];
                    if (_szs == 1) then
                    {
                        deleteVehicle (nearestObject [_unit,_ammo]);
                    };
                };
            } forEach _near;
        };
        
        fnc_usec_unconscious = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\fn_unconscious.sqf';
        object_monitorGear = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\object_monitorGear.sqf';
        fnc_veh_handleDam = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\veh_handleDam.sqf';
        
        _veh = vehicle player;
        _szs = _veh getVariable ['inSafeZone',0];
        if (_szs == 1) then
        {
            _veh setVariable ['inSafeZone',0,true];
            if (player != _veh) then
            {
                _veh removeAllEventHandlers 'HandleDamage';
                _veh addeventhandler ['HandleDamage',{ _this call fnc_veh_handleDam } ];
                _veh allowDamage true;
            };
        };
        
        _end = false;
        if (isNil 'gmadmin') then
        {
            _end = true;
        }
        else
        {
            if (gmadmin == 0) then
            {
                _end = true;
            };
        };
        if (_end) then
        {
            player allowDamage true;
            fnc_usec_damageHandler = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\fn_damageHandler.sqf';
            player removeAllEventHandlers 'HandleDamage';
            player addeventhandler ['HandleDamage',{_this call fnc_usec_damageHandler;} ];
        };
    };
    while {1 == 1} do
    {
        if (isNil 'inSafeZone') then { inSafeZone = false; } else { if (typename inSafeZone != 'BOOL') then { inSafeZone = false; }; };
        _state = false;
        if (isNil 'USE_POSITIONS') then { USE_POSITIONS = false; } else { if (typename USE_POSITIONS != 'BOOL') then { USE_POSITIONS = false; }; };
        if (USE_POSITIONS) then
        {
            {
                _z = _x select 0;
                _r = _x select 1;
                if ((vehicle player) distance _z < _r) then {_state = true;};
            } forEach _infiSZ;
        };
        if (isNil 'USE_CANBUILD') then { USE_CANBUILD = true; } else { if (typename USE_CANBUILD != 'BOOL') then { USE_CANBUILD = true; }; };
        if (USE_CANBUILD) then
        {
            if (isNil 'canbuild') then { canbuild = true; } else { if (typename canbuild != 'BOOL') then { canbuild = true; }; };
            if (!canbuild) then {_state = true;};
        };
        if (isNil 'USE_TraderCity') then { USE_TraderCity = true; } else { if (typename USE_TraderCity != 'BOOL') then { USE_TraderCity = true; }; };
        if (USE_TraderCity) then
        {
            if (isNil 'isInTraderCity') then { isInTraderCity = false; } else { if (typename isInTraderCity != 'BOOL') then { isInTraderCity = false; }; };
            if (isInTraderCity) then {_state = true;};
        };
        if (_state) then
        {
            inSafeZone = true;
            call _startSafeZone;
            {
                if (!isNull _x) then
                {
                    if !(isPlayer _x) then
                    {
                        deletevehicle _x;
                    };
                };
            } forEach ((vehicle player) nearEntities ['zZombie_Base',50]);
            
            if (isNil 'USE_AI_REMOVER') then { USE_AI_REMOVER = false; } else { if (typename USE_AI_REMOVER != 'BOOL') then { USE_AI_REMOVER = false; }; };
            if (USE_AI_REMOVER) then
            {
                {
                    if ((!isNull group _x) && (getPlayerUID _x == '')) then
                    {
                        deleteVehicle _x;
                    };
                } forEach (player nearEntities ['Man',100]);
            };
        }
        else
        {
            inSafeZone = false;
        };
        uiSleep 2;
        if (!inSafeZone) then
        {
            call _endSafeZone;
        };
    };
};
if ((USE_AntiSteal) || (USE_SPEEDLIMIT)) then
{
    [] spawn {
        _USE_AntiSteal = USE_AntiSteal;
        _USE_SPEEDLIMIT = USE_SPEEDLIMIT;
        _speedlimit = SPEEDLIMIT;
        while {1 == 1} do
        {
            if (inSafezone) then
            {
                if (_USE_AntiSteal) then
                {
                    _cnt = {isPlayer _x && _x != player} count (player nearEntities [['CAManBase'],4]);
                    if ((_cnt > 0) && (!isNull (findDisplay 106))) then
                    {
                        (findDisplay 106) closedisplay 0;
                        closeDialog 0;closeDialog 0;closeDialog 0;
                        _log = format['%1 You are not allowed to open Gear while near another player!',name player];
                        cutText [_log,'PLAIN'];
                        hint _log;
                    };
                };
                if (_USE_SPEEDLIMIT) then
                {
                    _obj = vehicle player;
                    if !(_obj isKindOf 'Plane') then
                    {
                        _speed = abs speed _obj;
                        if ((_obj != player) && (_speed > _speedlimit)) then
                        {
                            _vel = velocity _obj;
                            _x = 0.8;
                            if (_speed > 50) then {_x = 0.1;};
                            _velNew = [(_vel select 0) * _x, (_vel select 1) * _x,(_vel select 2) * _x];
                            _obj SetVelocity _velNew;
                        };
                    };
                };
            }
            else
            {
                uiSleep 2;
            };
            uiSleep .01;
        };
    };
}; 

 

2) Закинуть файл в mpmissioms\instance_11.chernarusornapf\custom\
3) Открыть ваш init.sqf и вписать строку  [] execVM "custom\safezone.sqf"; 
4) Сохранить файл, и перезапустить сервер. 
Внимание
В файле по стандарту используются координаты для карты Chernarus

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах





Положу, на всякий случай, координаты для Napf:

_infiSZ			=	[
	[[8246.7275,15490.344,0],50,true],	// Trader City Lenzburg
	[[12397.357,5068.0298,0],150,true],	// Trader City Schratten
	[[5150.6099,4862.3594,0],150,true],	// Hero Vendor
	[[15128.379,16421.879,0],150,true],	// AWOLs Airfield
	[[2125.5425,7807.833,0],150,true],	// West Wholesaler
	[[5372.1465,16091.704,0],150,true],	// North Wholesaler
	[[6776.3237,16955.648,0],150,true],	// Nordic Boats
	[[10404.296,8282.8232,0],150,true],	// Bandit Vendor
	[[16835.688,5268.064,0],150,true],	// Pauls Boats
	[[15520.298,13225.447,0],150,true]	// Trader City Emmen
];

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

я бы на твоем месте исключил эти "типа трейды", т.к. они по сути трейд зоной не являются.

AWOLs Airfield

West Wholesaler

North Wholesaler

Nordic Boats

Pauls Boats

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
4 часа назад, RedLink сказал:

я бы на твоем месте исключил эти "типа трейды", т.к. они по сути трейд зоной не являются.

Согласен. Сейфзоны имеет смысл ставить только на Клён, Старый, Баш, Бандитку, Геройку. Хотя кому как побольше нравится конечно, зависит от основной идеи сервера и контингента, играющего там

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Спасибо за гайд и + вот еще

работает с первой попытки :cool:

Изменено пользователем Miduznya (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
В 24.03.2017 в 12:27, RedLink сказал:

я бы на твоем месте исключил эти "типа трейды", т.к. они по сути трейд зоной не являются.

AWOLs Airfield

West Wholesaler

North Wholesaler

Nordic Boats

Pauls Boats

Кому надо тот сам удалит, Ломать же не строить. :relaxed:

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Кто нибудь переделывал такие СейфЗоны под PVE? Вместо бандитского рынка - Лагерь героев 2lvl. Или может есть готовые решения?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Димас совсем сложно свои координаты вписать?

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
32 минуты назад, Димас сказал:

Кто нибудь переделывал такие СейфЗоны под PVE? Вместо бандитского рынка - Лагерь героев 2lvl. Или может есть готовые решения?

А какая разница между сейф-зонами на ПВП и ПВЕ серверах? Сей-зона она и в африке сейв-зона, если не менять координаты.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
6 минут назад, Loker сказал:

Димас совсем сложно свои координаты вписать?

Ключевые слова в моём вопросе: "Вместо бандитского рынка - Лагерь героев 2lvl."

2 минуты назад, Ник сказал:

А какая разница между сейф-зонами на ПВП и ПВЕ серверах? Сей-зона она и в африке сейв-зона, если не менять координаты.

Согласен, не в тему.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Димас пропиши свои координаты

Изменено пользователем Loker (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
8 часов назад, Димас сказал:

Ключевые слова в моём вопросе: "Вместо бандитского рынка - Лагерь героев 2lvl."

Я так понял у тебя сложности с получением координат? :geek:
Заходишь на сервер, включаешь в инистаре "Admin debug", в твоём дебаг-мониторе внизу появляются коорднаты твоего местоположения.
Телепорт на твой Лагерь героев 2lvl, скрин делаешь и переписываешь координаты в скрипт сейфзон в строку где бандитский лагерь.

Ну или вместо дебага - можно просто в инфи нажать кнопку по-типу "Скопировать координаты в чат и лог" (не помню как точно это назыалось.
Координаты скопируются в окошко добавления сообщения в чат. Ну а дальше ctrl+c \ ctrl+v :smile:  

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Как перевести текст "You entered a Safe Zone!" и "'You can not fire in a SafeZone" на русский? Простым переводом не получается, в игре текст отсутствует.

[_infiSZ] spawn {
    _infiSZ = _this select 0;
    _startSafeZone = {
        if (isNil 'outNow') then {
            _msg = 'You entered a Safe Zone!';
            //hint _msg;
            taskHint [_msg, [0,1,0,1], 'taskDone'];
            inNow = nil;
            outNow = true;
            
            if (LOG_EnterLeave) then {
                PVDZ_send = [player,'SafeZoneState',[1]];
                publicVariableServer 'PVDZ_send';
            };
        };
        player_fired = {
            deleteVehicle (nearestObject [_this select 0,_this select 4]);
            cutText ['You can not fire in a SafeZone!','WHITE IN'];
        };

Сравниваю блок с таким же с рабочего сервера(с русским текстом) - одинаковый код. В чём проблема не понятно.

Изменено пользователем Димас (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Димас, вписываешь свой перевод. Проверяешь чтобы кодировка была utf-8. Сохраняешь, запускаешь, радуешься :smile:

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
18 часов назад, Димас сказал:

Как перевести текст "You entered a Safe Zone!" и "'You can not fire in a SafeZone"

Вы вошли в безопасную зону

Вы не можете вести огонь в безопасной зоне

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
2 часа назад, W0LF сказал:

Вы вошли в безопасную зону

Вы не можете вести огонь в безопасной зоне

Хах! Твоя помощь неоценима! ))))

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
2 часа назад, Димас сказал:

Хах! Твоя помощь неоценима! ))))

Я знал ! :joy:

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
2 минуты назад, W0LF сказал:

Я знал ! :joy:

За нибавание сообщений, а также за бессмысленные сообщения полагается кара небесная. Это на будущее.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Господа. За флуд/оффтоп и тд, вы будете наказаны молотом Тора. Пишите только по теме. 
Если вы уже написали не по теме, не спорьте потом почему вам запретили публиковать сообщения, либо тему на определенный срок

Изменено пользователем cjanton (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Включаю радиус отображения границ но не вижу результатов полное отсутствие) поделитесь решением!

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

вот такая ошибка вываливается в пользовательском rpt:

Error in expression <e =
{
if (isNil 'inNow') then
{
if (str fnc_usec_damageHandler == '{}') then
{
_>
  Error position: <fnc_usec_damageHandler == '{}') then
{
_>
  Error Undefined variable in expression: fnc_usec_damagehandler
File mpmissions\__CUR_MP.Chernarus\custom\safezone.sqf, line 140

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

подскажите пожалуйста, как убрать дефолтные сообщения при входе в трейды?

 

 

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Кто-нибудь знает как год мод на транспорт прикрутить к этим сейфзонам? 
Те которые выложены в ветке для 1051, не работают. Либо работают, но при выходе игрока в лобби год мод слетает. Либо на купленную или спавненую технику он не распространяется

Изменено пользователем Shelf74 (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах
В 26.03.2017 в 17:26, Димас сказал:

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


USE_CANBUILD = false;        // if you don't want to define your own positions
USE_TraderCity = false;    //    if you don't want to define your own positions (Epoch 1.0.5)
USE_POSITIONS = true;    // to use own positions and radius
USE_AI_REMOVER = false;    // use this to remove Missionbots (AI) within 100m of a player if the player is in a SafeZone
USE_AntiSteal = true;    // use this to block opening gear if another player is within 3m!
USE_SPEEDLIMIT = true;    // very secret function, nobody is supposed to find out what it does.
    SPEEDLIMIT = 40;        // Only used if USE_SPEEDLIMIT is true.
USE_SIGNS = false;        // use this to build signs around the SafeZone
LOG_EnterLeave = true;    // This will log to your .rpt when a player enters or leaves a SafeZone! (only works with infiSTAR.de Admintools / AntiHack)
/* You can use USE_CANBUILD or/and (works together) the custom positions below (USE_POSITIONS) [position or zone,radius] */
_infiSZ =
[
    [[6325.6772,7807.7412,0],150,true],//stary
    [[4063.4226,11664.19,0],150,true],//bash
    [[11447.472,11364.504,0],150,true],//klen
    [[1606.6443,7803.5156,0],150,true],//bandit
    [[12944.227,12766.889,0],150,true],//hero
    [[4361.4937,2259.9526,0],50,true],//wholesalerSouth
    [[12060,12640,0],200,true]//air dealear
];

{
	DZE_SafeZonePosArray set [(count DZE_SafeZonePosArray), [(_x select 0), (_x select 1)]];
} forEach _infiSZ;

if (isServer) exitWith


{
    if (USE_SIGNS) then
    {
        {
            _center = _x select 0;
            _radius = _x select 1;
            _lSign = _x select 2;
            if (_lSign) then
            {
                for '_i' from 0 to 360 step (270 / _radius)*2 do
                {
                    _location = [(_center select 0) + ((cos _i) * _radius), (_center select 1) + ((sin _i) * _radius),0];
                    _dir = ((_center select 0) - (_location select 0)) atan2 ((_center select 1) - (_location select 1));
                    _object = createVehicle ['Sign_sphere100cm_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    //    _object = createVehicle ['SignM_FARP_Winchester_EP1', _location, [], 0, 'CAN_COLLIDE'];
                    //    _object setVehicleInit 'this setObjectTexture [0,''Addons\SafeZones\sign.paa''];';
                    _object setDir _dir;
                };
            };
        } forEach _infiSZ;
    };
};
waitUntil {((!isNil 'dayz_animalCheck') || (!isNil 'dayz_medicalH') || (!isNil 'dayz_slowCheck') || (!isNil 'dayz_gui'))};
if (isNil 'inSafeZone') then { inSafeZone = false; } else { if (typename inSafeZone != 'BOOL') then { inSafeZone = false; }; };
[_infiSZ] spawn {
    _infiSZ = _this select 0;
    _startSafeZone =
    {
        if (isNil 'outNow') then
        {
            _msg = 'Вы вошли в безопасную зону!';
            hint _msg;
            taskHint [_msg, [0,1,0,1], 'taskDone'];
            inNow = nil;
            outNow = true;
            
            if (LOG_EnterLeave) then
            {
                PVDZ_send = [player,'SafeZoneState',[1]];
                publicVariableServer 'PVDZ_send';
            };
        };
        player_fired = {
            deleteVehicle (nearestObject [_this select 0,_this select 4]);
            cutText ['Вы не можете стрелять в безопасной зоне!','WHITE IN'];
        };
        //wild_spawnZombies = {};
        zombie_generate = {};
        
        fnc_usec_damageHandler = {};
        player removeAllEventHandlers 'handleDamage';
        player addEventHandler ['handleDamage', {false}];
        player allowDamage false;
        _veh = vehicle player;
        _szs = _veh getVariable ['inSafeZone',0];
        if (_szs == 0) then
        {
            _veh setVariable ['inSafeZone',1,true];
            if (player != _veh) then
            {
                _veh removeAllEventHandlers 'Fired';
                _veh addEventHandler ['Fired', {_this call player_fired;}];
                {
                    _x removeAllEventHandlers 'Fired';
                    _x addEventHandler ['Fired', {_this call player_fired;}];
                } forEach (crew _veh);
                fnc_veh_handleDam = {false};
                _veh removeAllEventHandlers 'HandleDamage';
                _veh addeventhandler ['HandleDamage',{ _this call fnc_veh_handleDam } ];
                _veh allowDamage false;
            };
        };
        _notInSafeZone =
        [
    
            'MAAWS','RPG7V','M136','RPG18','STINGER',
            'MeleeBaseball','MeleeHatchet','MeleeCrowbar','MeleeMachete','MeleeFishingPole','MeleeSledge',
            'MeleeBaseBallBatNails','MeleeBaseBallBatBarbed','MeleeBaseBallBat'
        ];
        _cwep = currentWeapon player;
        if (_cwep in _notInSafeZone) then
        {
            _swep = '';
            {
                if ((getNumber (configFile >> 'CfgWeapons' >> _x >> 'Type')) == 2) exitWith
                {
                    _swep = _x;
                };
            } forEach (weapons player);
            if (_swep == '') then
            {
                player playActionNow 'PutDown';
                _iPos = getPosATL player;
                _radius = 1;
                _removed = ([player,_cwep,1] call BIS_fnc_invRemove);
                if (_removed == 1) then
                {
                    _item = createVehicle ['WeaponHolder', _iPos, [], _radius, 'CAN_COLLIDE'];
                    _item addWeaponCargoGlobal [_cwep,1];
                };
            }
            else
            {
                player selectweapon _swep;
            };
        };
    };
    _endSafeZone =
    {
        if (isNil 'inNow') then
        {
            if (str fnc_usec_damageHandler == '{}') then
            {
                _msg = 'Вы покинули безопасную зону!';
                hint _msg;
                taskHint [_msg, [1,0,0.1,1], 'taskFailed'];
            };
            inNow = true;
            outNow = nil;
            
            if (LOG_EnterLeave) then
            {
                PVDZ_send = [player,'SafeZoneState',[0]];
                publicVariableServer 'PVDZ_send';
            };
        };
        //wild_spawnZombies = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\wild_spawnZombies.sqf';
        zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf";
        //
        
        player_fired = {
            _this call compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_fired.sqf';
            _unit = _this select 0;
            _weapon = _this select 1;
            _muzzle = _this select 2;
            _mode = _this select 3;
            _ammo = _this select 4;
            _magazine = _this select 5;
            _projectile = _this select 6;
            _screenToWorld = screenToWorld [0.5,0.5];
            _near = _screenToWorld nearEntities ['AllVehicles',100];
            {
                if (isPlayer _x) then
                {
                    _szs = _x getVariable ['inSafeZone',0];
                    if (_szs == 1) then
                    {
                        deleteVehicle (nearestObject [_unit,_ammo]);
                    };
                };
            } forEach _near;
        };
        
        fnc_usec_unconscious = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\fn_unconscious.sqf';
        object_monitorGear = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\object_monitorGear.sqf';
        fnc_veh_handleDam = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\veh_handleDam.sqf';
        
        _veh = vehicle player;
        _szs = _veh getVariable ['inSafeZone',0];
        if (_szs == 1) then
        {
            _veh setVariable ['inSafeZone',0,true];
            if (player != _veh) then
            {
                _veh removeAllEventHandlers 'HandleDamage';
                _veh addeventhandler ['HandleDamage',{ _this call fnc_veh_handleDam } ];
                _veh allowDamage true;
            };
        };
        
        _end = false;
        if (isNil 'gmadmin') then
        {
            _end = true;
        }
        else
        {
            if (gmadmin == 0) then
            {
                _end = true;
            };
        };
        if (_end) then
        {
            player allowDamage true;
            fnc_usec_damageHandler = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\fn_damageHandler.sqf';
            player removeAllEventHandlers 'HandleDamage';
            player addeventhandler ['HandleDamage',{_this call fnc_usec_damageHandler;} ];
        };
    };
    while {1 == 1} do
    {
        if (isNil 'inSafeZone') then { inSafeZone = false; } else { if (typename inSafeZone != 'BOOL') then { inSafeZone = false; }; };
        _state = false;
        if (isNil 'USE_POSITIONS') then { USE_POSITIONS = false; } else { if (typename USE_POSITIONS != 'BOOL') then { USE_POSITIONS = false; }; };
        if (USE_POSITIONS) then
        {
            {
                _z = _x select 0;
                _r = _x select 1;
                if ((vehicle player) distance _z < _r) then {_state = true;};
            } forEach _infiSZ;
        };
        if (isNil 'USE_CANBUILD') then { USE_CANBUILD = true; } else { if (typename USE_CANBUILD != 'BOOL') then { USE_CANBUILD = true; }; };
        if (USE_CANBUILD) then
        {
            if (isNil 'canbuild') then { canbuild = true; } else { if (typename canbuild != 'BOOL') then { canbuild = true; }; };
            if (!canbuild) then {_state = true;};
        };
        if (isNil 'USE_TraderCity') then { USE_TraderCity = true; } else { if (typename USE_TraderCity != 'BOOL') then { USE_TraderCity = true; }; };
        if (USE_TraderCity) then
        {
            if (isNil 'isInTraderCity') then { isInTraderCity = false; } else { if (typename isInTraderCity != 'BOOL') then { isInTraderCity = false; }; };
            if (isInTraderCity) then {_state = true;};
        };
        if (_state) then
        {
            inSafeZone = true;
            call _startSafeZone;
            {
                if (!isNull _x) then
                {
                    if !(isPlayer _x) then
                    {
                        deletevehicle _x;
                    };
                };
            } forEach ((vehicle player) nearEntities ['zZombie_Base',50]);
            
            if (isNil 'USE_AI_REMOVER') then { USE_AI_REMOVER = false; } else { if (typename USE_AI_REMOVER != 'BOOL') then { USE_AI_REMOVER = false; }; };
            if (USE_AI_REMOVER) then
            {
                {
                    if ((!isNull group _x) && (getPlayerUID _x == '')) then
                    {
                        deleteVehicle _x;
                    };
                } forEach (player nearEntities ['Man',100]);
            };
        }
        else
        {
            inSafeZone = false;
        };
        uiSleep 2;
        if (!inSafeZone) then
        {
            call _endSafeZone;
        };
    };
};
if ((USE_AntiSteal) || (USE_SPEEDLIMIT)) then
{
    [] spawn {
        _USE_AntiSteal = USE_AntiSteal;
        _USE_SPEEDLIMIT = USE_SPEEDLIMIT;
        _speedlimit = SPEEDLIMIT;
        while {1 == 1} do
        {
            if (inSafezone) then
            {
                if (_USE_AntiSteal) then
                {
                    _cnt = {isPlayer _x && _x != player} count (player nearEntities [['CAManBase'],4]);
                    if ((_cnt > 0) && (!isNull (findDisplay 106))) then
                    {
                        (findDisplay 106) closedisplay 0;
                        closeDialog 0;closeDialog 0;closeDialog 0;
                        _log = format['%1 Вы не можете открывать рюкзак рядом с другим игроком!',name player];
                        cutText [_log,'PLAIN'];
                        hint _log;
                    };
                };
                if (_USE_SPEEDLIMIT) then
                {
                    _obj = vehicle player;
                    if !(_obj isKindOf 'Plane') then
                    {
                        _speed = abs speed _obj;
                        if ((_obj != player) && (_speed > _speedlimit)) then
                        {
                            _vel = velocity _obj;
                            _x = 0.8;
                            if (_speed > 50) then {_x = 0.1;};
                            _velNew = [(_vel select 0) * _x, (_vel select 1) * _x,(_vel select 2) * _x];
                            _obj SetVelocity _velNew;
                        };
                    };
                };
            }
            else
            {
                uiSleep 2;
            };
            uiSleep .01;
        };
    };
};

 

 

Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

Изменено пользователем Dima1257
изменения текста (история изменений)

Поделиться сообщением


Ссылка на сообщение
Поделиться на других сайтах

Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы оставить комментарий

Создать аккаунт

Зарегистрируйтесь для получения аккаунта. Это просто!

Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите здесь.

Войти сейчас

  • Похожие публикации

    • Автор: fedotovyasha
      Где можно достать карту в очень высоком разрешении, все в интернете такого себе качества. Хочу сделать свою карту
    • Автор: fedotovyasha
      Есть ли возможность сгенерировать и отобразить в ui qr код? Если да, то как?
    • Автор: fedotovyasha
      Хочу сделать возможность передачи данных об каждом игроке в программу на c#. Есть ли возможность как-то завязаться на rcon или с помощью кастомного сокета?
       
      Пока сделал часть с помощью текстового документа: сервер сохраняет данные в файл, а программа читает этот файл и получает необходимые данные, но это костыль, хотелось бы сделать нормально.
    • Автор: paranoyk
      Нужно чисто серверное решение, привыходе игроков в определенной зоне следующий респавн  их был по прописанным точкам
    • Автор: BR0wi
      Подскажите где найти людей, которые делаю моды на заказ. К кому вообще обращаться? Или что бы реализовать свои идеи нужно самому "год" сидеть и изучать все механики модинга?
  • Наш выбор

×
×
  • Создать...

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

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