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

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

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

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

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

Проблема с сейф-зоной.

Трабл заключается в следующем:

 

 

/*
   by: http://infiSTAR.de || http://DayzAntiHack.com
   *updated on 24.12.2014
	
	Instructions:
	1. Copy paste this pastebin code into a file called SafeZone.sqf - save the file.
	2. Now extract your mpmission pbo and put the SafeZone.sqf into the extracted folder.
	3. Open the init.sqf of the mpmission.
	4. At the bottom of the file add
	[] execVM 'SafeZone.sqf';
	5. Save the init.sqf, repack your mpmission, upload it to your gameserver and restart your server
*/
USE_CANBUILD = false;		// if you don't want to define your own positions
USE_TraderCity = true;	//	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 = 20;		// Only used if USE_SPEEDLIMIT is true.
USE_SIGNS = true;		// 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 =
[
	[[8246.3184,15485.867],50, "Lenz"], // Lenzburg
	[[15506.952,13229.368],100, "Emmen"], // Emmen
	[[12399.751,5074.5273],75, "Schratten"], // Schratten
	[[10398.626,8279.4619],50, "Bandit"], // Bandit camp
	[[5149.9814,4864.1191],50, "Hero"], // Hero vendor
	[[2122.7954,7807.9878],50, "Wholesaler1"], // Wholesaler 1
	[[5379.0342,16103.187],50, "Wholesaler2"], // Wholesaler 2
	[[6772.8877,16983.27],50, "Boatdealer1"], // Boat dealer 1
	[[16839.973,5264.0566],50, "Boatdealer2"] // Boat dealer 2
	[[15128.379,16421.879],75, "AWOL"],// Aircraft Vendor
];
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
			{
				PVDZE_send = [player,'SafeZoneState',[1]];
				publicVariableServer 'PVDZE_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);
				vehicle_handleDamage = {false};
				_veh removeAllEventHandlers 'HandleDamage';
				_veh addeventhandler ['HandleDamage',{ _this call vehicle_handleDamage } ];
				_veh allowDamage false;
			};
		};
		_notInSafeZone =
		[
			'MAAWS','RPG7V','M136','RPG18','STINGER',
			'MeleeHatchet_DZE','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
			{
				PVDZE_send = [player,'SafeZoneState',[0]];
				publicVariableServer 'PVDZE_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';
		vehicle_handleDamage = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\vehicle_handleDamage.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 vehicle_handleDamage } ];
				_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;
		};
	};
};
[/spoiler]

