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

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

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

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

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

 

PavelT8 сказал(а) 03 Окт 2015 - 22:07: я так понял, в этих сейфзонах просто не летают пули, а урон от ударов все же есть! у меня установлен скрипт зомби и они мочат игроков, включая админов с год-модом в этих зонах, не подскажете, как убрать этот урон? а почему бы не поставить сейф зоны от инфистара там зомби удаляются и стрелять в ней нельзя 

 

Сообственно где подключить сейфзону от infistar ? инфи последней версии имееться.

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


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

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

  • 0

Сообственно где подключить сейфзону от infistar ? инфи последней версии имееться.

В init.sqf находишь if (!isDedicated) then { и выше нее вставляешь execVM "custom\safezone.sqf";

Создаешь файл safezone.sqf и туда копируешь код который я приложу ниже.Если пути будишь менять не забудь поменять пути с скриптах я их выделю зеленым и в compiles тоже!

А вот и сам скрипт,рабочий,стоит у меня:

 

SE_CANBUILD = true; // 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 = 30; // Only used if USE_SPEEDLIMIT is true.

USE_SIGNS = true; // use this to build signs around the SafeZone

LOG_EnterLeave = false; // 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,365.00577],150,true], //bash

[[11447.472,11364.504,0],250,true], //klen

[[1606.6443,7803.5156,0],50,true], //bandit

[[12944.227,12766.889,0],70,true], //hero

[[12060,12640,0],100,true], //aero

[[13243.7,6069.79],50,true], //solnichny

[[3330.22,3902.09],50,true] //bor

];

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 setDir _dir;

};

};

} forEach _infiSZ;

};

};

waitUntil { !isNil 'dayz_animalCheck' };

if (isNil 'inSafezone') 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

{

_obj = vehicle player;

_pos = getPosATL _obj;

PVDZE_send = [player,'SafeZoneState',[1]];

publicVariableServer 'PVDZE_send';

};

};

player_fired2 = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_fired.sqf';

player_fired = {_this call player_fired2;deleteVehicle (nearestObject [_this select 0,_this select 4]);};

fnc_usec_damageHandler = {};

player removeAllEventHandlers 'handleDamage';

player addEventHandler ['handleDamage', {false}];

player allowDamage false;

_veh = vehicle player;

if (player != _veh) then

{

_szs = _veh getVariable ['inSafeZone',0];

if (_szs == 0) then

{

_veh removeAllEventHandlers 'Fired';

_veh addEventHandler ['Fired', {_this call player_fired;}];

{

_x removeAllEventHandlers 'Fired';

_x addEventHandler ['Fired', {_this call player_fired;}];

} forEach (crew _veh);

_veh setVariable ['inSafeZone', 1, true];

_veh removeAllEventHandlers 'HandleDamage';

_veh addEventHandler ['HandleDamage', {false}];

_veh allowDamage false;

};

};

 

_cwep = currentWeapon player;

if (_cwep in ['MAAWS']) 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

{

_obj = vehicle player;

_pos = getPosATL _obj;

PVDZE_send = [player,'SafeZoneState',[0]];

publicVariableServer 'PVDZE_send';

};

};

player_fired = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_fired.sqf';

player_zombieCheck = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_zombieCheck.sqf';

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 'custom\fn_vehhandledmage.sqf';

 

_veh = vehicle player;

if (player != _veh) then

{

_szs = _veh getVariable ['inSafeZone',0];

if (_szs == 1) then

{

_veh setVariable ['inSafeZone', 0, true];

_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 "custom\fn_damagehandler.sqf";

player removeAllEventHandlers 'HandleDamage';

player addeventhandler ['HandleDamage',{_this call fnc_usec_damageHandler;} ];

};

};

 

while {1 == 1} do

