mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-22 16:10:49 +03:00
Move old files
This commit is contained in:
79
SQF/dayz_code/old/player_Constructionitem.sqf
Normal file
79
SQF/dayz_code/old/player_Constructionitem.sqf
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
Created by Alby exclusively for DayZMod.
|
||||
Please request permission to use/alter from Alby.
|
||||
*/
|
||||
|
||||
private ["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace","_overwrite","_orignalClass","_index","_entry","_avail","_selection","_item","_amount","_itemName","_freeSlots","_slotType","_i","_j"];
|
||||
disableSerialization;
|
||||
["close"] call fn_updateCraftUI;
|
||||
|
||||
_config = _this select 0;
|
||||
_overwrite = _this select 1;
|
||||
_input = getArray (_config >> "input");
|
||||
_required = getArray (_config >> "toolsRequired");
|
||||
_orignalClass = getText (_config >> "orignalclass");
|
||||
|
||||
|
||||
//diag_log (str(_this));
|
||||
|
||||
if (count _overwrite > 0) then {
|
||||
{
|
||||
_index = _x select 0;
|
||||
_entry = _x select 1;
|
||||
_input set [_index, _entry];
|
||||
}forEach _overwrite;
|
||||
};
|
||||
|
||||
//done from player inventory
|
||||
_hasInput = true;
|
||||
{
|
||||
private ["_avail"];
|
||||
_selection = _x select 1;
|
||||
_item = _x select 0;
|
||||
_amount = _x select 2;
|
||||
|
||||
switch (_selection) do {
|
||||
case "CfgWeapons":
|
||||
{
|
||||
_avail = {_x == _item} count weapons player;
|
||||
};
|
||||
case "CfgMagazines":
|
||||
{
|
||||
_avail = {_x == _item} count magazines player;
|
||||
};
|
||||
};
|
||||
|
||||
if (_avail < _amount) exitWith {
|
||||
_hasInput = false;
|
||||
_itemName = getText(configFile >> _selection >> _item >> "displayName");
|
||||
format[localize "str_crafting_missing",(_amount - _avail),_itemName] call dayz_rollingMessages;
|
||||
};
|
||||
} forEach (_input + _required);
|
||||
|
||||
if (_hasInput) then {
|
||||
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
|
||||
false call dz_fn_meleeMagazines;
|
||||
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
|
||||
{
|
||||
_item = _x select 0;
|
||||
_amount = _x select 2;
|
||||
_slotType = [_item] call BIS_fnc_invSlotType;
|
||||
for "_i" from 1 to _amount do {
|
||||
for "_j" from 1 to (count _slotType) do {
|
||||
if ((_slotType select _j) > 0) then {
|
||||
_freeSlots set[_j, ((_freeSlots select _j) + (_slotType select _j))];
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach _input;
|
||||
true call dz_fn_meleeMagazines;
|
||||
_availabeSpace = true;
|
||||
//uiSleep 1;
|
||||
|
||||
if (_availabeSpace) then {
|
||||
player playActionNow "PutDown";
|
||||
|
||||
//Hack to get craft menu to use build needs a good tidy up
|
||||
[_orignalClass,"Build","ItemActions"] spawn player_build;
|
||||
};
|
||||
};
|
||||
@@ -1,4 +1,6 @@
|
||||
//fixHatchet old file
|
||||
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
private ["_tool","_tape","_fixedItem","_config","_dName","_handle","_finished"];
|
||||
|
||||
_tool = _this;
|
||||
@@ -12,18 +14,16 @@ _tape = "equip_duct_tape";
|
||||
//Handle
|
||||
_handle = "equip_lever";
|
||||
|
||||
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
call gear_ui_init;
|
||||
closeDialog 0;
|
||||
|
||||
// Check if the player has the tape
|
||||
if ((_tape in magazines player) && (_handle in magazines player) && (_tool in items player)) then {
|
||||
[player,"bandage",0,false] call dayz_zombieSpeak;
|
||||
[player,(getPosATL player),20,"bandage"] spawn fnc_alertZombies;
|
||||
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
if (!_finished) exitWith {};
|
||||
|
||||
|
||||
// Check again to make sure player didn't drop item
|
||||
if ((_tape in magazines player) && (_handle in magazines player) && (_tool in items player)) then {
|
||||
player removeWeapon _tool;
|
||||
@@ -44,4 +44,4 @@ if ((_tape in magazines player) && (_handle in magazines player) && (_tool in it
|
||||
};
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
dayz_actionInProgress = false;
|
||||
|
||||
Reference in New Issue
Block a user