Юзаю на сервере сейф-зоны от инфистара, но никак не могу понять, почему при добавлении координат Аэрофилда (напф), сервер отказывается вообще добавлять сейф зоны, пишет ошибку именно позиции, которую я задал для сейф зоны на аэро. В mission.sqf отлючил сейф-зоны вовсе:

 

 

		};
		class Item13
		{
			position[]={8246.7275,15.544708,15490.344};
			name="NeutralTraderCity";
			text="Торговый город Lenzburg";
			type="mil_circle";
		};
		class Item14
		{
			position[]={12397.357,216.53304,5068.0298};
			name="FriendlyTraderCity";
			text="Торговый город Schratten";
			type="mil_circle";
			colorName="ColorGreen";
		};
		class Item15
		{
			position[]={5150.6099,71.601753,4862.3594};
			name="HeroVendor";
			text="Геройский пост";
			type="mil_dot";
			colorName="ColorBlue";
		};
		class Item16
		{
			position[]={15128.379,19.974716,16421.879};
			name="UnarmedAirVehicles";
			text="Продовец аэротехники";
			type="mil_dot";
			colorName="ColorBlack";
		};
		class Item17
		{
			position[]={2125.5425,13.000834,7807.833};
			name="West Wholesaler";
			text="Оптовик";
			type="mil_dot";
			colorName="ColorBlack";
		};
		class Item18
		{
			position[]={5372.1465,5.0164638,16091.704};
			name="NorthWholesaler";
			text="Оптовик";
			type="mil_dot";
			colorName="ColorBlack";
		};
		class Item19
		{
			position[]={6776.3237,-0.25546163,16955.648};
			name="NorthBoatVendor";
			text="Продавец лодок";
			type="mil_dot";
			colorName="ColorBlack";
		};
		class Item20
		{
			position[]={10404.296,106.05455,8282.8232};
			name="BanditVendor";
			text="Бандитский пост";
			type="mil_dot";
			colorName="ColorRed";
		};
		class Item21
		{
			position[]={16835.688,-2.917357,5268.064};
			name="SouthBoatVendor";
			text="Продавец лодок";
			type="mil_dot";
			colorName="ColorBlack";
		};
		class Item22
		{
			position[]={15520.298,5.3862243,13225.447};
			name="NeutralTraderCIty2";
			text="Торговый город Emmen";
			type="mil_circle";
			colorName="ColorBlack";
		};
	};
	class Sensors
	{
		items=10;
		class Item0
		{
			position[]={8246.3184,15.544708,15485.867};
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Lenz";
			expCond="(player distance Lenz) < 0;";
			expActiv="[""trader city Lenzburg"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""trader city Lenzburg"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item1
		{
			position[]={15506.952,6.2226005,13229.368};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Emmen";
			expCond="(player distance Emmen) < 0;";
			expActiv="[""trader city Emmen"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""trader city Emmen"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item2
		{
			position[]={12399.751,216.42809,5074.5273};
			a=75;
			b=75;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Schratten";
			expCond="(player distance Schratten) < 0;";
			expActiv="[""trader city Schratten"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""trader city Schratten"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item3
		{
			position[]={10398.626,105.61282,8279.4619};
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Bandit";
			expCond="(player distance Bandit) < 0;";
			expActiv="[""Bandit Camp"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""Bandit Camp"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item4
		{
			position[]={5149.9814,71.601753,4864.1191};
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Hero";
			expCond="(player distance Hero) < 0;";
			expActiv="[""Hero Vendor"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""Hero Vendor"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item5
		{
			position[]={2122.7954,13.000834,7807.9878};
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Wholesale1";
			expCond="(player distance Wholesale1) < 0;";
			expActiv="[""West Wholesaler"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""West Wholesaler"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item6
		{
			position[]={5379.0342,4.9903588,16103.187};
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Wholesaler";
			expCond="(player distance Wholesaler2) < 0;";
			expActiv="[""Wholesaler"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""Wholesaler"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item7
		{
			position[]={6772.8877,0.45900518,16983.27};
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Boat1";
			expCond="(player distance boat1) < 0;";
			expActiv="[""Boat Vendor"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""Boat Vendor"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item8
		{
			position[]={16839.973,0.43266046,5264.0566};
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="Boat2";
			expCond="(player distance boat2) < 0;";
			expActiv="[""Boat Vendor"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""Boat Vendor"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item9
		{
			position[]={15128.379,19.974716,16421.879};
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="AWOL";
			expCond="(player distance awol) < 0;";
			expActiv="[""Aircraft Vendor"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""Aircraft Vendor"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
	};
};

 

 

 

Уже и не знаю что делать с этим.. Ошибка в консоли именно не в нахождении скрипта а какой-то позиции...

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

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


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

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

  • 0

Вы вообще запятые где ставите?

Порядок
1,
2,
3,
4,

5   <---- в конце запятая не нужна.

 

[
	[[8246.3184,15485.867],50, "Lenz"],
	[[15506.952,13229.368],100, "Emmen"],
	[[12399.751,5074.5273],75, "Schratten"],
	[[10398.626,8279.4619],50, "Bandit"],
	[[5149.9814,4864.1191],50, "Hero"],
	[[2122.7954,7807.9878],50, "Wholesaler1"],
	[[5379.0342,16103.187],50, "Wholesaler2"],
	[[6772.8877,16983.27],50, "Boatdealer1"],
	[[16839.973,5264.0566],50, "Boatdealer2"]
	[[15128.379,16421.879],75, "AWOL"],

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


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

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

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

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

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

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

Войти

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

Войти сейчас

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

    • Автор: Farzjke
      Доброго времени суток всем. Объясните пожалуйста нубу, как убрать назойливое стандартное сообщение о входе в трейд зону, ибо установил по вашим гайдам сейф зону от инфистара, но к примеру в ленцбурге при подходе к этой коробке, где стоят все трейдеры, снова пишет, что я зашел на трейд зону, вроде как и мелочь, но очень неприятная.
       
      Так же, если вы дочитали до этого момента, помогите с правильной прописью пути для файла, ибо 
       
          [] ExecVM "\vilayercodecustom\dayz_epoch\WAI\init.sqf";     [] ExecVM "\vilayercodecustom\dayz_epoch\DZMS\DZMSInit.sqf";   Не работает совсем...
  • Наш выбор

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

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

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

Поддержка