Add waiting message for player_upgradeVehicle

This commit is contained in:
A Man
2020-05-13 12:08:29 +02:00
parent 359ce2df75
commit 970fa0edba
2 changed files with 26 additions and 26 deletions

View File

@@ -2,11 +2,11 @@
DayZ Epoch Vehicle Upgrades
Made for DayZ Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_objectID","_objectUID","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep"];
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_PLAYER_52" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_objectID","_objectUID","_location","_dir","_objectCharacterID","_classname","_newclassname","_upgrade","_vehicle","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle","_finished","_temp_removed_array_mag","_temp_removed_array_wep","_notNearestPlayer","_requirementsWeapon","_requirementsMagazine"];
// This is used to find correct upgrade based what upgrades was called allows multiple upgrades per vehicle.
_upgrade = _this;
@@ -16,7 +16,7 @@ if (vehicle player != player) exitWith {dayz_actionInProgress = false; localize
_findNearestVehicles = player nearEntities [["LandVehicle"],10];
_findNearestVehicle = [];
{
if (alive _x && (count (crew _x)) == 0) exitWith {
if (alive _x && {(count (crew _x)) == 0}) exitWith {
_findNearestVehicle set [(count _findNearestVehicle),_x];
};
} count _findNearestVehicles;
@@ -28,14 +28,14 @@ if (_IsNearVehicle >= 1) then {
_notNearestPlayer = _vehicle call dze_isnearest_player;
if (!isNull _vehicle && local _vehicle && !_notNearestPlayer) then {
if (!isNull _vehicle && {local _vehicle} && {!_notNearestPlayer}) then {
_classname = typeOf _vehicle;
// lookup vehicle and find if any upgrades are available
_upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade);
if (!isNil "_upgrade" && (count _upgrade) > 0) then {
if (!isNil "_upgrade" && {(count _upgrade) > 0}) then {
_newclassname = _upgrade select 0;
_requirementsWeapon = _upgrade select 1;
@@ -50,13 +50,13 @@ if (_IsNearVehicle >= 1) then {
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} forEach _requirementsMagazine;
} count _requirementsMagazine;
{
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player;
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} forEach _requirementsWeapon;
} count _requirementsWeapon;
if (_proceed) then {
[player,20,true,(getPosATL player)] spawn player_alertZombies;
@@ -76,7 +76,7 @@ if (_IsNearVehicle >= 1) then {
_tobe_removed_total = _tobe_removed_total + _countIn;
{
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
if( (_removed < _countIn) && {(_x == _itemIn) || {configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn}}) then {
_num_removed = ([player,_x] call BIS_fnc_invRemove);
_removed = _removed + _num_removed;
_removed_total = _removed_total + _num_removed;
@@ -84,7 +84,7 @@ if (_IsNearVehicle >= 1) then {
_temp_removed_array_mag set [count _temp_removed_array_mag,_x];
};
};
} forEach magazines player;
} count magazines player;
} forEach _requirementsMagazine;
{
@@ -95,7 +95,7 @@ if (_IsNearVehicle >= 1) then {
_tobe_removed_total = _tobe_removed_total + _countIn;
{
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn)) then {
if( (_removed < _countIn) && {(_x == _itemIn) || {configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn}}) then {
_num_removed = ([player,_x] call BIS_fnc_invRemove);
_removed = _removed + _num_removed;
_removed_total = _removed_total + _num_removed;
@@ -103,7 +103,7 @@ if (_IsNearVehicle >= 1) then {
_temp_removed_array_wep set [count _temp_removed_array_wep,_x];
};
};
} forEach weapons player;
} count weapons player;
} forEach _requirementsWeapon;
// all parts removed proceed
@@ -112,7 +112,7 @@ if (_IsNearVehicle >= 1) then {
_objectID = _vehicle getVariable ["ObjectID","0"];
_objectUID = _vehicle getVariable ["ObjectUID","0"];
if(_objectID == "0" && _objectUID == "0") then {
if(_objectID == "0" && {_objectUID == "0"}) then {
localize "str_epoch_player_50" call dayz_rollingMessages;
}
else {
@@ -124,7 +124,7 @@ if (_IsNearVehicle >= 1) then {
// Current charID
_objectCharacterID = _vehicle getVariable ["CharacterID","0"];
localize "STR_EPOCH_VEHUP_IN_PROGRESS" call dayz_rollingMessages;
[_newclassname,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,true,_objectCharacterID,player,dayz_authKey];

View File

@@ -19281,7 +19281,11 @@
<German>Installationsanleitung für die Fahrzeugbewaffnung.</German>
<Russian>Руководство по установке оружия.</Russian>
<Czech>Návod na instalaci zbraně na vozidlo.</Czech>
</Key>
</Key>,
<Key ID="STR_EPOCH_VEHUP_IN_PROGRESS">
<English>Vehicle Upgrade in progress, please wait...</English>
<German>Fahrzeug-Upgrade im Gange, bitte warte...</German>
</Key>
<Key ID="STR_EPOCH_VEHUP_SUCCESS">
<English>Vehicle Upgrade Successful.</English>
<German>Fahrzeug-Upgrade abgeschlossen.</German>
@@ -23955,9 +23959,9 @@
<Russian>Вы снова присоединились к группе %1.</Russian>
</Key>
<Key ID="STR_EPOCH_INVITE_NEW">
<English>New group invite - Press F5 to view</English>
<German>Neue Gruppeneinladung - Drücke F5 um sie dir anzusehen</German>
<Russian>Приглашение от другой группы, нажмите F5 чтобы посмотреть</Russian>
<English>New group invite from %1 - Press F5 to view</English>
<German>Neue Gruppeneinladung von %1 - Drücke F5 um sie dir anzusehen</German>
<Russian>Групповое приглашение от %1, нажмите F5 чтобы посмотреть</Russian>
</Key>
<Key ID="STR_EPOCH_INVITE_PENDING">
<English>This player already has a pending invite.</English>
@@ -25079,18 +25083,10 @@
<English>A small stash on the ground to store some items.</English>
<German>Ein kleines Versteck in der Erde, um Gegenstände zu verstauen.</German>
</Key>
<Key ID="STR_VEH_NAME_STASH_MEDIUM_DESC">
<English>A medium stash on the ground to store some items.</English>
<German>Ein mittelgroßes Versteck in der Erde, um Gegenstände zu verstauen.</German>
</Key>
<Key ID="STR_EPOCH_CRAFT_SMALL_STASH">
<English>Craft Small Stash</English>
<German>Kleine Lagergrube herstellen</German>
</Key>
<Key ID="STR_EPOCH_CRAFT_MEDIUM_STASH">
<English>Craft Medium Stash</English>
<German>Mittlere Lagergrube herstellen</German>
</Key>
<Key ID="STR_EQUIP_SOLDER">
<English>Portable Solder</English>
<German>Tragbarer Lötkolben</German>
@@ -25408,7 +25404,11 @@
<English>Needed items:</English>
<German>Benötigte Gegenstände:</German>
</Key>
<Key ID="STR_CRAFTING_NEEDED_TOOLS_SHOVEL_ETOOL">
<English>%1 or %2</English>
<German>%1 oder %2</German>
</Key>
<!--Fix for missing strings from the buildings3.pbo, this is just a placeholder-->
<Key ID="STR_FAL_Street_Sign">
<English>Street Sign</English>