Files
DayZ-Epoch/SQF/dayz_code/actions/player_sharpen.sqf
A Man 915cf72df3 Adding dayz mod waterbottles
This commit adds the waterbottles from DayZ Mod. The icons were made by @DeVloek. The waterbottles are fully functional with all actions. To boil a plastic waterbottle you need an empty trash can.

Dogs could not be watered with other waterbottle than the ItemWaterbottle itself. This is fixed now. Also fix missing reset action from hide body.
2019-10-29 15:23:30 +01:00

57 lines
2.0 KiB
Plaintext

if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_item","_use","_repair","_waterUsed","_displayName"];
//['ItemKnifeBlunt','ItemKnife']
_item = _this select 0; //Item to be sharpened
_repair = _this select 1; //Item to be given back.
_use = ["ItemWaterBottle","ItemWaterBottleInfected","ItemWaterBottleSafe","ItemWaterBottleBoiled","ItemWaterBottleHerbal","ItemPlasticWaterBottle","ItemPlasticWaterBottleInfected","ItemPlasticWaterBottleSafe","ItemPlasticWaterBottleBoiled","ItemPlasticWaterBottleHerbal"];
_waterUsed = nil;
call gear_ui_init;
closeDialog 1;
{
if (_x IN magazines player) exitwith { _waterUsed = _x; };
} foreach _use;
// item is missing or tools are missing
if (isNil "_waterUsed") exitWith {
//_displayName = getText (configFile >> "CfgMagazines" >> _use >> "displayName");
localize "str_sharpen_missing_water" call dayz_rollingMessages;
dayz_actionInProgress = false;
};
// item is missing or tools are missing
if !("equip_brick" IN magazines player) exitWith {
_displayName = getText (configFile >> "CfgMagazines" >> "equip_brick" >> "displayName");
format [localize "str_missing_to_do_this",_displayName] call dayz_rollingMessages;
dayz_actionInProgress = false;
};
if (player hasWeapon _item) then {
_displayName = getText (configFile >> "CfgWeapons" >> _item >> "displayName");
player removeMagazine _waterUsed;
player removeWeapon _item;
if !(player hasWeapon _repair) then {
player addWeapon _repair;
} else {
//Drop sharpened knife if player already has one. Prevents duplicate tool.
[_repair,2,1] call fn_dropItem;
format[localize "str_actions_noroom",_repair] call dayz_rollingMessages;
};
player addMagazine (getText(configFile >> "CfgMagazines" >> _waterUsed >> "containerEmpty"));
//Remove Later
player removeMagazine "equip_brick";
format [localize "str_sharpen_success",_displayName] call dayz_rollingMessages;
};
dayz_actionInProgress = false;