{

_state = false;

_obj = vehicle player;

 

if (isNil 'inSafeZone') then { inSafeZone = false; } else { if (typename inSafeZone != 'BOOL') then { inSafeZone = false; }; };

if (isNil 'canbuild') then { canbuild = true; } else { if (typename canbuild != 'BOOL') then { canbuild = true; }; };

if (isNil 'USE_POSITIONS') then { USE_POSITIONS = false; } else { if (typename USE_POSITIONS != 'BOOL') then { USE_POSITIONS = false; }; };

if (isNil 'USE_CANBUILD') then { USE_CANBUILD = true; } else { if (typename USE_CANBUILD != 'BOOL') then { USE_CANBUILD = true; }; };

if (isNil 'USE_TraderCity') then { USE_TraderCity = true; } else { if (typename USE_TraderCity != 'BOOL') then { USE_TraderCity = true; }; };

if (USE_POSITIONS) then

{

{

_z = _x select 0;

_r = _x select 1;

if (_obj distance _z < _r) exitWith {_state = true;};

} forEach _infiSZ;

};

if (USE_CANBUILD) then

{

if (!canbuild) then {_state = true;};

};

if (USE_TraderCity) then

{

if (isInTraderCity) then {_state = true;};

};

if (_state) then

{

inSafeZone = true;

call _startSafeZone;

{

if (!isNull _x) then

{

if !(isPlayer _x) then

{

deletevehicle _x;

};

};

} forEach (_obj nearEntities ['zZombie_Base',20]);

 

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'], 3]);

if ((_cnt > 0) && (!isNull (findDisplay 106))) then

{

(findDisplay 106) closedisplay 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 0.1;

};

};

};

 

 

Ах да чуть забыл не забудь создать 2 файла  fn_vehhandledmage.sqf'; и fn_damagehandler.sqf и кинуть их туда же где будет лежать скрипт! они не дадут уничтожать технику как в сейфзоне так и вне её,вот скрипт fn_vehhandledmage.sqf:

 

private["_unit","_selection","_strH","_total","_damage","_needUpdate"];

_unit = _this select 0;

_selection = _this select 1;

_total = _this select 2;

_state = false;

{

if (_unit distance _x < 120) exitWith {_state = true;};

} forEach [[4063.4226,11664.19],

[11447.472,11364.504],

[4144.6865,10933.705],

[12943.984,12764.368],

[7211.3872,7651.272],

[1619.9688,7791.291]];

//if ((locked _unit && (count (crew _unit)) == 0) && ((count(nearestObjects [_unit, ["Plastic_Pole_EP1_DZ"],60]) > 0) || (_state))) exitWith {};

if (_selection != "") then {

_strH = "hit_" + _selection;

}else{

_strH = "totalDmg";

};

if (_total >= 0.98) then {

_total = 1.0;

};

if (local _unit) then {

if (_total > 0) then {

_unit setVariable [_strH, _total, true];

_unit setHit [_selection, _total];

if (isServer) then {

[_unit, "damage"] call server_updateObject;

} else {

PVDZE_veh_Update = [_unit,"damage"];

publicVariableServer "PVDZE_veh_Update";

};

};

}else{

PVDZE_send = [_unit,"VehHandleDam",_this];

publicVariableServer "PVDZE_send";

};

_total

 

А вот скрипт  fnc_damagehandler.sqf:

 

scriptName "Functions\misc\fn_damageHandler.sqf";

private ["_unit","_humanityHit","_myKills","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_isCardiac","_isHeadHit","_isMinor","_scale","_canHitFree","_rndPain","_rndInfection","_hitInfection","_lowBlood","_isPZombie","_source","_ammo","_unitIsPlayer","_isBandit"];

_unit = _this select 0;

_hit = _this select 1;

_damage = _this select 2;

_unconscious = _unit getVariable ["NORRN_unconscious", false];

_isPZombie = player isKindOf "PZombie_VB";

_source = _this select 3;

_ammo = _this select 4;

_type = [_damage,_ammo] call fnc_usec_damageType;

_isMinor = (_hit in USEC_MinorWounds);

_isHeadHit = (_hit == "head_hit");

_isPlayer = (isPlayer _source);

_humanityHit = 0;

_myKills = 0;

_unitIsPlayer = _unit == player;

