player_wearclothes changes, string changes and maintain area moving (#1783)

* player_wearclothes changes, string changes and maintain area moving

Adds 2 toggles for admins to modify:

DZE_backpackRemove forces the player to drop his/her backpack when they
change gear.
DZE_maintainCurrencyRate modifies the amount of worth each item is worth
to maintain.

Changes the error message in player_wearClothes to tell the player why
they can't change gear yet
Remove some debug lines that spam RPT

* Rework

Rework as per @ebaydayz

* Rework

Rework
This commit is contained in:
oiad
2016-10-31 07:11:54 +13:00
committed by ebaydayz
parent abb0475d28
commit b1171c5f9b
11 changed files with 46 additions and 25 deletions

View File

@@ -25,7 +25,7 @@ class RscHTML;
class RscDisplayEmpty;
#include "CfgPlayerStats\defines.hpp"
#include "CfgPlayerStats\p__cover.hpp"
#include "CfgPlayerStats\p_cover.hpp"
#include "CfgPlayerStats\p_journal_humanity.hpp"
#include "CfgPlayerStats\p_humanity_art.hpp"
#include "CfgPlayerStats\p_zombies_killed.hpp"

View File

@@ -1,3 +1,22 @@
/*
Examples for config variable DZE_maintainCurrencyRate:
Now that we have gem based currency, maintaining is priced via a "worth".
If you want the price per item to be 1 gold, DZE_maintainCurrencyRate needs to be 100.
600 items * 100 would be worth 6 briefcases or 60k coins on a single currency server.
600 items * 150 would be worth 9 briefcases or 90k coins on a single currency server.
1 10oz silver = 10 worth
1 gold = 100 worth
1 10oz gold = 1,000 worth
1 briefcase = 10,000 worth
Please see configVariables.sqf for the value of gems (DZE_GemWorthArray) and their relevant worth.
*/
private ["_objectID","_objectUID","_target","_objects","_requirements","_count","_objects_filtered","_ctrl","_itemText","_type","_amount","_success","_wealth","_message1","_message2","_option"];
disableSerialization;
@@ -22,7 +41,7 @@ _req = {
private ["_count","_amount","_itemText"];
_count = _this;
_amount = _count * 100;
_amount = _count * DZE_maintainCurrencyRate;
_itemText = if (Z_SingleCurrency) then { CurrencyName } else { _amount call z_calcDefaultCurrencyNoImg };
[_amount,_itemText]

View File

@@ -45,7 +45,7 @@ if (_classname isKindOf "Bag_Base_EP1") exitWith {
_PlayerNear = {isPlayer _x} count ((getPosATL _holder) nearEntities ["CAManBase", 10]) > 1;
if (_PlayerNear) exitWith {localize "str_pickup_limit_4" call dayz_rollingMessages;};
diag_log("Picked up a bag: " + _classname);
//diag_log("Picked up a bag: " + _classname);
_hasBag = unitBackpack player;
@@ -88,4 +88,4 @@ _wpn = primaryWeapon player;
_ismelee = (getNumber (configFile >> "CfgWeapons" >> _wpn >> "melee") == 1);
if (_ismelee) then {
call dayz_meleeMagazineCheck;
};
};

View File

@@ -1,4 +1,4 @@
if (dayz_lastClothesChange + 5 > diag_tickTime) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
if (dayz_lastClothesChange + 5 > diag_tickTime) exitWith {format [localize "str_player_clotheslimit",dayz_lastClothesChange + 5 - diag_tickTime] call dayz_rollingMessages;};
dayz_lastClothesChange = diag_tickTime;
if (_this in DZE_RestrictSkins) exitWith { format[localize "str_epoch_player_315",_this] call dayz_rollingMessages; };

View File

@@ -672,9 +672,9 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
};
} else {
if (s_player_maintain_area < 0) then {
s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf", "maintain", 5, false];
s_player_maintain_area_force = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_FORCE_MAINTAREA"], "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf", "force", 5, false];
s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf", "preview", 5, false];
s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
s_player_maintain_area_force = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_FORCE_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "force", 5, false];
s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
};
};
if (s_player_plot_boundary < 0 && (_allowed or (_hasAccess select 1))) then {

View File

@@ -10,7 +10,7 @@ if (_selection != "") then {
_unit setVariable [_strH,(_dam + _damage)];
if (_selection in USEC_MinorWounds) then {
_unit setHit[_selection,(_dam + _damage)];
diag_log(format["%1: %2 setHit %3 %4", __FILE__, _unit, _selection, (_dam + _damage)]);
//diag_log(format["%1: %2 setHit %3 %4", __FILE__, _unit, _selection, (_dam + _damage)]);
};
};
_damage
_damage

View File

@@ -178,11 +178,11 @@ if (!isNil "_newBackpackType" && {_newBackpackType != ""}) then {
if (gear_done) then {disableUserInput false;disableUserInput false;disableUserInput false;disableUserInput false;};
//Debug Message
diag_log "Swichtable Unit Created. Equipment:";
diag_log format["Weapons: %1",weapons _newUnit];
diag_log format["Magazines: %1",magazines _newUnit];
diag_log format["Backpack weapons: %1",getWeaponCargo unitBackpack _newUnit];
diag_log format["Backpack magazines: %1",getMagazineCargo unitBackpack _newUnit];
//diag_log "Swichtable Unit Created. Equipment:";
//diag_log format["Weapons: %1",weapons _newUnit];
//diag_log format["Magazines: %1",magazines _newUnit];
//diag_log format["Backpack weapons: %1",getWeaponCargo unitBackpack _newUnit];
//diag_log format["Backpack magazines: %1",getMagazineCargo unitBackpack _newUnit];
//Clear and delete old Unit
removeAllWeapons _oldUnit;
@@ -203,4 +203,4 @@ player setVariable ["BIS_noCoreConversations",true];
// publicVariable _playerObjName;
call dayz_meleeMagazineCheck;
{player reveal _x} count (nearestObjects [getPosATL player,["AllVehicles","WeaponHolder","Land_A_tent","BuiltItems","ModularItems","DZE_Base_Object"],75]);
{player reveal _x} count (nearestObjects [getPosATL player,["AllVehicles","WeaponHolder","Land_A_tent","BuiltItems","ModularItems","DZE_Base_Object"],75]);

View File

@@ -64,6 +64,7 @@ DZE_plotManagementMustBeClose = true; //Players must be within 10m of pole to be
DZE_PlotManagementAdmins = []; //Array of admin PlayerUIDs enclosed in quotations, UIDs in this list are able to access every pole's management menu and delete or build any buildable with a pole nearby
DZE_MaxPlotFriends = 6; //Maximum number of friends allowed on a plot pole.
DZE_PlotOwnership = true; //allows plot owner to take ownership of buildables (excluding lockable items) near a plot pole. Useful for servers that allow base capturing so the new owner can modify/delete/upgrade existing structures
DZE_maintainCurrencyRate = 100; //The currency rate of what maintaining an item will be, for instance: at 100, 10 items will have a worth of 1000 (1 10oz gold or 1k coins) see actions/maintain_area.sqf for more examples.
// Snap Build and Build Vectors
DZE_modularBuild = true; // Enable Snap Building by @raymix and Build Vectors by @strikerforce.
@@ -97,4 +98,4 @@ dayz_requireRadio = false; // Require players to have a radio on their toolbelt
Variables that are map specific or frequently changed should be included in init.sqf by default
with a corresponding if(isNil)then{}; in variables.sqf.
*/
*/

View File

@@ -197,7 +197,7 @@ if (!isDedicated) then {
PlotRemoveFriend = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\plotManagement\plotRemoveFriend.sqf";
PlotObjects = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\plotManagement\plotObjects.sqf";
PlotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf";
MaintainPlot = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf";
MaintainPlot = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\maintain_area.sqf";
DoorGetFriends = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\doorManagement\doorGetFriends.sqf";
DoorNearbyHumans = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\doorManagement\doorNearbyHumans.sqf";
DoorAddFriend = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\doorManagement\doorAddFriend.sqf";
@@ -939,4 +939,4 @@ dayz_engineSwitch = {
PVDZ_send = [_vehicle,"SetEngineState",[_vehicle,_state]];
publicVariableServer "PVDZ_send";
};
};
};

View File

@@ -6885,7 +6885,7 @@
<German>Installation abgeschlossen, bitte warten...</German>
</Key>
<Key ID="str_player_desync">
<English>Date and Time not Synced Disconnect.</English>
<English>Date and Time not Synced, Disconnect and try again.</English>
<German>Datum und Zeit sind nicht synchronisiert. Verbindung wird getrennt!</German>
<Russian>Дата и время не синхронизированы. Отключение.</Russian>
<Spanish>Fecha y Hora no sincronizada. Desconectando.</Spanish>
@@ -6940,7 +6940,7 @@
<German>Charakterdaten vom Server erhalten</German>
</Key>
<Key ID="str_login_alreadyDead">
<English>Player Already Dead, disconnect and try again!</English>
<English>Player is already dead, disconnect and try again!</English>
<Russian>Игрок уже мертв! Отключитесь и попробуйте снова!</Russian>
<French>Vous êtes déjà mort, essayez encore!</French>
<Czech>Hráč je mrtev, odhlašte se a zkuste znovu!</Czech>
@@ -7025,7 +7025,6 @@
<English>You have finished collecting wood.</English>
<Russian>Вы закончили рубку дров.</Russian>
<German>Du hast erfolgreich Holz gesammelt.</German>
<Spanish>You have finished collecting wood.</Spanish>
<French>Vous avez terminé de faire du bois.</French>
<Czech>Nasekali jste dřevo.</Czech>
</Key>
@@ -7131,7 +7130,6 @@
<German>%1 kann nicht auf den Rücken genommen werden.</German>
</Key>
<Key ID="str_player_31">
<!-- %1=ITEM %2=build/consumed/cook/drink/fill/pitch/place/use/wear -->
<English>%1 must be in your main inventory to %2 it.</English>
<German>%1 muss sich in deinem Inventar befinden, um es zu %2.</German>
<Russian>Чтобы %2, (%1) должен находиться в основном инвентаре.</Russian>
@@ -7297,6 +7295,9 @@
<French>Attendez la fin de l&apos;action en cours avant d&apos;en commencer une autre!</French>
<Czech>Než začnete dělat něco jiného, musíte dokončit aktuální akci.</Czech>
</Key>
<Key ID="str_player_clotheslimit">
<English>You must wait another %1 seconds before attempting to change clothes.</English>
</Key>
<Key ID="str_player_ammo_successful">
<English>You have successfully loaded %1 ammunition.</English>
<German>Du hast erfolgreich %1 Mal Munition nachgeladen.</German>
@@ -13561,14 +13562,14 @@
<Czech>Označil si cíl za přítele. Čeká se na přijetí.</Czech>
</Key>
<Key ID="STR_EPOCH_ACTIONS_9">
<English>Unable to change clothes while wearing backpack.</English>
<English>You are unable to change clothes while wearing backpack.</English>
<German>Kleider können nicht gewechselt werden, solange ein Rucksack getragen wird.</German>
<Russian>Нельзя переодеться с рюкзаком на спине.</Russian>
<French>Impossible de changer ses vêtements lorsque vous portez un sac à dos.</French>
<Czech>Nemůžete si změnit oblečení, pokud nosíte batoh.</Czech>
</Key>
<Key ID="STR_EPOCH_ACTIONS_10">
<English>Unable to change clothes while carrying a filled chainsaw.</English>
<English>You are unable to change clothes while carrying a filled chainsaw.</English>
<German>Kleider können nicht gewechselt werden, solange eine gefüllte Motorsäge in den Händen gehalten wird.</German>
<Russian>Нельзя переодеваться, держа заправленную бензопилу.</Russian>
<French>Impossible de changer ses vêtements lorsque vous avez une tronçonneuse en main.</French>