2) Если вы покинете сейф-зону, а машина останется там, то годмод на неё отключается
Установка:
1) Создаём в вашей папке с миссией папку "scripts"
2) В текстовом редакторе создаём новый документ и вставляем в него этот код:
// Godmode vehicle in safe zones.
// How it works: When in safezone, vehicle takes no damage. However, When the player
// leaves the safezone with the car in the safezone, the car will take damage.
// This is to prevent abuses with the safezone system.
// Written for Doubletapdayz
if (isNil "canbuild") then {
canbuild = true;
};
while {true} do {
// Vehicle Godmode on.
waitUntil { !canbuild };
waitUntil { player != vehicle player };
private ["theVehicle"];
theVehicle = vehicle player;
theVehicle removeAllEventHandlers "handleDamage";
theVehicle addEventHandler ["handleDamage", {false}];
theVehicle allowDamage false;
fnc_usec_damageVehicle ={};
vehicle_handleDamage ={};
vehicle_handleKilled ={};
// hintSilent "Vehicle godmode ON"; // Uncomment this to help see when it turns on
waitUntil { canbuild };
// Vehicle Godmode off.
theVehicle removeAllEventHandlers "handleDamage";
theVehicle addEventHandler ["handleDamage", {_this select 2}];
theVehicle allowDamage true;
// Call global scripts.
fnc_usec_damageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf";
vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
vehicle_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
// hintSilent "Vehicle godmode OFF"; // Uncomment this to help see when it turns off
};
3) Сохраняем в папку scripts под названием safezonevehicle.sqf4) В конец init.sqf прописываем это:
[] execVM "scripts\safezonevehicle.sqf";











