mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Push #941 - vehicleDamage
This commit is contained in:
@@ -34,3 +34,44 @@ if (_dam < 1 ) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
_total
|
_total
|
||||||
|
|
||||||
|
/* WIP - PVS/PVC - Skaronator - CP out of DayZ Mod 1.8
|
||||||
|
private["_unit","_selection","_strH","_total","_damage","_needUpdate"];
|
||||||
|
|
||||||
|
_unit = _this select 0;
|
||||||
|
_selection = _this select 1;
|
||||||
|
_total = _this select 2;
|
||||||
|
|
||||||
|
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 {
|
||||||
|
// vehicle is not local to this client, ask the client which vehicle is local to set damage
|
||||||
|
//_this resize 5; // delete "broadcast" boolean
|
||||||
|
PVDZE_send = [_unit,"VehHandleDam",_this];
|
||||||
|
publicVariableServer "PVDZE_send";
|
||||||
|
};
|
||||||
|
|
||||||
|
// all "HandleDamage event" functions should return the effective damage that the engine will record for that part
|
||||||
|
_total
|
||||||
|
*/
|
||||||
@@ -26,6 +26,14 @@
|
|||||||
"PVDZE_plr_HumanityChange" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
|
"PVDZE_plr_HumanityChange" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
|
||||||
"PVDZE_serverObjectMonitor" addPublicVariableEventHandler {PVDZE_serverObjectMonitor = dayz_safety};
|
"PVDZE_serverObjectMonitor" addPublicVariableEventHandler {PVDZE_serverObjectMonitor = dayz_safety};
|
||||||
|
|
||||||
|
|
||||||
|
/* WIP - PVS/PVC Skaronator
|
||||||
|
|
||||||
|
"PVCDZE_vehSH" addPublicVariableEventHandler {(_this select 1) call vehicle_handleDamage}; // set damage to vehicle part
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//Server only
|
//Server only
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
//WIP - Skaronator
|
//WIP - Skaronator
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ switch (_variable) do {
|
|||||||
if (local _vehicle) then {
|
if (local _vehicle) then {
|
||||||
_arraytosend call fnc_veh_handleDam;
|
_arraytosend call fnc_veh_handleDam;
|
||||||
} else {
|
} else {
|
||||||
PVCDZ_veh_SH = _arraytosend;
|
PVCDZE_vehSH = _arraytosend;
|
||||||
_owner publicVariableClient "PVCDZ_veh_SH";
|
_owner publicVariableClient "PVCDZE_vehSH";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user