From 19960f08e2bc12c8ec344790a01adc98b23863c6 Mon Sep 17 00:00:00 2001 From: icomrade Date: Fri, 22 Jul 2016 12:23:05 -0400 Subject: [PATCH] use player_makeFire to start a fire --- .../Configs/CfgMagazines/Items/Wood.hpp | 5 ++--- SQF/dayz_code/actions/player_makefire.sqf | 16 +++++++++++++++- SQF/dayz_code/stringtable.xml | 8 ++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/SQF/dayz_code/Configs/CfgMagazines/Items/Wood.hpp b/SQF/dayz_code/Configs/CfgMagazines/Items/Wood.hpp index 6f62dbd1a..e446b5bfc 100644 --- a/SQF/dayz_code/Configs/CfgMagazines/Items/Wood.hpp +++ b/SQF/dayz_code/Configs/CfgMagazines/Items/Wood.hpp @@ -59,9 +59,8 @@ class PartWoodPile : CA_Magazine class ItemActions { class Build { text = $STR_ACTIONS_MAKEFIRE; - script = "spawn player_build;"; - require[] = {"ItemMatchbox"}; - create = "Land_Fire_DZ"; + script = "spawn player_makeFire;"; + use[] = {"PartWoodPile"}; }; class Crafting { diff --git a/SQF/dayz_code/actions/player_makefire.sqf b/SQF/dayz_code/actions/player_makefire.sqf index ac3a5e201..3114ddf00 100644 --- a/SQF/dayz_code/actions/player_makefire.sqf +++ b/SQF/dayz_code/actions/player_makefire.sqf @@ -1,4 +1,4 @@ -private ["_item","_config","_text","_booleans","_worldspace","_dir","_location","_dis","_fire","_tool","_itemPile"]; +private ["_item","_config","_exit","_text","_booleans","_worldspace","_dir","_location","_dis","_fire","_tool","_itemPile"]; _tool = _this; call gear_ui_init; @@ -8,6 +8,20 @@ _item = "ItemLog"; _itemPile = "PartWoodPile"; _config = configFile >> "CfgMagazines" >> _item; _text = getText (_config >> "displayName"); +_exit = false; + +if (_tool == "PartWoodPile") then { + switch true do { + case ("Item1Matchbox" in (weapons player)): {_tool = "Item1Matchbox";}; + case ("Item2Matchbox" in (weapons player)): {_tool = "Item2Matchbox";}; + case ("Item3Matchbox" in (weapons player)): {_tool = "Item3Matchbox";}; + case ("Item4Matchbox" in (weapons player)): {_tool = "Item4Matchbox";}; + case ("Item5Matchbox" in (weapons player)): {_tool = "Item5Matchbox";}; + case ("ItemMatchbox" in (weapons player)): {_tool = "ItemMatchbox";}; + default {_exit = true;}; + }; +}; +if (_exit) exitWith {(localize "str_fireplace_noMatches") call dayz_rollingMessages;}; // item is missing or tools are missing if (!(_item in magazines player) && !(_itemPile in magazines player)) exitWith { diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index 919e60151..33b5f2a52 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -6835,6 +6835,14 @@ Le feu de camp a été retiré. Ohniště bylo odstraněno. + + You need a matchbox to build a fireplace + You need a matchbox to build a fireplace + You need a matchbox to build a fireplace + You need a matchbox to build a fireplace + You need a matchbox to build a fireplace + You need a matchbox to build a fireplace + %1 has been gutted, %2 meat steaks now on the carcass Du hast das Tier (%1) ausgenommen. Vom verbleibenden Fleisch kannst du %2 Stücke abschneiden.