mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-10 02:02:54 +03:00
1.7.5.M1D9 + tag friend system from
This commit is contained in:
@@ -6,6 +6,8 @@ if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
if (vehicle player != player) exitWith {cutText ["You may not drink while in a vehicle", "PLAIN DOWN"]};
|
||||
|
||||
if (dayz_thirst == 0) exitWith {cutText ["I am not thirsty", "PLAIN DOWN"]};
|
||||
|
||||
_item = _this;
|
||||
_hasdrinkitem = _this in magazines player;
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
if (vehicle player != player) exitWith {cutText ["You may not eat while in a vehicle", "PLAIN DOWN"]};
|
||||
|
||||
if (dayz_hunger == 0) exitWith {cutText ["I am not hungry", "PLAIN DOWN"]};
|
||||
|
||||
_item = _this;
|
||||
_hasfoodmag = _this in magazines player;
|
||||
|
||||
@@ -19,6 +21,8 @@ player playActionNow "PutDown";
|
||||
player removeMagazine _item;
|
||||
sleep 1;
|
||||
|
||||
_regen = round(random _regen);
|
||||
|
||||
r_player_blood = r_player_blood + _regen;
|
||||
if (r_player_blood > r_player_bloodTotal) then {
|
||||
r_player_blood = r_player_bloodTotal;
|
||||
|
||||
22
dayz_code/actions/player_tagFriendly.sqf
Normal file
22
dayz_code/actions/player_tagFriendly.sqf
Normal file
@@ -0,0 +1,22 @@
|
||||
private["_target", "_caller", "_action", "_callerID", "_targetID", "_friendlies", "_rfriendlies"];
|
||||
_target = _this select 0;
|
||||
_caller = _this select 1;
|
||||
_action = _this select 2;
|
||||
|
||||
_caller removeAction _action;
|
||||
|
||||
_callerID = _caller getVariable "characterID";
|
||||
_targetID = _target getVariable "characterID";
|
||||
|
||||
_friendlies = _caller getVariable ["friendlies", []];
|
||||
_friendlies set [count _friendlies, _targetID];
|
||||
_caller setVariable ["friendlies", _friendlies, true];
|
||||
|
||||
_rfriendlies = _target getVariable ["friendlies", []];
|
||||
|
||||
if (!(_callerID in _rfriendlies)) then {
|
||||
// caller
|
||||
titleText [format["You have tagged %1 as friendly. Waiting for %2 to accept that.",(name _target),(name _target)]];
|
||||
// target
|
||||
[_caller,_target,"loc",rTITLETEXT,format["%1 wants to tag you as friendly. To accept, tag %2 as friendly.", (name _caller),(name _caller)],"PLAIN DOWN"] call RE;
|
||||
};
|
||||
Reference in New Issue
Block a user