mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-17 17:20:26 +03:00
0.1
This commit is contained in:
25
dayz_code/compile/player_humanityChange.sqf
Normal file
25
dayz_code/compile/player_humanityChange.sqf
Normal file
@@ -0,0 +1,25 @@
|
||||
private["_object","_change","_humanity","_timeStart"];
|
||||
//Set Variables
|
||||
_object = _this select 0;
|
||||
_change = _this select 1;
|
||||
_humanity = 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 ((typeOf player != "Bandit1_DZ") && (typeOf player != "BanditW1_DZ")) then {
|
||||
if (player getVariable ["freeTarget",false]) then {
|
||||
waitUntil{!(player getVariable ["freeTarget",false])};
|
||||
};
|
||||
player setVariable ["freeTarget",true,true];
|
||||
_timeStart = time;
|
||||
sleep _wait;
|
||||
player setVariable ["freeTarget",false,true];
|
||||
};
|
||||
} else {
|
||||
player setVariable["humanity",_humanity,true];
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user