mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Update compiles - 2 more files to do
fn_selfActions.sqf player_updateGui.sqf
This commit is contained in:
@@ -3,22 +3,26 @@ private ["_object","_change","_humanity","_wait"];
|
||||
_object = _this select 0;
|
||||
_change = _this select 1;
|
||||
_humanity = 0;
|
||||
_wait = if (count _this > 2) then { _this select 2 } else { 0 };
|
||||
|
||||
if (_object == player) then {
|
||||
_humanity = player getVariable["humanity",0];
|
||||
_humanity = _humanity + _change;
|
||||
if (_change < 0) then {
|
||||
_wait = _this select 2;
|
||||
player setVariable["humanity",_humanity,true];
|
||||
if (player getVariable ["freeTarget",false]) then {
|
||||
waitUntil{!(player getVariable ["freeTarget",false])};
|
||||
_humanity = (player getVariable["humanity",0]) + _change;
|
||||
player setVariable["humanity",_humanity,true];
|
||||
if (_change < 0) then { //non-bandit player can be "punished" in next "_wait" seconds w/o loosing humanity
|
||||
if ((_humanity > -2000) and (_wait > 0)) then {
|
||||
player setVariable ["freeTarget",true,true];
|
||||
player setVariable ["FTcounter",((player getVariable ["FTcounter",0]) + _wait)];
|
||||
[_wait] spawn {
|
||||
private ["_endtime","_wait"];
|
||||
_wait = _this select 0;
|
||||
_endTime = diag_tickTime + _wait;
|
||||
waitUntil { sleep 1; diag_tickTime > _endTime };
|
||||
player setVariable ["FTcounter",((player getVariable ["FTcounter",0]) - _wait)];
|
||||
if ((player getVariable ["FTcounter",0]) <= 0) then {
|
||||
player setVariable ["FTcounter",0];
|
||||
player setVariable ["freeTarget",false,true];
|
||||
};
|
||||
};
|
||||
};
|
||||
player setVariable ["freeTarget",true,true];
|
||||
//_timeStart = time;
|
||||
uiSleep _wait;
|
||||
player setVariable ["freeTarget",false,true];
|
||||
|
||||
} else {
|
||||
player setVariable["humanity",_humanity,true];
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user