mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Adding combine matches
This commit is contained in:
@@ -29,6 +29,10 @@ class ItemMatchbox : ItemMatchbox_base
|
|||||||
script = "spawn player_makeFire;"; //Do not use player_build because we have no ghost preview model for Land_Fire_DZ yet
|
script = "spawn player_makeFire;"; //Do not use player_build because we have no ghost preview model for Land_Fire_DZ yet
|
||||||
use[] = {"PartWoodPile"};
|
use[] = {"PartWoodPile"};
|
||||||
};
|
};
|
||||||
|
class Combine {
|
||||||
|
text = $STR_ANTIBIOTICS_COMBINE;
|
||||||
|
script = "spawn player_combineMatches;";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
|
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||||
|
dayz_actionInProgress = true;
|
||||||
|
|
||||||
private ["_total", "_full", "_remain", "_amount"];
|
private ["_total", "_full", "_remain", "_amount"];
|
||||||
|
|
||||||
_total = 0;
|
_total = 0;
|
||||||
{
|
{
|
||||||
if(configName inheritsFrom (configfile >> "CfgMagazines" >> _x) == "ItemAntibiotic") then {
|
if (configName inheritsFrom (configfile >> "CfgMagazines" >> _x) == "ItemAntibiotic") then {
|
||||||
_amount = getNumber(configFile >> "CfgMagazines" >> _x >> "medical" >> "amount");
|
_amount = getNumber(configFile >> "CfgMagazines" >> _x >> "medical" >> "amount");
|
||||||
if(_amount > 0) then {
|
if(_amount > 0) then {
|
||||||
_total = _total + _amount;
|
_total = _total + _amount;
|
||||||
@@ -9,8 +13,10 @@ _total = 0;
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
} count (magazines player);
|
} count (magazines player);
|
||||||
|
|
||||||
_full = floor(_total / 6);
|
_full = floor(_total / 6);
|
||||||
_remain = _total % 6;
|
_remain = _total % 6;
|
||||||
|
|
||||||
for "_i" from 1 to _full do
|
for "_i" from 1 to _full do
|
||||||
{
|
{
|
||||||
player addMagazine "ItemAntibiotic6";
|
player addMagazine "ItemAntibiotic6";
|
||||||
@@ -19,3 +25,5 @@ for "_i" from 1 to _full do
|
|||||||
if(_remain > 0 ) then {
|
if(_remain > 0 ) then {
|
||||||
player addMagazine "ItemAntibiotic" + str(_remain);
|
player addMagazine "ItemAntibiotic" + str(_remain);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dayz_actionInProgress = false;
|
||||||
|
|||||||
33
SQF/dayz_code/actions/player_combineMatches.sqf
Normal file
33
SQF/dayz_code/actions/player_combineMatches.sqf
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||||
|
dayz_actionInProgress = true;
|
||||||
|
|
||||||
|
private ["_total", "_full", "_remain", "_amount"];
|
||||||
|
|
||||||
|
_total = 0;
|
||||||
|
{
|
||||||
|
if (configName inheritsFrom (configfile >> "CfgWeapons" >> _x) == "ItemMatchbox") then {
|
||||||
|
_amount = getNumber(configFile >> "CfgWeapons" >> _x >> "matches");
|
||||||
|
if(_amount > 0) then {
|
||||||
|
_total = _total + _amount;
|
||||||
|
player removeWeapon _x;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} count (weapons player);
|
||||||
|
|
||||||
|
_full = floor(_total / 5);
|
||||||
|
_remain = _total % 5;
|
||||||
|
|
||||||
|
for "_i" from 1 to _full do
|
||||||
|
{
|
||||||
|
if ("Item5Matchbox" in weapons player) then {
|
||||||
|
"Item5Matchbox" call player_addDuplicateTool;
|
||||||
|
} else {
|
||||||
|
player addWeapon "Item5Matchbox";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
if(_remain > 0 ) then {
|
||||||
|
player addWeapon "Item"+ str(_remain)+"Matchbox";
|
||||||
|
};
|
||||||
|
|
||||||
|
dayz_actionInProgress = false;
|
||||||
@@ -109,6 +109,7 @@ if (!isDedicated) then {
|
|||||||
//player_sleep = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
|
//player_sleep = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
|
||||||
player_combineMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineMags.sqf";
|
player_combineMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineMags.sqf";
|
||||||
player_combineAntibiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineAntibiotics.sqf";
|
player_combineAntibiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineAntibiotics.sqf";
|
||||||
|
player_combineMatches = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineMatches.sqf";
|
||||||
player_createquiver = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_createQuiver.sqf";
|
player_createquiver = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_createQuiver.sqf";
|
||||||
player_fillquiver = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_fillQuiver.sqf";
|
player_fillquiver = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_fillQuiver.sqf";
|
||||||
//player_takearrow = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_takeArrow.sqf";
|
//player_takearrow = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_takeArrow.sqf";
|
||||||
|
|||||||
Reference in New Issue
Block a user