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
Wald

Настройка сейф зоны infistar

/*
   by: http://infiSTAR.de || http://DayzAntiHack.com
   *updated on 13.12.2016 by juandayz for epoch 1.6 community
*/
_infiSZ = 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 setVehicleInit 'this setObjectTexture [0,''#(argb,16,16,1)color(0,0,1,0.4)''];';
                    //    _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
        {
			playSound "beep";
            ["<t size='1.2' color='#F0AE20'>Добро пожаловать на рынок!<br/><t size='0.6' color='#FFFFFF'>Вы в безопасной зоне!</t>",0,0,2,2] spawn bis_fnc_dynamicText;
            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]);
            ["<t size='1.2' color='#F0AE20'>Оружие убрал!<br/><t size='0.6' color='#F02020'>Стрельба запрещена!</t>",0,0,2,2] spawn bis_fnc_dynamicText;
        };
        //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
            {
				playSound "beep";
                ["<t size='1.1' color='#FF0000'>Вы  покинули безопасную зону!</t>",0,0,2,2] spawn bis_fnc_dynamicText;
                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 "scripts\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 'custom\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 = true; } else { if (typename USE_AI_REMOVER != 'BOOL') then { USE_AI_REMOVER = true; }; };
            if (USE_AI_REMOVER) then
            {
                {
                    if ((!isNull group _x) && (getPlayerUID _x == '')) then
                    {
                        deleteVehicle _x;
                    };
                } forEach (player nearEntities ['Man',200]);
            };
        }
        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;
                        cutText [localize 'STR_GTS_ANTISTEAL_SZ','PLAIN'];
                    };
                };
                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;
        };
    };
}; 

Проблема в том что боты DZAI на технике тупо стоят в сейф зоне, но само место респавна убрал в файле world_chernarus.sqf. Пеших ботов благополучно удаляет а вот  саму технику нет. Возможно ли как-то исправить? Заранее благодарю за вашу помощь.

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

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts




  • 0

Вот тебе код на удаление АИ в радиусе 200 метров.

Можешь его прикрутить к любым координатам.

		_nearBy = ((position (_array select 1)) nearEntities ["LandVehicle",200]);
		{
			_crew = crew _x;
			if (count _crew > 0 && {!((_array select 1) in _crew)}) then 
			{
				{if (!isPlayer _x) then {_x setDamage 1;};} forEach _crew;
				_x setDamage 1;
			};
		} forEach _nearBy;
		_nearBy = (position (_array select 1)) nearEntities ['CAManBase',200];
		{
			if (!isPlayer _x && {!(typeOf (_x) in serverTraders)} && {_x != (_array select 1)}) then {_x setDamage 1;};
		} forEach _nearBy;

 

Share this post


Link to post
Share on other sites
  • 0
8 часов назад, RedLink сказал:

Вот тебе код на удаление АИ в радиусе 200 метров.

Можешь его прикрутить к любым координатам.


		_nearBy = ((position (_array select 1)) nearEntities ["LandVehicle",200]);
		{
			_crew = crew _x;
			if (count _crew > 0 && {!((_array select 1) in _crew)}) then 
			{
				{if (!isPlayer _x) then {_x setDamage 1;};} forEach _crew;
				_x setDamage 1;
			};
		} forEach _nearBy;
		_nearBy = (position (_array select 1)) nearEntities ['CAManBase',200];
		{
			if (!isPlayer _x && {!(typeOf (_x) in serverTraders)} && {_x != (_array select 1)}) then {_x setDamage 1;};
		} forEach _nearBy;

 

В конфиг инфистара или там где корды сейф зон?

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

×
×
  • 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.