if (_unitIsPlayer) then {

if (_hit == "") then {

if ((_source != player) && _isPlayer) then {

if (_source isKindOf "CAManBase") then { _source setVariable["startcombattimer",1]; };

};

};

};

_scale = 200;

if (_damage > 0.4) then {

if (_ammo != "zombie") then { _scale = _scale + 50; };

if (_isHeadHit) then { _scale = _scale + 500; };

if ((isPlayer _source) && !(player == _source)) then {

_scale = _scale + 800;

if (_isHeadHit) then { _scale = _scale + 500; };

};

switch (_type) do {

case 1: {_scale = _scale + 200};

case 2: {_scale = _scale + 200};

};

if (_unitIsPlayer) then { r_player_blood = r_player_blood - (_damage * _scale); };

};

if (_hit in USEC_MinorWounds) then {

if (_ammo == "zombie") then {

if (_hit == "legs") then {

[_unit,_hit,(_damage / 6)] call object_processHit;

}else{

[_unit,_hit,(_damage / 4)] call object_processHit; };

}else{

[_unit,_hit,(_damage / 2)] call object_processHit; };

if (_ammo == "") then { [_unit,_hit,_damage] call object_processHit; };

};

if (_unitIsPlayer) then { _unit setVariable["startcombattimer", 1]; };

 

if (_damage > 0.1) then {

if (_unitIsPlayer) then { 1 call fnc_usec_bulletHit; };

if (local _unit) then { _unit setVariable["medForceUpdate",true,true]; };

};

if (_damage > 0.4) then {

_wound = _hit call fnc_usec_damageGetWound;

_isHit = _unit getVariable[_wound,false];

if (_unitIsPlayer) then {

_rndPain = (random 10);

_rndInfection = (random 500);

_hitPain = (_rndPain < _damage);

if ((_isHeadHit) || (_damage > 1.2 && _hitPain)) then { _hitPain = true; };

_hitInfection = (_rndInfection < 1);

if (_isHit) then {

if (_unitIsPlayer) then { r_player_blood = r_player_blood - 50; };

};

if (_hitInfection) then {

if (_unitIsPlayer && !_isPZombie) then {

r_player_infected = true;

player setVariable["USEC_infected",true,true];

};

};

if (_hitPain) then {

if (_unitIsPlayer) then {

r_player_inpain = true;

player setVariable["USEC_inPain",true,true];

};

};

if ((_damage > 1.5) && _isHeadHit) then { [_source,"shothead"] spawn player_death; };

};

if(!_isHit) then {

if(!_isPZombie) then {

_unit setVariable[_wound,true,true];

[_unit,_wound,_hit] spawn fnc_usec_damageBleed;

_pos = getPosATL _unit;

_inRange = _pos nearEntities ["CAManBase",1000];

{

if(isPlayer _x && _x != player) then {

PVDZE_send = [_x,"Bleed",[_unit,_wound,_hit]];

publicVariableServer "PVDZE_send";

};

} count _inRange;

_isInjured = _unit getVariable["USEC_injured",false];

if (!_isInjured) then {

_unit setVariable["USEC_injured",true,true];

if ((_unitIsPlayer) && (_ammo != "zombie")) then {

dayz_sourceBleeding = _source;

};

};

_lowBlood = _unit getVariable["USEC_lowBlood",false];

if (!_lowBlood) then {

_unit setVariable["USEC_lowBlood",true,true];

};

if (_unitIsPlayer) then {

r_player_injured = true;

};

};

};

};

if (_type == 1) then {

if ((_damage > 0.01) && (_unitIsPlayer)) then {

[20,45] call fnc_usec_pitchWhine;

};

if (_damage > 4) then {

if (_unitIsPlayer) then { [_source,"explosion"] spawn player_death; };

}else{

if (_damage > 2) then {

_isCardiac = _unit getVariable["USEC_isCardiac",false];

if (!_isCardiac) then {

_unit setVariable["USEC_isCardiac",true,true];

r_player_cardiac = true;

};

};

};

};

