mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Related to #1567, so I made this a function so it can be reused. People should call this whenever they are adding a toolbelt item which the player may already have. It has localized strings and handles spawning the weapon holder on water, land and rooftop. Tested both the sledgehammer and key copying. Confirmed all three conditions are working.
27 lines
739 B
Plaintext
27 lines
739 B
Plaintext
/*
|
|
Description:
|
|
Checks whether the player has the required tools equipped or not
|
|
and displays a message if a tool is missing from the tool belt.
|
|
|
|
Parameter(s):
|
|
_this: <array> list of tool names the player is required to have
|
|
|
|
Returns:
|
|
Boolean (true if the player has all required tools)
|
|
|
|
How to use:
|
|
_hasTools = ["ItemToolbox", "ItemCrowbar"] call player_hasTools;
|
|
*/
|
|
private ["_tools","_items","_hasTools","_missing"];
|
|
_tools = _this;
|
|
_items = items player; // weapons player
|
|
_hasTools = true;
|
|
{
|
|
if (!(_x in _items)) exitWith {
|
|
_hasTools = false;
|
|
_missing = getText (configFile >> "cfgWeapons" >> _x >> "displayName");
|
|
cutText [format[(localize "STR_EPOCH_ACTIONS_13"), _missing] , "PLAIN DOWN"];
|
|
};
|
|
} count _tools;
|
|
_hasTools
|