Localize remaining player_build text

Also added config variables for MaxMove and MaxHeight distance when
building.

_reason was defined twice at the top of player_build.sqf.
This commit is contained in:
ebaydayz
2016-05-19 16:15:27 -04:00
parent cbca23ddce
commit a54e58c60c
4 changed files with 97 additions and 37 deletions

View File

@@ -59,7 +59,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> DZE_buildItem >> "ItemActi
_isNear = {inflamed _x} count (_pos nearObjects _distance);
if(_isNear == 0) then {
_abort = true;
_reason = "fire";
_reason = localize "STR_EPOCH_FIRE";
};
};
case "workshop":
@@ -68,7 +68,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> DZE_buildItem >> "ItemActi
_isNear = count (nearestObjects [_pos, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
if(_isNear == 0) then {
_abort = true;
_reason = "workshop";
_reason = localize "STR_BLD_name_ItemWorkshop";
};
};
case "fueltank":
@@ -77,7 +77,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> DZE_buildItem >> "ItemActi
_isNear = count (nearestObjects [_pos, dayz_fuelsources, _distance]);
if(_isNear == 0) then {
_abort = true;
_reason = "fuel tank";
_reason = localize "STR_EPOCH_VEHUP_TNK";
};
};
};
@@ -294,30 +294,30 @@ if (_canBuild select 0) then {
deleteVehicle _objectHelper;
};
if(_location1 distance _location2 > 10) exitWith {
if(_location1 distance _location2 > DZE_buildMaxMoveDistance) exitWith {
_isOk = false;
_cancel = true;
_reason = "You've moved too far away from where you started building (within 10 meters)";
_reason = format[localize "STR_EPOCH_BUILD_FAIL_MOVED",DZE_buildMaxMoveDistance];
detach _object;
deleteVehicle _object;
detach _objectHelper;
deleteVehicle _objectHelper;
};
if(_location1 distance _objectHelperPos > 10) exitWith {
if(_location1 distance _objectHelperPos > DZE_buildMaxMoveDistance) exitWith {
_isOk = false;
_cancel = true;
_reason = "Object is placed too far away from where you started building (within 10 meters)";
_reason = format[localize "STR_EPOCH_BUILD_FAIL_TOO_FAR",DZE_buildMaxMoveDistance];
detach _object;
deleteVehicle _object;
detach _objectHelper;
deleteVehicle _objectHelper;
};
if(abs(_objHDiff) > 10) exitWith {
if(abs(_objHDiff) > DZE_buildMaxHeightDistance) exitWith {
_isOk = false;
_cancel = true;
_reason = "Cannot move up or down more than 10 meters";
_reason = format[localize "STR_EPOCH_BUILD_FAIL_HEIGHT",DZE_buildMaxHeightDistance];
detach _object;
deleteVehicle _object;
detach _objectHelper;
@@ -327,7 +327,7 @@ if (_canBuild select 0) then {
if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {
_isOk = false;
_cancel = true;
_reason = (localize "str_epoch_player_43");
_reason = localize "str_epoch_player_43";
detach _object;
deleteVehicle _object;
detach _objectHelper;
@@ -337,7 +337,7 @@ if (_canBuild select 0) then {
if (DZE_cancelBuilding) exitWith {
_isOk = false;
_cancel = true;
_reason = "Cancelled building.";
_reason = localize "STR_EPOCH_PLAYER_46";
detach _object;
deleteVehicle _object;
detach _objectHelper;
@@ -352,11 +352,11 @@ if (_canBuild select 0) then {
//No building on roads unless toggled
if (!DZE_BuildOnRoads) then {
if (isOnRoad _position) then { _cancel = true; _reason = "Cannot build on a road."; };
if (isOnRoad _position) then { _cancel = true; _reason = localize "STR_EPOCH_BUILD_FAIL_ROAD"; };
};
// No building in trader zones
if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
if(!canbuild) then { _cancel = true; _reason = format[localize "STR_EPOCH_PLAYER_136",localize "STR_EPOCH_TRADER"]; };
if(!_cancel) then {
@@ -490,13 +490,13 @@ if (_canBuild select 0) then {
_combination = format["%1%2%3",_combination_1,_combination_2,_combination_3];
dayz_combination = _combination;
if (_combination_1 == 100) then {
_combination_1_Display = "Red";
_combination_1_Display = localize "STR_EPOCH_RED";
};
if (_combination_1 == 101) then {
_combination_1_Display = "Green";
_combination_1_Display = localize "STR_EPOCH_GREEN";
};
if (_combination_1 == 102) then {
_combination_1_Display = "Blue";
_combination_1_Display = localize "STR_EPOCH_BLUE";
};
_combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3];
};

View File

@@ -4,16 +4,15 @@ if (!isNil "_this" && {typeName _this == "ARRAY"} && {count _this > 0}) exitWith
DayZ Base Building
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_pos","_dir","_classname","_item","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_tmpbuilt","_onLadder","_isWater","_require","_text","_offset","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_distance","_classnametmp","_ghost","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_abort","_isNear","_needNear","_vehicle","_inVehicle","_objHDiff","_isAllowedUnderGround","_playerUID","_canBuild"];
private ["_location","_pos","_dir","_classname","_item","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_tmpbuilt","_onLadder","_require","_text","_offset","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_distance","_classnametmp","_ghost","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_abort","_isNear","_needNear","_vehicle","_inVehicle","_objHDiff","_isAllowedUnderGround","_playerUID","_canBuild"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_40" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
_pos = [player] call FNC_GetPos;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = dayz_isSwimming;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_cancel = false;
_reason = "";
_canBuildOnPlot = false;
_playerUID = [player] call FNC_GetPlayerUID;
@@ -38,7 +37,7 @@ DZE_cancelBuilding = false;
call gear_ui_init;
closeDialog 1;
if (_isWater) exitWith {DZE_ActionInProgress = false; localize "str_player_26" call dayz_rollingMessages;};
if (dayz_isSwimming) exitWith {DZE_ActionInProgress = false; localize "str_player_26" call dayz_rollingMessages;};
if (_inVehicle) exitWith {DZE_ActionInProgress = false; localize "str_epoch_player_42" call dayz_rollingMessages;};
if (_onLadder) exitWith {DZE_ActionInProgress = false; localize "str_player_21" call dayz_rollingMessages;};
if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {DZE_ActionInProgress = false; localize "str_epoch_player_43" call dayz_rollingMessages;};
@@ -49,7 +48,7 @@ _item = _this;
_abort = false;
_reason = "";
_needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "neednearby");
_needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "neednearby");
{
switch(_x) do{
@@ -59,7 +58,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
_isNear = {inflamed _x} count (_pos nearObjects _distance);
if(_isNear == 0) then {
_abort = true;
_reason = "fire";
_reason = localize "STR_EPOCH_FIRE";
};
};
case "workshop":
@@ -68,7 +67,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
_isNear = count (nearestObjects [_pos, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
if(_isNear == 0) then {
_abort = true;
_reason = "workshop";
_reason = localize "STR_BLD_name_ItemWorkshop";
};
};
case "fueltank":
@@ -77,7 +76,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
_isNear = count (nearestObjects [_pos, dayz_fuelsources, _distance]);
if(_isNear == 0) then {
_abort = true;
_reason = "fuel tank";
_reason = localize "STR_EPOCH_VEHUP_TNK";
};
};
};
@@ -245,18 +244,18 @@ if (_canBuild select 0) then {
deleteVehicle _object;
};
if(_location1 distance _location2 > 5) exitWith {
if(_location1 distance _location2 > DZE_buildMaxMoveDistance) exitWith {
_isOk = false;
_cancel = true;
_reason = "You've moved too far away from where you started building (within 5 meters)";
_reason = format[localize "STR_EPOCH_BUILD_FAIL_MOVED",DZE_buildMaxMoveDistance];
detach _object;
deleteVehicle _object;
};
if(abs(_objHDiff) > 5) exitWith {
if(abs(_objHDiff) > DZE_buildMaxHeightDistance) exitWith {
_isOk = false;
_cancel = true;
_reason = "Cannot move up or down more than 5 meters";
_reason = format[localize "STR_EPOCH_BUILD_FAIL_HEIGHT",DZE_buildMaxHeightDistance];
detach _object;
deleteVehicle _object;
};
@@ -264,7 +263,7 @@ if (_canBuild select 0) then {
if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {
_isOk = false;
_cancel = true;
_reason = (localize "str_epoch_player_43");
_reason = localize "str_epoch_player_43";
detach _object;
deleteVehicle _object;
};
@@ -272,7 +271,7 @@ if (_canBuild select 0) then {
if (DZE_cancelBuilding) exitWith {
_isOk = false;
_cancel = true;
_reason = "Cancelled building.";
_reason = localize "STR_EPOCH_PLAYER_46";
detach _object;
deleteVehicle _object;
};
@@ -280,11 +279,11 @@ if (_canBuild select 0) then {
//No building on roads unless toggled
if (!DZE_BuildOnRoads) then {
if (isOnRoad _position) then { _cancel = true; _reason = "Cannot build on a road."; };
if (isOnRoad _position) then { _cancel = true; _reason = localize "STR_EPOCH_BUILD_FAIL_ROAD"; };
};
// No building in trader zones
if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
if(!canbuild) then { _cancel = true; _reason = format[localize "STR_EPOCH_PLAYER_136",localize "STR_EPOCH_TRADER"]; };
if(!_cancel) then {
@@ -402,13 +401,13 @@ if (_canBuild select 0) then {
_combination = format["%1%2%3",_combination_1,_combination_2,_combination_3];
dayz_combination = _combination;
if (_combination_1 == 100) then {
_combination_1_Display = "Red";
_combination_1_Display = localize "STR_EPOCH_RED";
};
if (_combination_1 == 101) then {
_combination_1_Display = "Green";
_combination_1_Display = localize "STR_EPOCH_GREEN";
};
if (_combination_1 == 102) then {
_combination_1_Display = "Blue";
_combination_1_Display = localize "STR_EPOCH_BLUE";
};
_combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3];
};

View File

@@ -45,8 +45,10 @@ MaxAmmoBoxes = 3; // Max number of random Supply_Crate_DZE to spawn around the m
MaxMineVeins = 50; // Max number of random mine veins to spawn around the map
timezoneswitch = 0; // Changes murderMenu times with this offset in hours.
DZE_SafeZonePosArray = []; //Prevent players in safeZones from being killed if their vehicle is destroyed. Format is [[[3D POS] RADIUS],[[3D POS] RADIUS]]; Ex. DZE_SafeZonePosArray = [[[6325.6772,7807.7412,0],150],[[4063.4226,11664.19,0],150]];
DZE_GemOccurance = [["ItemTopaz",10], ["ItemObsidian",8], ["ItemSapphire",6], ["ItemAmethyst",4], ["ItemEmerald",3], ["ItemCitrine",2], ["ItemRuby",1]];; //Sets how rare each gem in the order shown when mining (whole numbers only)
DZE_GemOccurance = [["ItemTopaz",10], ["ItemObsidian",8], ["ItemSapphire",6], ["ItemAmethyst",4], ["ItemEmerald",3], ["ItemCitrine",2], ["ItemRuby",1]]; //Sets how rare each gem is in the order shown when mining (whole numbers only)
DZE_GodModeBaseExclude = []; //Array of object class names excluded from the god mode bases feature
DZE_buildMaxMoveDistance = 10; // Max distance player can walk from start position when building. Anything >= the differnce between DZE_PlotPole values is not recommended (allows walking into other plots).
DZE_buildMaxHeightDistance = 10; // Max distance player can raise or lower object from start position when building.
/****** Advanced Trading Variables ***********/
DZE_advancedTrading = true; //Use advanced trading system. WARNING: set to false if you use database traders, you should use config-traders anyway!

View File

@@ -17413,11 +17413,70 @@
<French>Dôme</French>
<Czech>Kupole</Czech>
</Key>
<Key ID="STR_EPOCH_FIRE">
<English>Fire (Lit)</English>
<French>Feu (allumé)</French>
<Spanish>Fuego (encendido)</Spanish>
<Italian>Fuoco (acceso)</Italian>
<Hungarian>Tűz (égő)</Hungarian>
<Polish>Ogień</Polish>
<Russian>Огонь (подожженный)</Russian>
<German>Feuer (angezündet)</German>
<Czech>Ohniště (hořící)</Czech>
</Key>
<Key ID="STR_EPOCH_RED">
<English>Red</English>
<French>Rouge</French>
<Spanish>Rojo</Spanish>
<Italian>Rosso</Italian>
<Hungarian>Piros</Hungarian>
<Polish>Czerwony</Polish>
<Russian>Красный</Russian>
<German>Rot</German>
<Czech>Červená</Czech>
<Japanese>赤色</Japanese>
</Key>
<Key ID="STR_EPOCH_GREEN">
<English>Green</English>
<French>Vert</French>
<Spanish>Verde</Spanish>
<Italian>Verde</Italian>
<Hungarian>Zöld</Hungarian>
<Polish>Zielony</Polish>
<Russian>Зеленый</Russian>
<German>Grün</German>
<Czech>Zelená</Czech>
<Japanese>緑色</Japanese>
</Key>
<Key ID="STR_EPOCH_BLUE">
<English>Blue</English>
<French>Bleu</French>
<Spanish>Azul</Spanish>
<Italian>Blu</Italian>
<Hungarian>Kék</Hungarian>
<Polish>Niebieski</Polish>
<Russian>Синий</Russian>
<German>Blau</German>
<Czech>Modrá</Czech>
<Japanese>青色</Japanese>
</Key>
<Key ID="STR_EPOCH_HUMANS_NEARBY">
<English>Humans Nearby</English>
</Key>
<Key ID="STR_EPOCH_PLOT_FRIENDS">
<English>Plot Friends</English>
</Key>
<Key ID="STR_EPOCH_BUILD_FAIL_ROAD">
<English>Cannot build on a road.</English>
</Key>
<Key ID="STR_EPOCH_BUILD_FAIL_MOVED">
<English>You've moved too far away from where you started building (within %1 meters).</English>
</Key>
<Key ID="STR_EPOCH_BUILD_FAIL_HEIGHT">
<English>Cannot move up or down more than %1 meters</English>
</Key>
<Key ID="STR_EPOCH_BUILD_FAIL_TOO_FAR">
<English>Object is placed too far away from where you started building (within %1 meters)</English>
</Key>
</Package>
</Project>