if (_type == 2) then {

if (_damage > 4) then {

if (_unitIsPlayer) then { [_source,"shotheavy"] spawn player_death; };

}else{

if (_damage > 2) then {

_isCardiac = _unit getVariable["USEC_isCardiac",false];

if (!_isCardiac) then {

_unit setVariable["USEC_isCardiac",true,true];

r_player_cardiac = true;

};

};

};

};

if (!_unconscious && !_isMinor && ((_damage > 2) || ((_damage > 0.5) && _isHeadHit))) then { [_unit,_damage] call fnc_usec_damageUnconscious; };

 

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

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


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



  • 0

В init.sqf находишь if (!isDedicated) then { и выше нее вставляешь execVM "custom\safezone.sqf";

Создаешь файл safezone.sqf и туда копируешь код который я приложу ниже.Если пути будишь менять не забудь поменять пути с скриптах я их выделю зеленым и в compiles тоже!

А вот и сам скрипт,рабочий,стоит у меня:

 

SE_CANBUILD = true; // 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 = 30; // Only used if USE_SPEEDLIMIT is true.

USE_SIGNS = true; // use this to build signs around the SafeZone

LOG_EnterLeave = false; // 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,365.00577],150,true], //bash

[[11447.472,11364.504,0],250,true], //klen

[[1606.6443,7803.5156,0],50,true], //bandit

[[12944.227,12766.889,0],70,true], //hero

[[12060,12640,0],100,true], //aero

[[13243.7,6069.79],50,true], //solnichny

[[3330.22,3902.09],50,true] //bor

];

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 setDir _dir;

};

};

} forEach _infiSZ;

};

};

waitUntil { !isNil 'dayz_animalCheck' };

if (isNil 'inSafezone') 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

{

_obj = vehicle player;

_pos = getPosATL _obj;

PVDZE_send = [player,'SafeZoneState',[1]];

publicVariableServer 'PVDZE_send';

};

};

player_fired2 = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_fired.sqf';

player_fired = {_this call player_fired2;deleteVehicle (nearestObject [_this select 0,_this select 4]);};

fnc_usec_damageHandler = {};

player removeAllEventHandlers 'handleDamage';

player addEventHandler ['handleDamage', {false}];

player allowDamage false;

_veh = vehicle player;

if (player != _veh) then

{

_szs = _veh getVariable ['inSafeZone',0];

if (_szs == 0) then

{

_veh removeAllEventHandlers 'Fired';

_veh addEventHandler ['Fired', {_this call player_fired;}];

{

_x removeAllEventHandlers 'Fired';

_x addEventHandler ['Fired', {_this call player_fired;}];

} forEach (crew _veh);

_veh setVariable ['inSafeZone', 1, true];

_veh removeAllEventHandlers 'HandleDamage';

_veh addEventHandler ['HandleDamage', {false}];

_veh allowDamage false;

};

};

 

_cwep = currentWeapon player;

if (_cwep in ['MAAWS']) 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

{

_obj = vehicle player;

_pos = getPosATL _obj;

PVDZE_send = [player,'SafeZoneState',[0]];

publicVariableServer 'PVDZE_send';

};

};

player_fired = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_fired.sqf';

player_zombieCheck = compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_zombieCheck.sqf';

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 'custom\fn_vehhandledmage.sqf';

 

_veh = vehicle player;

if (player != _veh) then

{

_szs = _veh getVariable ['inSafeZone',0];

if (_szs == 1) then

{

_veh setVariable ['inSafeZone', 0, true];

_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 "custom\fn_damagehandler.sqf";

player removeAllEventHandlers 'HandleDamage';

player addeventhandler ['HandleDamage',{_this call fnc_usec_damageHandler;} ];

};

};

 

while {1 == 1} do

