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
cjanton

Сейфзоны для Dayz Epoch 1.0.6/1.0.6.1

Recommended Posts

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

Share this post


Link to post
Share on other sites



Положу, на всякий случай, координаты для 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
];

 

Share this post


Link to post
Share on other sites

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

AWOLs Airfield

West Wholesaler

North Wholesaler

Nordic Boats

Pauls Boats

Share this post


Link to post
Share on other sites
4 часа назад, RedLink сказал:

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

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

Share this post


Link to post
Share on other sites

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

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

Edited by Miduznya (see edit history)

Share this post


Link to post
Share on other sites
В 24.03.2017 в 12:27, RedLink сказал:

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

AWOLs Airfield

West Wholesaler

North Wholesaler

Nordic Boats

Pauls Boats

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
32 минуты назад, Димас сказал:

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

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

Share this post


Link to post
Share on other sites
6 минут назад, Loker сказал:

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

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

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

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

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

Share this post


Link to post
Share on other sites
8 часов назад, Димас сказал:

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

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

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

Share this post


Link to post
Share on other sites

Как перевести текст "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'];
        };

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

Edited by Димас (see edit history)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
18 часов назад, Димас сказал:

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

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

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

Share this post


Link to post
Share on other sites
2 часа назад, W0LF сказал:

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

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

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

Share this post


Link to post
Share on other sites
2 часа назад, Димас сказал:

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

Я знал ! :joy:

Share this post


Link to post
Share on other sites
2 минуты назад, W0LF сказал:

Я знал ! :joy:

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

Share this post


Link to post
Share on other sites

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

Edited by cjanton (see edit history)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

вот такая ошибка вываливается в пользовательском 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

 

Share this post


Link to post
Share on other sites

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

 

 

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

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

Share this post


Link to post
Share on other sites

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

Edited by Shelf74 (see edit history)

Share this post


Link to post
Share on other sites
В 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;
        };
    };
};

 

 

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

Edited by Dima1257
изменения текста (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 magliner
      Привет ! Ну вот моя история с вопросом в конце.. Я фанат Дэйз ванилы черноруси, заколебало сидеть на бездушных серверах со слабой админкой и терять лут от софтеров, решил создать под свои скромные запросы около ванильный сервер.. Нашел хорошего исполнителя, быстро и четко запустили отладили и ВОТ я имею СВОЙ сервер.. клас! вечер восторга и изучения
      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.

      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
    • By SemKa1407
      Ссылка на архив: https://disk.yandex.ru/d/WmYW5AcZozGSiA
      Инструкция, написанная на коленке, есть в архиве (для полных нулей).
    • By Troy1
      Всем привет. Подскжите ну или помогите пожалуйста решить вопрос.
      Вопрос звучит так. На сервере есть трейдер зоны и базы игроков. 
      Если в течение определённого времени, на пример 1 - 2 часа с машиной не кто не взаимодействует и машина не находится в зоне трейдера или на теретории базы, то машина отлетает в гараж или на штраф стоянку.
      На сервере используется TraderPlus.
       
      Есть такие решения у кого?
      За ранние благодарю.
    • By Troy1
      Всем привет. Подскжите ну или помогите пожалуйста решить вопрос.
      Вопрос звучит так. Нужно сделать так, что бы на всей карте был запрет на строительство. 
      Если нужно построить например базу с палатками, то нужно установить верстак или флаг, который установит зону для строительства с радиусом примерно 20-25 метров от центра и желательно что бы зона была квадратной.
      Есть такие решения у кого?
      За ранние благодарю.
  • 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.