From 2a37818e478bf9c62934ab4614a1e206b6390b2e Mon Sep 17 00:00:00 2001 From: Skaronator Date: Sat, 11 Jan 2014 20:11:00 +0100 Subject: [PATCH] Push #941 - Humanity --- SQF/dayz_code/compile/fn_damageHandler.sqf | 35 +++++++------------ SQF/dayz_code/compile/player_death.sqf | 8 +++++ .../compile/server_sendToClient.sqf | 10 +++--- 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/SQF/dayz_code/compile/fn_damageHandler.sqf b/SQF/dayz_code/compile/fn_damageHandler.sqf index bbd56e2de..35f78752f 100644 --- a/SQF/dayz_code/compile/fn_damageHandler.sqf +++ b/SQF/dayz_code/compile/fn_damageHandler.sqf @@ -24,29 +24,6 @@ _humanityHit = 0; _myKills = 0; _unitIsPlayer = _unit == player; -//Publish Damage - //player sidechat format["Processed damage for %1",_unit]; - //USEC_SystemMessage = format["CLIENT: %1 damaged for %2 (in vehicle: %5)",_unit,_damage,_isMinor,_isHeadHit,_inVehicle]; - //PublicVariable "USEC_SystemMessage"; - -/* -if (_isPlayer) then { - if (_damage > 0.1) then { - dayz_canDisconnect = false; - //["PVDZE_plr_DiscAdd",getPlayerUID player] call callRpcProcedure; - PVDZE_plr_DiscAdd = getPlayerUID player; - publicVariableServer "PVDZE_plr_DiscAdd"; - - dayz_damageCounter = time; - - //Ensure Control is visible - _display = uiNamespace getVariable 'DAYZ_GUI_display'; - _control = _display displayCtrl 1204; - _control ctrlShow true; - }; -}; -*/ - if (_unitIsPlayer) then { if (_hit == "") then { if ((_source != player) and _isPlayer) then { @@ -68,6 +45,18 @@ if (_unitIsPlayer) then { PVDZE_plr_HumanityChange = [_source,_humanityHit,30]; publicVariable "PVDZE_plr_HumanityChange"; }; + + /* WIP - PVS/PVC - Skaronator + if (_humanityHit != 0) then { + [_source,_humanityHit] spawn { + private ["_source","_humanityHit"]; + _source = _this select 0; + _humanityHit = _this select 1; + PVDZE_send = [_source,"Humanity",[_source,_humanityHit,30]]; + publicVariableServer "PVDZE_send"; + }; + }; + */ }; }; }; diff --git a/SQF/dayz_code/compile/player_death.sqf b/SQF/dayz_code/compile/player_death.sqf index 5ba3f7c05..7cbec9c22 100644 --- a/SQF/dayz_code/compile/player_death.sqf +++ b/SQF/dayz_code/compile/player_death.sqf @@ -79,6 +79,10 @@ if (count _array > 0) then { if (_isBandit and !_isPZombie and (_humanity != 0)) then { PVDZE_plr_HumanityChange = [_source,_humanity,_wait]; publicVariable "PVDZE_plr_HumanityChange"; + /* WIP - PVS/PVC - Skaronator + PVDZ_send = [_source,"Humanity",[_source,_humanity,_wait]]; + publicVariableServer "PVDZ_send"; + */ }; }; @@ -97,6 +101,10 @@ if (count _array > 0) then { _wait = 0; PVDZE_plr_HumanityChange = [_source,_humanity,_wait]; publicVariable "PVDZE_plr_HumanityChange"; + /* WIP - PVS/PVC - Skaronator + PVDZ_send = [_source,"Humanity",[_source,_humanity,_wait]]; + publicVariableServer "PVDZ_send"; + */ }; if (_canHitFree) then { //_humanity = 100; //50 diff --git a/SQF/dayz_server/compile/server_sendToClient.sqf b/SQF/dayz_server/compile/server_sendToClient.sqf index c02b80647..5d5e0d432 100644 --- a/SQF/dayz_server/compile/server_sendToClient.sqf +++ b/SQF/dayz_server/compile/server_sendToClient.sqf @@ -31,16 +31,14 @@ switch (_variable) do { }; }; - case "HideBody": { + case "HideBody": { //DONE PVCDZE_hideBody = _arraytosend select 0; _owner publicVariableClient "PVCDZE_hideBody"; }; - case "Humanity": { - PVCDZ_plr_Humanity = _arraytosend; - _owner publicVariableClient "PVCDZ_plr_Humanity"; - - //diag_log ("Humanity" +str(PVCDZ_plr_Humanity)); + case "Humanity": { //DONE + PVDZE_plr_HumanityChange = _arraytosend; + _owner publicVariableClient "PVDZE_plr_HumanityChange"; }; case "dayzSetDate": {