{

_state = false;

_obj = vehicle player;

 

if (isNil 'inSafeZone') then { inSafeZone = false; } else { if (typename inSafeZone != 'BOOL') then { inSafeZone = false; }; };

if (isNil 'canbuild') then { canbuild = true; } else { if (typename canbuild != 'BOOL') then { canbuild = true; }; };

if (isNil 'USE_POSITIONS') then { USE_POSITIONS = false; } else { if (typename USE_POSITIONS != 'BOOL') then { USE_POSITIONS = false; }; };

if (isNil 'USE_CANBUILD') then { USE_CANBUILD = true; } else { if (typename USE_CANBUILD != 'BOOL') then { USE_CANBUILD = true; }; };

if (isNil 'USE_TraderCity') then { USE_TraderCity = true; } else { if (typename USE_TraderCity != 'BOOL') then { USE_TraderCity = true; }; };

if (USE_POSITIONS) then

{

{

_z = _x select 0;

_r = _x select 1;

if (_obj distance _z < _r) exitWith {_state = true;};

} forEach _infiSZ;

};

if (USE_CANBUILD) then

{

if (!canbuild) then {_state = true;};

};

if (USE_TraderCity) then

{

if (isInTraderCity) then {_state = true;};

};

if (_state) then

{

inSafeZone = true;

call _startSafeZone;

{

if (!isNull _x) then

{

if !(isPlayer _x) then

{

deletevehicle _x;

};

};

} forEach (_obj nearEntities ['zZombie_Base',20]);

 

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'], 3]);

if ((_cnt > 0) && (!isNull (findDisplay 106))) then

{

(findDisplay 106) closedisplay 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 0.1;

};

};

};

 

 

Ах да чуть забыл не забудь создать 2 файла  fn_vehhandledmage.sqf'; и fn_damagehandler.sqf и кинуть их туда же где будет лежать скрипт! они не дадут уничтожать технику как в сейфзоне так и вне её,вот скрипт fn_vehhandledmage.sqf:

 

private["_unit","_selection","_strH","_total","_damage","_needUpdate"];

_unit = _this select 0;

_selection = _this select 1;

_total = _this select 2;

_state = false;

{

if (_unit distance _x < 120) exitWith {_state = true;};

} forEach [[4063.4226,11664.19],

[11447.472,11364.504],

[4144.6865,10933.705],

[12943.984,12764.368],

[7211.3872,7651.272],

[1619.9688,7791.291]];

//if ((locked _unit && (count (crew _unit)) == 0) && ((count(nearestObjects [_unit, ["Plastic_Pole_EP1_DZ"],60]) > 0) || (_state))) exitWith {};

if (_selection != "") then {

_strH = "hit_" + _selection;

}else{

_strH = "totalDmg";

};

if (_total >= 0.98) then {

_total = 1.0;

};

if (local _unit) then {

if (_total > 0) then {

_unit setVariable [_strH, _total, true];

_unit setHit [_selection, _total];

if (isServer) then {

[_unit, "damage"] call server_updateObject;

} else {

PVDZE_veh_Update = [_unit,"damage"];

publicVariableServer "PVDZE_veh_Update";

};

};

}else{

PVDZE_send = [_unit,"VehHandleDam",_this];

publicVariableServer "PVDZE_send";

};

_total

 

А вот скрипт  fnc_damagehandler.sqf:

 

scriptName "Functions\misc\fn_damageHandler.sqf";

private ["_unit","_humanityHit","_myKills","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_isCardiac","_isHeadHit","_isMinor","_scale","_canHitFree","_rndPain","_rndInfection","_hitInfection","_lowBlood","_isPZombie","_source","_ammo","_unitIsPlayer","_isBandit"];

_unit = _this select 0;

_hit = _this select 1;

_damage = _this select 2;

_unconscious = _unit getVariable ["NORRN_unconscious", false];

_isPZombie = player isKindOf "PZombie_VB";

_source = _this select 3;

_ammo = _this select 4;

_type = [_damage,_ammo] call fnc_usec_damageType;

_isMinor = (_hit in USEC_MinorWounds);

_isHeadHit = (_hit == "head_hit");

_isPlayer = (isPlayer _source);

_humanityHit = 0;

_myKills = 0;

