mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-06 16:22:54 +03:00
0.1
This commit is contained in:
28
dayz_code/compile/object_setHitServer.sqf
Normal file
28
dayz_code/compile/object_setHitServer.sqf
Normal file
@@ -0,0 +1,28 @@
|
||||
private["_unit","_selection","_strH","_dam","_total"];
|
||||
_unit = _this select 0;
|
||||
_selection = _this select 1;
|
||||
_damage = _this select 2;
|
||||
if ((_selection != "") and local _unit) then {
|
||||
_strH = "hit_" + (_selection);
|
||||
_dam = _unit getVariable [_strH,0];
|
||||
_total = (_dam + _damage);
|
||||
if (_total > 1) then {
|
||||
_total = 1;
|
||||
};
|
||||
_unit setVariable [_strH,_total,true];
|
||||
|
||||
if (_damage >= 1) then {
|
||||
dayzUpdateVehicle = [_unit,"damage"];
|
||||
if (isServer) then {
|
||||
if (allowConnection) then {
|
||||
dayzUpdateVehicle call server_updateObject;
|
||||
};
|
||||
} else {
|
||||
publicVariable "dayzUpdateVehicle";
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
_damage = 0;
|
||||
};
|
||||
_damage
|
||||
Reference in New Issue
Block a user