diff --git a/SQF/dayz_code/compile/fn_damageHandler.sqf b/SQF/dayz_code/compile/fn_damageHandler.sqf index 25817d11a..1d83548e4 100644 --- a/SQF/dayz_code/compile/fn_damageHandler.sqf +++ b/SQF/dayz_code/compile/fn_damageHandler.sqf @@ -163,27 +163,24 @@ if (_unit == player) then { }; }; - //Log to server :-( OverProcessing really not needed. - if (DZE_ServerLogHits && {!local _source} && {_isMan}) then { + //Log to server. Useful for detecting damage and ammo cheats. + if (DZE_ServerLogHits && {!local _source} && {_isMan} && {!_isZombieHit} && {diag_ticktime-(_source getVariable["lastloghit",0]) > 2}) then { _wpst = weaponState _source; - if (diag_ticktime-(_source getVariable ["lastloghit",0])>2) then { - _source setVariable ["lastloghit",diag_ticktime]; - _sourceDist = round(_unit distance _source); - _sourceWeap = switch (true) do { - case (_isZombieHit) : { _ammo }; - case (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship") : { format ["in %1",getText(configFile >> "CfgVehicles" >> _sourceVehicleType >> "displayName")] }; - case (_wpst select 0 == "Throw") : { format ["with %1 thrown", _wpst select 3] }; - case (["Horn", currentWeapon _source] call fnc_inString) : {"with suspicious vehicle "+str((getposATL _source) nearEntities [["Air", "LandVehicle", "Ship"],5])}; - case (["Melee", _wpst select 0] call fnc_inString) : { format ["with %2%1",_wpst select 0, if (_sourceDist>6) then {"suspicious weapon "} else {""}] }; - case ((_wpst select 0 == "") AND {(_wpst select 4 == 0)}) : { format ["with %1/%2 suspicious", primaryWeapon _source, _ammo] }; - case (_wpst select 0 != "") : { format ["with %1/%2 ", _wpst select 0, _ammo, _wpst select 4] }; - default { "with suspicious weapon" }; - }; - if (!_isZombieHit) then { // don't log any zombie wounds, even from remote zombies - PVDZ_sec_atp = [_unit, _source, toArray _sourceWeap, _sourceDist]; //Send arbitrary string as array to allow stricter publicVariableVal.txt filter - publicVariableServer "PVDZ_sec_atp"; - }; - }; + _source setVariable ["lastloghit",diag_ticktime]; + _sourceDist = round(_unit distance _source); + _sourceWeap = switch (true) do { + case (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship") : { format ["in %1",getText(configFile >> "CfgVehicles" >> _sourceVehicleType >> "displayName")] }; + case (_wpst select 0 == "Throw") : { format ["with %1 thrown", _wpst select 3] }; + case (["Horn", currentWeapon _source] call fnc_inString) : {"with suspicious vehicle "+str((getposATL _source) nearEntities [["Air", "LandVehicle", "Ship"],5])}; + case (["Melee", _wpst select 0] call fnc_inString) : { format ["with %2%1",_wpst select 0, if (_sourceDist>6) then {"suspicious weapon "} else {""}] }; + case ((_wpst select 0 == "") AND {(_wpst select 4 == 0)}) : { format ["with %1/%2 suspicious", primaryWeapon _source, _ammo] }; + case (_wpst select 0 != "") : { format ["with %1/%2 ", _wpst select 0, _ammo, _wpst select 4] }; + default { "with suspicious weapon" }; + }; + + //Damage values over 999,999 will kick for PV value restriction (e+). These should not be possible for legitimate players. + PVDZ_sec_atp = [_unit, _source, toArray _sourceWeap, _sourceDist, toArray _hit, str _damage]; //Send arbitrary string as array to allow stricter publicVariableVal.txt filter + publicVariableServer "PVDZ_sec_atp"; }; dayz_lastDamageSource = switch (true) do { @@ -203,9 +200,6 @@ if (_unit == player) then { //Ignore none part dmg. Exit after processing humanity hit if (_hit == "" && _ammo != "Crash") exitWith { 0 }; -//Pure base blood damage -_scale = 200; - //Ammo Type Setup _type = switch true do { case ((_ammo isKindof "Grenade") or (_ammo isKindof "ShellBase") or (_ammo isKindof "TimeBombCore") or (_ammo isKindof "BombCore") or (_ammo isKindof "MissileCore") or (_ammo isKindof "RocketCore") or (_ammo isKindof "FuelExplosion") or (_ammo isKindof "GrenadeBase")): { 1 }; @@ -228,6 +222,9 @@ if (_damage > 0.1) then { }; }; +//Pure base blood damage +_scale = 200; + if (_damage > 0.4) then { //Scale damage based on headhits. if (_isHeadHit) then { @@ -239,7 +236,7 @@ if (_damage > 0.4) then { if (!(player == _source) && (_isPlayer or (_isMan && !_isZombieHit))) then { //Scale shots from AI units the same as shots from players _scale = _scale + 800; if (_isHeadHit) then { - _scale = _scale + 1180; + _scale = _scale + 1180; //Based on 12k blood for DMR headshot at 500m }; }; @@ -252,7 +249,7 @@ if (_damage > 0.4) then { //Zombies case 3: {_scale = getNumber (configFile >> "CfgVehicles" >> _sourceType >> "damageScale"); if (dayz_DamageMultiplier > 1) then {_scale = _scale * dayz_DamageMultiplier;};}; //RunOver - case 4: {_scale = _scale - 150}; + case 4: {_scale = _scale - 50}; //Based on 12k blood for run over with SUV at 70km/h //Dragged case 5: {_scale = 25}; //Crash diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index 543a899f3..f8ad4b652 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -7274,7 +7274,7 @@ %1 умер от %2 - %1 was killed by %2 with a %3 from %4m + %1 was killed by %2 with a(n) %3 from %4m %1 wurde von %2 mit einer %3 von %4m getötet %1 был убит игроком %2 с %3 с расстояния %4м diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf index 19bda9cbb..6f148f4ed 100644 --- a/SQF/dayz_server/system/server_monitor.sqf +++ b/SQF/dayz_server/system/server_monitor.sqf @@ -438,10 +438,10 @@ if (dayz_townGenerator) then {execVM "\z\addons\dayz_server\system\lit_fireplace _unit = _x select 0; _source = _x select 1; if (((!(isNil {_source})) && {!(isNull _source)}) && {((_source isKindOf "CAManBase") && {owner _unit != owner _source})}) then { - diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters", - _unit call fa_plr2Str, _source call fa_plr2Str, toString (_x select 2), _x select 3]; + diag_log format ["P1ayer %1 hit by %2 %3 from %4 meters in %5 for %6 damage", + _unit call fa_plr2Str, _source call fa_plr2Str, toString (_x select 2), _x select 3, toString (_x select 4), _x select 5]; if (_unit getVariable ["processedDeath",0] == 0) then { - _unit setVariable ["attacker", name _source]; + if (alive _source) then {_unit setVariable ["attacker", name _source];}; _unit setVariable ["noatlf4", diag_ticktime]; // server-side "not in combat" test, if player is not already dead }; };