_unitIsPlayer = _unit == player;

if (_unitIsPlayer) then {

if (_hit == "") then {

if ((_source != player) && _isPlayer) then {

if (_source isKindOf "CAManBase") then { _source setVariable["startcombattimer",1]; };

};

};

};

_scale = 200;

if (_damage > 0.4) then {

if (_ammo != "zombie") then { _scale = _scale + 50; };

if (_isHeadHit) then { _scale = _scale + 500; };

if ((isPlayer _source) && !(player == _source)) then {

_scale = _scale + 800;

if (_isHeadHit) then { _scale = _scale + 500; };

};

switch (_type) do {

case 1: {_scale = _scale + 200};

case 2: {_scale = _scale + 200};

};

if (_unitIsPlayer) then { r_player_blood = r_player_blood - (_damage * _scale); };

};

if (_hit in USEC_MinorWounds) then {

if (_ammo == "zombie") then {

if (_hit == "legs") then {

[_unit,_hit,(_damage / 6)] call object_processHit;

}else{

[_unit,_hit,(_damage / 4)] call object_processHit; };

}else{

[_unit,_hit,(_damage / 2)] call object_processHit; };

if (_ammo == "") then { [_unit,_hit,_damage] call object_processHit; };

};

if (_unitIsPlayer) then { _unit setVariable["startcombattimer", 1]; };

 

if (_damage > 0.1) then {

if (_unitIsPlayer) then { 1 call fnc_usec_bulletHit; };

if (local _unit) then { _unit setVariable["medForceUpdate",true,true]; };

};

if (_damage > 0.4) then {

_wound = _hit call fnc_usec_damageGetWound;

_isHit = _unit getVariable[_wound,false];

if (_unitIsPlayer) then {

_rndPain = (random 10);

_rndInfection = (random 500);

_hitPain = (_rndPain < _damage);

if ((_isHeadHit) || (_damage > 1.2 && _hitPain)) then { _hitPain = true; };

_hitInfection = (_rndInfection < 1);

if (_isHit) then {

if (_unitIsPlayer) then { r_player_blood = r_player_blood - 50; };

};

if (_hitInfection) then {

if (_unitIsPlayer && !_isPZombie) then {

r_player_infected = true;

player setVariable["USEC_infected",true,true];

};

};

if (_hitPain) then {

if (_unitIsPlayer) then {

r_player_inpain = true;

player setVariable["USEC_inPain",true,true];

};

};

if ((_damage > 1.5) && _isHeadHit) then { [_source,"shothead"] spawn player_death; };

};

if(!_isHit) then {

if(!_isPZombie) then {

_unit setVariable[_wound,true,true];

[_unit,_wound,_hit] spawn fnc_usec_damageBleed;

_pos = getPosATL _unit;

_inRange = _pos nearEntities ["CAManBase",1000];

{

if(isPlayer _x && _x != player) then {

PVDZE_send = [_x,"Bleed",[_unit,_wound,_hit]];

publicVariableServer "PVDZE_send";

};

} count _inRange;

_isInjured = _unit getVariable["USEC_injured",false];

if (!_isInjured) then {

_unit setVariable["USEC_injured",true,true];

if ((_unitIsPlayer) && (_ammo != "zombie")) then {

dayz_sourceBleeding = _source;

};

};

_lowBlood = _unit getVariable["USEC_lowBlood",false];

if (!_lowBlood) then {

_unit setVariable["USEC_lowBlood",true,true];

};

if (_unitIsPlayer) then {

r_player_injured = true;

};

};

};

};

if (_type == 1) then {

if ((_damage > 0.01) && (_unitIsPlayer)) then {

[20,45] call fnc_usec_pitchWhine;

};

if (_damage > 4) then {

if (_unitIsPlayer) then { [_source,"explosion"] spawn player_death; };

}else{

if (_damage > 2) then {

_isCardiac = _unit getVariable["USEC_isCardiac",false];

if (!_isCardiac) then {

_unit setVariable["USEC_isCardiac",true,true];

r_player_cardiac = true;

};

};

};

};

