Update compiles - 2 more files to do

fn_selfActions.sqf
player_updateGui.sqf
This commit is contained in:
icomrade
2016-02-29 00:26:12 -05:00
parent a83909b918
commit b96cd2d971
67 changed files with 3886 additions and 1212 deletions

View File

@@ -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];
};
};