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
GhostDZ

SafeZone без стрельбы и дамага - только для пользователей Infistar

Recommended Posts

Всем привет. Простой скрипт СЗ для карты Алтис

Обратите внимание, работает он только с Infistar'ом.

1. Маркеры трэйдов на карте

2. Предупреждение о входе/выходе из зоны

3. Защита и запрет на стрельбу в СЗ

 

Ну и теперь поэтапно разберем как это сделать:

 

1. В корне игры ищем run.sqf (это наш AH), и исправляем переменные согласно тем что ниже:

/*  revert allowDamage   */ _RAD = false;	/* true or false */	/* if you have safezones using "player allowDamage false;" or similar.. set _RAD = false; */
/*  Use EH_Fired check   */ _EHF = false;       /* true or false */ /* Epoch only (doesn't load with other mods) */

2. В миссии создаем или открываем свой файл init.sqf и добавляем в него строку:

[] execVM "scripts\safezone.sqf";

3. В корне миссии создаем папку scripts а в ней файл safezone.sqf и в него вписываем:

if (isNil "inSafezone") then {
    inSafezone = false;
};
while {
    true
}
do {
    private["_safeZoneDamageEH", "_safeZoneFiredEH"];
    waitUntil {
        inSafeZone
    };
    player allowDamage false;
    _safeZoneDamageEH = player addEventhandler["HandleDamage",{false}];
    _safeZoneFiredEH = player addEventHandler ["Fired", {
	    deleteVehicle (_this select 6);
		titleText["You can not fire your weapon in a safe zone.", "PLAIN DOWN"];
        titleFadeOut 4;
    }];
    waitUntil {
        !inSafeZone
    };
    player allowDamage true;
    player removeEventhandler["HandleDamage", _safeZoneDamageEH];
    player removeEventHandler["Fired", _safeZoneFiredEH];
};

4. Далее открываем наш Mission.cpp (предварительно вам нужно разбинарить mission.sqm), листаем в самый низ и вставляем (если у вас нет класса Sensors):

class Sensors
	{
		items=3;
		class Item0
		{
			position[]={18459.535,23.616171,14277.782};
			a=250;
			b=250;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="eastsafezone";
			expCond = "(player distance eastsafezone) < 250;";
			expActiv="hint ""You have entered A Safe Zone! Do not fire in the Safe Zones."";  inSafeZone = true;";
			expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
			class Effects
			{
			};
		};
		class Item1
		{
			position[]={6195.4927,89.220779,16839.254};
			a=250;
			b=250;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="westsafezone";
			expCond = "(player distance westsafezone) < 250;";
			expActiv="hint ""You have entered A Safe Zone! Do not fire in the Safe Zones.""; inSafeZone = true;";
			expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
			class Effects
			{
			};
		};
		class Item2
		{
			position[]={13334.093,2.2350941,14517.924};
			a=250;
			b=250;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="centralsafezone";
			expCond = "(player distance centralsafezone) < 250;";
			expActiv="hint ""You have entered A Safe Zone! Do not fire in the Safe Zones.""; inSafeZone = true;";
			expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
			class Effects
			{
			};
		};
	};
};	 

4.1 Если class Sensors задан то

class Sensors
	{
		items=3; //(меняем значение на общее количество итемов(блоков) в данном классе, тоесть если у вас там стоит 3 то его нужно заменить на 6)

и добавляем в самом конце класса, перед последней скобкой:

class Item0 //(внимательно смотрите эти цифры, если у вас есть данный класс их нужно заменить на цифры по прядке следования, если у вас было 3 итема в классе то цифры будут 3-4-5)
		{
			position[]={18459.535,23.616171,14277.782};
			a=250;
			b=250;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="eastsafezone";
			expCond = "(player distance eastsafezone) < 250;";
			expActiv="hint ""You have entered A Safe Zone! Do not fire in the Safe Zones."";  inSafeZone = true;";
			expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
			class Effects
			{
			};
		};
		class Item1
		{
			position[]={6195.4927,89.220779,16839.254};
			a=250;
			b=250;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="westsafezone";
			expCond = "(player distance westsafezone) < 250;";
			expActiv="hint ""You have entered A Safe Zone! Do not fire in the Safe Zones.""; inSafeZone = true;";
			expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
			class Effects
			{
			};
		};
		class Item2
		{
			position[]={13334.093,2.2350941,14517.924};
			a=250;
			b=250;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="centralsafezone";
			expCond = "(player distance centralsafezone) < 250;";
			expActiv="hint ""You have entered A Safe Zone! Do not fire in the Safe Zones.""; inSafeZone = true;";
			expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
			class Effects
			{
			};
		};
	};