if (_type == 2) then {

if (_damage > 4) then {

if (_unitIsPlayer) then { [_source,"shotheavy"] spawn player_death; };

}else{

if (_damage > 2) then {

_isCardiac = _unit getVariable["USEC_isCardiac",false];

if (!_isCardiac) then {

_unit setVariable["USEC_isCardiac",true,true];

r_player_cardiac = true;

};

};

};

};

if (!_unconscious && !_isMinor && ((_damage > 2) || ((_damage > 0.5) && _isHeadHit))) then { [_unit,_damage] call fnc_usec_damageUnconscious; };

 

Воу всё работает. Спасибо тебе за уделённое мне время. Всё работает как часы))

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


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

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

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

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

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

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

Войти

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

Войти сейчас

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

    • Автор: RedLink
      Всем Привет.
      Представляю вам систему логирования действий игроков и т.д. по принципу InfiSTAR.
      Для установки вам понадобятся кастомный compiles.sqf (тем кто не знает как это сделать, -> поиск по форуму).
       
      1. Открываем в серверной части файл dayz_server\init\server_functions.sqf и в самом низу вставляем:
      "SK_log" addPublicVariableEventHandler {(_this select 1) call fnc_Log;}; 2. Теперь открываем в папке с миссией файл compiles.sqf и ищем что-то в этом плане:
       
      if (!isDedicated) then { блаблабла }; и после него вставляем
      fnc_log = { private ["_fileName","_message","_dll","_dll2","_display"]; _fileName = toLower (_this select 0); _message = _this select 1; _display = if (count _this > 2) then {_this select 2} else {false}; if (!isDedicated) then { SK_Log = [_fileName,if (typeName _message == "ARRAY") then {_message} else {toArray _message},_display]; publicVariableServer "SK_Log"; } else { _message = if (typeName _message == "ARRAY") then {toString _message} else {_message}; if (_display) then {diag_log format ["[%1] %2",toUpper (_fileName),_message];}; _dll2 = format["!InfiSTAR_Logs~%1~%2",_fileName,_message]; "LogDLL" callExtension _dll2; }; }; где "!InfiSTAR_Logs" - ваша папка, куда вы хотите складировать логи.
       
      3. Открываем файл publicVariable.txt в фильтрах Battleye и в первой строке "5 !=блаблабла" в конце добавляем "!=SK_Log" (пример ниже)
      5 !"donn_heli_monitor" !"fnc_log" !=fnc_log !"redHunter" !=redHunter !"cad_pvar_s" !"PVDZE_veh_Update" !="PVDZE_veh_Update" !="PVDZE_adminevents" !="PVDZ_plr_Death" !"PVDZ_plr_Death" !="PVDZE_atp" !"PVDZE_atp" !"PVDZ_plr_LoginRecord" !="PVDZ_plr_LoginRecord" !"PVDZE_log_lockUnlock" !=PVDZE_log_lockUnlock !"redHunter" !=redHunter !"redDiagLog" !=redDiagLog !="PVDZE_atp" !=(remExField|remExFP) !=(PVCDZ_obj_GutBody|drn_AskServerDynamicWeatherEventArgs|BIS_effects_gepv|achievement|dayzFlies) !=PVDZ_(drg_(RaDrag|RaLW|RLact)|getTickTime|hlt_Bleed|obj_(Delete|Publish|RoadFlare|Destroy|Fire)|veh_Save|veh_SF) !=PVDZ_(plr_(Death|Login[12]|LoginRecord|Save|SwitchMove)|Server(_Simulation|StoreVar)|sec_atp) !=PVDZ_(playerMedicalSync|object_replace|groupInvite) !=PVDZ_(send(|Unconscious)) !=PVDZ_Server_(buildLock|LogIt|UpdateGroup) !=PVDZ_Server_process(Code|SetAccessCode) !=PVDZ_objgather_(Delete|Knockdown) !=PVDZE_(obj_(Delete|Publish|Swap|Trade)|fullobj_Publish|maintainArea|veh_(Lock|Publish2|Upgrade)|handleSafeGear|plr_(DeathB|FriendRQ|TradeMenu)) !=PVAH_AdminReq !=PVAH_WriteLogReq !=PVAHR_0_[a-zA-Z0-9]{20,40} !"PVAHR_" !="PVAH_AdminReq" !="PVAH_WriteLogReq" !=PVAHR_0_[a-zA-Z0-9]{20,40} !="PVDZE_(query|store|spawn)Vehicle" !="PVDZE_PingSend" !="PVDZE_veh_Init" !"SK_Log" !=SK_Log  
      4. А теперь самое главное.
      Пример вывода лога в отдельный файл. Возьмем для примера файл смерти игрока от тех или иных причин.
      Открываем в серверной части файл server_playerDied.sqf и ищем там строку
       
      diag_log format["%1 (%2) %3 @%4 %5",_playerName,_playerID,_message,mapGridPosition _pos,_pos]; после нее вставляем
      ["DEATHS",format ["%1 (%2) %3 @%4 %5",_playerName,_playerID,_message,mapGridPosition _pos,_pos],true] call fnc_log; Таким образом в указанной в папке в п. 2 создатся файл deaths_блаблабла.txt, в котором будет отображен лог о смерти игрока по тем или иным причинам.
       
      Формат записи лога выглядит следующим образом:
      _message = format ["Что хочу то и пишу и хочу видеть значение %1",_значение%1]; ["ИМЯ_ФАЙЛА_ЛОГА",_message,true] call fnc_log; или напрямую
      ["Имя_файла_лога",format ["тут будет то что в значении %1",_значение%1],true] call fnc_log;  
      Представляю варианты 4-х DLL, которые работают для этой системы (качаете любую из них и переименовываете в LogDLL.dll). Эту DLL необходимо закинуть в папку с игрой (например в C:\Games\Arma 2 Operation Arrowhead).
      LogDLL.dll создает в папке с логами отдельную папку по названию лога.
      LogDLL_-_dd-MM-yyyy и иные ее интерпретации - создает в папке с логами отдельную папку с датой, в которой хранятся все логи за эту дату.
       
      Если есть вопросы, задавайте.
       
      Оригинал данного скрипта и ссылки на разработчика ниже.
      Копирайта

      Пожалуйста, Войдите или Зарегистрируйтесь, чтобы увидеть это: Вложение.
    • Автор: RedLink
      Всем привет.
      Возник один вопрос, который пока не могу догнать как решить.
      Суть следующая. В последней версии Инфистара есть код, который выводит логи в отдельную папку
      Путем нехитрых манипуляций добавляем ему вывод лог в отдельную папку с датой (ибо надоел тот кошмар, что там за 5 дней скапливается)
      А вот теперь сам вопрос.
      Если переменная dayz_ForcefullmoonNights = true;
      то создается папка с датой, которая указана в server_monitor.sqf - т.е. 2012,8,2 - что в принципе логично.
      А вот если dayz_ForcefullmoonNights = false; - то создается папка с датой, которая указана в mission.sqf (в моем случае это 2008,10,1. Хотя по логике должна присваиваться реальная дата, которая берется из того-же server_monitor при проверке на dayz_ForcefullmoonNights, т.к. в логе сервера мы видим, что TIME SYNC текущая дата сервера.
      Почему так происходит и как это можно поправить?
    • Автор: DOK43
      где найти перевод админки INFISTAR v1442 ? или уже готовый файл, помогите
    • Автор: Onechot255
      2 дня пытаюсь пофиксить, без понятия.
      rpt:
      log:
      extdb:
       
      Причем в конфиге Use MPInterrupt check _UMP = false;
      Другие игроки нормально заходят, сервер на локалке
    • Автор: Gromillla
      Скиньте пожалуйста код удаления под 1.0.6.2 для Infistara, а то у старого удалённая техника и постройки восстанавливаются после рестарта.
  • Наш выбор

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

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

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