mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-17 17:20:26 +03:00
0.9 + pre 1.7.5
This commit is contained in:
32
dayz_code/actions/boil.sqf
Normal file
32
dayz_code/actions/boil.sqf
Normal file
@@ -0,0 +1,32 @@
|
||||
private["_hasbottleitem","_hastinitem","_bottletext","_tin1text","_tin2text","_tintext","_qty","_id"];
|
||||
|
||||
player removeAction s_player_boil;
|
||||
s_player_boil = -1;
|
||||
|
||||
_hasbottleitem = "ItemWaterbottle" in magazines player;
|
||||
_hastinitem = ("TrashTinCan" in magazines player) or ("ItemSodaEmpty" in magazines player);
|
||||
|
||||
_bottletext = getText (configFile >> "CfgMagazines" >> "ItemWaterbottle" >> "displayName");
|
||||
_tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName");
|
||||
_tin2text = getText (configFile >> "CfgMagazines" >> "ItemSodaEmpty" >> "displayName");
|
||||
_tintext = format["%1 / %2",_tin1text,_tin2text];
|
||||
if (!_hasbottleitem) exitWith {cutText [format[(localize "str_player_31"),_bottletext,"fill"] , "PLAIN DOWN"]};
|
||||
if (!_hastinitem) exitWith {cutText [format[(localize "str_player_31"),_tintext,"fill"] , "PLAIN DOWN"]};
|
||||
|
||||
if (_hasbottleitem and _hastinitem) then {
|
||||
_qty = {_x == "ItemWaterbottle"} count magazines player;
|
||||
if ("ItemWaterbottle" in magazines player) then {
|
||||
player playActionNow "Medic";
|
||||
[player,"fillwater",0,false] call dayz_zombieSpeak;
|
||||
_id = [player,10,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep _qty;
|
||||
for "_x" from 1 to _qty do {
|
||||
player removeMagazine "ItemWaterbottle";
|
||||
player addMagazine "ItemWaterbottleBoiled";
|
||||
|
||||
};
|
||||
cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [(localize "str_player_02") , "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user