Фильтры BE:

 

Scripts.txt

на 20 линии либо сразу под allowDamage добавить:

!"player allowDamage false;" !"player allowDamage true;"

на 58 линии либо под 7 removeEventHandler

!"player removeEventhandler["HandleDamage", _safeZoneDamageEH];"

Все, теперь у нас есть СЗ которые не дают дамага по игроку и в которых нельзя стрелять.

Share this post


Link to post
Share on other sites



Есть еще один гарантированный вариант для всех :) В файле epoch_server_settings есть некий объект называемый 

 

ProtectionZone_Invisible_F
 

 

 - на самом деле это safe зона по умолчанию = 25 метров гарантирующая абсолютную защиту....  Таким образом.... 

 

				{ "ProtectionZone_Invisible_F", { 13351.1, 14540.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13351.1, 14515.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13351.1, 14490.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13326.1, 14540.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13326.1, 14515.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13326.1, 14490.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13301.1, 14540.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13301.1, 14515.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13301.1, 14490.1, 0.0110912 }, 359.768 },

.... Создает защитную зону диаметром 75 метров в центральном респе на Алтисе. Я думаю, дальше вы догадаетесь сами .....

Share this post


Link to post
Share on other sites

Есть еще один гарантированный вариант для всех :) В файле epoch_server_settings есть некий объект называемый 

 

ProtectionZone_Invisible_F
 

 

 - на самом деле это safe зона по умолчанию = 25 метров гарантирующая абсолютную защиту....  Таким образом.... 

 

				{ "ProtectionZone_Invisible_F", { 13351.1, 14540.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13351.1, 14515.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13351.1, 14490.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13326.1, 14540.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13326.1, 14515.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13326.1, 14490.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13301.1, 14540.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13301.1, 14515.1, 0.0110912 }, 359.768 },
				{ "ProtectionZone_Invisible_F", { 13301.1, 14490.1, 0.0110912 }, 359.768 },

.... Создает защитную зону диаметром 75 метров в центральном респе на Алтисе. Я думаю, дальше вы догадаетесь сами .....

Нашел. "ProtectionZone_Invisible_F", { 13344.1, 14483.7, 0.00191855 }, 359.768 }, Подскажите как увеличить радиус этой сейвзоны ?

Edited by Alex3 (see edit history)

Share this post


Link to post
Share on other sites

Нашел. "ProtectionZone_Invisible_F", { 13344.1, 14483.7, 0.00191855 }, 359.768 }, Подскажите как увеличить радиус этой сейвзоны ?

Увеличить не смог, но можно размножить их, накладывать друг с другом)))  Много правки но есть результат все таки  )))) 

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 Makliion
      Всем добрый вечер..
      У меня такой вопрос где найти или заказать скрипт для обыска зомбей & игроков 
      что-бы каждую вещь снимать через действие а не тупо через таб
      Шлем отдельно
      Рюкзак отдельно
      ну и на все остальные слоты
      искал долго не нашёл ничего
      есть мод на обыск но он просто открывает  инвентарь и все 
       
    • By Troy1
      Всем привет. Подскжите ну или помогите пожалуйста решить вопрос.
      Вопрос звучит так. На сервере есть трейдер зоны и базы игроков. 
      Если в течение определённого времени, на пример 1 - 2 часа с машиной не кто не взаимодействует и машина не находится в зоне трейдера или на теретории базы, то машина отлетает в гараж или на штраф стоянку.
      На сервере используется TraderPlus.
       
      Есть такие решения у кого?
      За ранние благодарю.
    • By Troy1
      Всем привет. Подскжите ну или помогите пожалуйста решить вопрос.
      Вопрос звучит так. Нужно сделать так, что бы на всей карте был запрет на строительство. 
      Если нужно построить например базу с палатками, то нужно установить верстак или флаг, который установит зону для строительства с радиусом примерно 20-25 метров от центра и желательно что бы зона была квадратной.
      Есть такие решения у кого?
      За ранние благодарю.
    • By BR0wi
      Подскажите где найти людей, которые делаю моды на заказ. К кому вообще обращаться? Или что бы реализовать свои идеи нужно самому "год" сидеть и изучать все механики модинга?
    • By CubeIn
      Приветствую господа, хочу создать новый проект, уникальный, но для этого нужен маппер.
      Я оставлю здесь свой дискрод, напишите в лс, кто готов взяться за крупный проект.
      4me#4542
  • 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.