Add toggleable Virtual Garage by salival

This also adds heli pads to the wholesaler if the virutal garage is activated.
This commit is contained in:
A Man
2021-08-18 23:43:21 +02:00
parent d6cebd4598
commit 30f15326c2
41 changed files with 1405 additions and 15 deletions

View File

@@ -16,4 +16,12 @@ class Category_50 {
class ItemRSJ {type = "trade_items";buy[] = {1,"ItemGoldBar10oz"};sell[] = {5,"ItemGoldBar"};};
class ItemFuelBarrelEmpty {type = "trade_items";buy[] = {1,"ItemGoldBar"};sell[] = {5,"ItemSilverBar10oz"};};
class ItemFuelBarrel {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};};
};
class Category_52 {
class helipad_civil_kit {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};};
class helipad_rescue_kit {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};};
class helipad_army_kit {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};};
class helipad_cross_kit {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};};
class helipad_parkborder_kit {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};};
};

View File

@@ -16,4 +16,12 @@ class Category_50 {
class ItemRSJ {type = "trade_items";buy[] = {1000,"worth"};sell[] = {500,"worth"};};
class ItemFuelBarrelEmpty {type = "trade_items";buy[] = {100,"worth"};sell[] = {50,"worth"};};
class ItemFuelBarrel {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};};
};
class Category_52 {
class helipad_civil_kit {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};};
class helipad_rescue_kit {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};};
class helipad_army_kit {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};};
class helipad_cross_kit {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};};
class helipad_parkborder_kit {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};};
};

View File

@@ -0,0 +1,367 @@
// Developed by [GZA] David for German Zombie Apocalypse Servers (https://zombieapo.eu/)
// Rewritten by salival (https://github.com/oiad)
class vg_RscText {
idc = -1;
x = 0;
y = 0;
h = 0.037;
w = 0.3;
type = 0;
style = 0;
shadow = 2;
colorShadow[] = {0, 0, 0, 0.5};
font = "Zeppelin32";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
text = "";
colorText[] = {1, 1, 1, 1.0};
colorBackground[] = {0, 0, 0, 0};
linespacing = 1;
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};
};
class vg_RscTitle : vg_RscText {
idc = -1;
style = 0;
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {0.95, 0.95, 0.95, 1};
};
class vg_RscShortcutButton {
idc = -1;
style = 0;
default = 0;
shadow = 2;
w = 0.183825;
h = "((((safezoneW / safezoneH) min 1.2) / 1.2) / 20)";
color[] = {1,1,1,1.0};
colorFocused[] = {1,1,1,1.0};
color2[] = {0.95,0.95,0.95,1};
colorDisabled[] = {1,1,1,0.25};
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1};
colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1};
colorBackground2[] = {1,1,1,1};
animTextureDefault = "gza\scripts\gold\gui\normal_ca.paa";
animTextureNormal = "gza\scripts\gold\gui\normal_ca.paa";
animTextureDisabled = "gza\scripts\gold\gui\normal_ca.paa";
animTextureOver = "gza\scripts\gold\gui\over_ca.paa";
animTextureFocused = "gza\scripts\gold\gui\focus_ca.paa";
animTexturePressed = "gza\scripts\gold\gui\down_ca.paa";
periodFocus = 1.2;
periodOver = 0.8;
class HitZone {
left = 0.0;
top = 0.0;
right = 0.0;
bottom = 0.0;
};
class ShortcutPos {
left = 0;
top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
w = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";
h = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
};
class TextPos {
left = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)";
top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
right = 0.005;
bottom = 0.0;
};
period = 0.4;
font = "Zeppelin32";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
text = "";
action = "";
class Attributes {
font = "Zeppelin32";
color = "#E5E5E5";
align = "left";
shadow = 1;
};
class AttributesImage {
font = "Zeppelin32";
color = "#E5E5E5";
align = "left";
};
soundPush[] = { "", 0, 1 };
soundEnter[] ={ "", 0, 1 };
soundClick[] ={ "", 0, 1 };
soundEscape[] ={ "", 0, 1 };
sound[] ={ "", 0, 1 };
};
class vg_RscButtonMenu : vg_RscShortcutButton {
idc = -1;
type = 16;
style = "0x02 + 0xC0";
default = 0;
shadow = 0;
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
colorBackground[] = {0,0,0,0.8};
colorBackgroundFocused[] = {1,1,1,1};
colorBackground2[] = {0.75,0.75,0.75,1};
color[] = {1,1,1,1};
colorFocused[] = {0,0,0,1};
color2[] = {0,0,0,1};
colorText[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.25};
period = 1.2;
periodFocus = 1.2;
periodOver = 1.2;
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};
class TextPos {
left = "0.25 * (((safezoneW / safezoneH) min 1.2) / 40)";
top = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - (((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
right = 0.005;
bottom = 0.0;
};
class Attributes {
font = "Zeppelin32";
color = "#E5E5E5";
align = "center";
shadow = 0;
};
class ShortcutPos {
left = "(6.25 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005";
top = 0.005;
w = 0.0225;
h = 0.03;
};
textureNoShortcut = "";
};
class vg_RscListBox {
style = 16;
idc = -1;
type = 5;
w = 0.275;
h = 0.04;
font = "Zeppelin32";
colorSelect[] = {0.11,0.686,0.831,1};
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0.28,0.28,0.28,0.28};
colorSelect2[] = {1, 1, 1, 1};
colorSelectBackground[] = {0.95, 0.95, 0.95, 0.5};
colorSelectBackground2[] = {1, 1, 1, 0.5};
colorScrollbar[] = {0.2, 0.2, 0.2, 1};
arrowFull = "\ca\ui\data\igui_arrow_top_active_ca.paa";
arrowEmpty = "\ca\ui\data\igui_arrow_top_ca.paa";
wholeHeight = 0.45;
rowHeight = 0.04;
color[] = {0.7, 0.7, 0.7, 1};
colorActive[] = {0,0,0,1};
colorDisabled[] = {0,0,0,0.3};
sizeEx = 0.023;
maxHistoryDelay = 1;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};
class ScrollBar {
color[] = {1, 1, 1, 0.6};
colorActive[] = {1, 1, 1, 1};
colorDisabled[] = {1, 1, 1, 0.3};
thumb = "\ca\ui\data\igui_scrollbar_thumb_ca.paa";
arrowFull = "\ca\ui\data\igui_arrow_top_active_ca.paa";
arrowEmpty = "\ca\ui\data\igui_arrow_top_ca.paa";
border = "\ca\ui\data\igui_border_scroll_ca.paa";
};
soundPush[] = { "", 0, 1 };
soundEnter[] ={ "", 0, 1 };
soundClick[] ={ "", 0, 1 };
soundEscape[] ={ "", 0, 1 };
sound[] ={ "", 0, 1 };
soundSelect[] = { "", 0, 1 };
};
class vg_RscStructuredText {
type = 13;
style = 0;
x = 0;
y = 0;
h = 0.035;
w = 0.1;
text = "";
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {1, 1, 1, 1.0};
shadow = 1;
class Attributes {
font = "Zeppelin32";
color = "#ffffff";
align = "left";
shadow = 1;
};
};
class virtualGarage {
idd = 2800;
name="virtualGarage";
onload = "player setVariable['isBusy',true,true]; [] spawn vg_maintainSetText;";
onUnload = "player setVariable['isBusy',false,true];dayz_actionInProgress = false;";
movingEnabled = 0;
enableSimulation = 1;
class controlsBackground {
class vg_RscTitleBackground : vg_RscText {
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
idc = -1;
x = 0.1;
y = 0.2;
w = 0.8;
h = (1 / 25);
};
class MainBackground : vg_RscText {
colorBackground[] = {0,0,0,0.7};
idc = -1;
x = 0.1;
y = 0.2 + (11 / 250);
w = 0.8;
h = 0.7 - (22 / 250);
};
class Title : vg_RscTitle {
idc = 2801;
text = $STR_CL_VG_VIRTUAL_GARAGE;
x = 0.1;
y = 0.2;
w = 0.8;
h = (1 / 25);
};
class VehicleInfoHeader : vg_RscText {
idc = 2830;
text = $STR_CL_VG_VEHICLE_INFO;
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
x = 0.47; y = 0.26;
w = 0.42;
h = (1 / 25);
};
class CloseBtn : vg_RscButtonMenu {
idc = -1;
text = $STR_UI_CLOSE;
onButtonClick = "closeDialog 2;";
x = -0.06 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = (6.25 / 40);
h = (1 / 25);
};
};
class controls {
class VehicleList : vg_RscListBox {
idc = 2802;
text = "";
sizeEx = 0.04;
colorBackground[] = {0.1,0.1,0.1,0.9};
onLBSelChanged = "[_this] call vehicleInfo;";
x = 0.11; y = 0.302;
w = 0.35; h = 0.49;
};
class VehicleTitleBox : vg_RscText {
idc = 2804;
text = "";
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])"};
x = 0.11; y = 0.26;
w = 0.35;
h = (1 / 25);
};
class storeVehicle : vg_RscButtonMenu {
idc = 2850;
text = $STR_CL_VG_STORE_VEHICLE;
onButtonClick = "if (!vg_hasRun) then {vg_hasRun = true;[true] spawn player_storeVehicle;};";
x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = (6.25 / 36);
h = (1 / 25);
};
class storeVehicleGear : vg_RscButtonMenu {
idc = 2851;
text = $STR_CL_VG_STORE_VEHICLE_GEAR;
onButtonClick = "if (!vg_hasRun) then {vg_hasRun = true;[false] spawn player_storeVehicle;};";
x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = (6.25 / 15.85);
h = (1 / 25);
};
class getVehicle : vg_RscButtonMenu {
idc = 2852;
text = $STR_CL_VG_GET_VEHICLE;
onButtonClick = "if (!vg_hasRun) then {vg_hasRun = true;[] spawn player_getVehicle;};";
x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = (6.25 / 20);
h = (1 / 25);
};
class removePad : vg_RscButtonMenu {
idc = 2853;
text = $STR_CL_VG_REMOVE_PAD;
onButtonClick = "call player_removePad;";
x = 0.5 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = 0.241;
h = (1 / 25);
};
class MaintainGarage : vg_RscButtonMenu {
idc = 2854;
text = $STR_CL_VG_MAINTAIN_GARAGE;
onButtonClick = "if (!vg_hasRun) then {vg_hasRun = true;[] spawn Player_MaintainVG;};";
x = -0.06 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.903;
w = 0.8;
h = (1 / 25);
};
class vehicleInfomationList : vg_RscStructuredText {
idc = 2803;
text = "";
sizeEx = 0.035;
x = 0.47; y = 0.3;
w = 0.41; h = 0.5;
};
class MainBackgroundHider : vg_RscText {
colorBackground[] = {0,0,0,1};
idc = 2810;
x = 0.1;
y = 0.2 + (11 / 250);
w = 0.8;
h = 0.7 - (22 / 250);
};
class MainHideText : vg_RscText {
idc = 2811;
text = $STR_CL_VG_SEARCH_VEHICLES;
sizeEx = 0.06;
x = 0.10;
y = 0.5;
w = 0.8;
h = (1 / 15);
};
};
};

View File

@@ -0,0 +1,42 @@
// Written by icomrade (https://github.com/icomrade)
private ["_hasAccess","_heliPad","_objectID","_objectUID","_plotCheck"];
closeDialog 0;
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= vg_maintainCost);
} else {
Z_Selling = false;
_moneyInfo = vg_maintainCost call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = true;
if (vg_maintainCost > 0) then {
_success = if (Z_SingleCurrency) then {_enoughMoney} else {[player,vg_maintainCost,_moneyInfo,false,0] call Z_payDefault};
};
if (!_success && _enoughMoney) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL";};
if (_enoughMoney || vg_maintainCost < 1) then {
if (Z_SingleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - vg_maintainCost),true];
};
localize "STR_CL_VG_MAINTAINSUCCESS" call dayz_rollingMessages;
PVDZE_maintainGarage = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[player,_ownerPUID]
} else {
[player]
};
publicVariableServer "PVDZE_maintainGarage";
} else {
localize "STR_CL_VG_MAINTAINFAIL" call dayz_rollingMessages;
};

View File

@@ -0,0 +1,69 @@
// Developed by [GZA] David for German Zombie Apocalypse Servers (https://zombieapo.eu/)
// Rewritten by salival (https://github.com/oiad)
private ["_backPack","_charID","_dir","_heliPad","_inventory","_isNearPlot","_keyID","_keyName","_location","_plotCheck","_sign","_vehicle"];
closeDialog 0;
_vehicle = (call compile format["%1",lbData[2802,(lbCurSel 2802)]]);
if (vg_removeKey && {_vehicle select 3 != 0} && {({getNumber (configFile >> "CfgWeapons" >> _x >> "type") == 131072} count (weapons player)) == 12}) exitWith {localize "str_epoch_player_107" call dayz_rollingMessages;};
_dir = round(random 360);
_backPack = [];
_plotCheck = [player,false] call FNC_find_plots;
_isNearPlot = (_plotCheck select 1) > 0;
_heliPad = nearestObjects [if (_isNearPlot) then {_plotCheck select 2} else {player},vg_heliPads,if (_isNearPlot) then {DZE_maintainRange} else {Z_VehicleDistance}];
if ((count _heliPad == 0) && ((_vehicle select 1) isKindOf "Air")) exitWith {localize "STR_CL_VG_NEED_HELIPAD" call dayz_rollingMessages;};
if (count _heliPad > 0) then {
_location = [(_heliPad select 0)] call FNC_GetPos;
} else {
_location = [(position player),0,400,10,0,2000,0] call BIS_fnc_findSafePos;
_location set [2,0];
};
_sign = "Sign_arrow_down_large_EP1" createVehicleLocal [0,0,0];
_sign setPos _location;
if (surfaceIsWater _location && {count (_location nearEntities ["Ship",8]) > 0}) then {
deleteVehicle _sign;
localize "STR_EPOCH_TRADE_OBSTRUCTED" call dayz_rollingMessages;
} else {
[_vehicle select 1,_sign] call fn_waitForObject;
};
PVDZE_spawnVehicle = [[_dir,_location],player,_vehicle select 0];
publicVariableServer "PVDZE_spawnVehicle";
waitUntil {!isNil "PVDZE_spawnVehicleResult"};
if (PVDZE_spawnVehicleResult != "0") then {
_keyID = "";
_charID = parseNumber PVDZE_spawnVehicleResult;
if ((_charID > 0) && (_charID <= 2500)) then {_keyID = format["ItemKeyGreen%1",_charID];};
if ((_charID > 2500) && (_charID <= 5000)) then {_keyID = format["ItemKeyRed%1",_charID-2500];};
if ((_charID > 5000) && (_charID <= 7500)) then {_keyID = format["ItemKeyBlue%1",_charID-5000];};
if ((_charID > 7500) && (_charID <= 10000)) then {_keyID = format["ItemKeyYellow%1",_charID-7500];};
if ((_charID > 10000) && (_charID <= 12500)) then {_keyID = format["ItemKeyBlack%1",_charID-10000];};
_keyName = getText(configFile >> "CfgWeapons" >> _keyID >> "displayName");
if (vg_removeKey) then {
_inventory = weapons player;
dayz_myBackpack = unitBackpack player;
if (!isNull dayz_myBackpack) then {_backPack = (getWeaponCargo dayz_myBackpack) select 0;};
if (_keyID in (_inventory+_backPack)) then {
if (_keyID in _inventory) then {format[localize "STR_CL_VG_IN_INVENTORY",_keyName] call dayz_rollingMessages;};
if (_keyID in _backPack) then {format[localize "STR_CL_VG_IN_BACKPACK",_keyName] call dayz_rollingMessages;};
} else {
player addWeapon _keyID;
format[localize "STR_CL_VG_ADDED_INVENTORY",_keyName] call dayz_rollingMessages;
};
};
};
PVDZE_spawnVehicle = nil;
PVDZE_spawnVehicleResult = nil;
vg_vehicleList = nil;
localize "STR_CL_VG_VEHICLE_SPAWNED" call dayz_rollingMessages;

View File

@@ -0,0 +1,24 @@
// Written by salival (https://github.com/oiad)
private ["_hasAccess","_objectID","_objectUID","_plotCheck"];
closeDialog 0;
_plotCheck = [player, false] call FNC_find_plots;
_hasAccess = [player,_plotCheck select 2] call FNC_check_access;
if ((_hasAccess select 0) or (_hasAccess select 2) or (_hasAccess select 3) or (_hasAccess select 4)) then {
{
_objectID = _x getVariable ["ObjectID","0"];
_objectUID = _x getVariable ["ObjectUID","0"];
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_x,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
deleteVehicle _x;
systemChat format[localize "STR_CL_VG_HELIPAD_REMOVED",typeOf _x];
} count (nearestObjects [_plotCheck select 2,vg_heliPads,Z_VehicleDistance]);
} else {
systemChat localize "STR_EPOCH_PLAYER_134";
};

View File

@@ -0,0 +1,209 @@
// Developed by [GZA] David for German Zombie Apocalypse Servers (https://zombieapo.eu/)
// Rewritten by salival (https://github.com/oiad)
private ["_amount","_backPackCount","_backPackGear","_cargoAmount","_charID","_control","_counter","_display","_enoughMoney","_gearCount","_hasKey","_isLimitArray","_itemText","_items","_keyName","_limit","_magazineCount","_matchedCount","_moneyInfo","_name","_overLimit","_storedVehicles","_success","_typeName","_typeOf","_vehicle","_vehicleID","_vehicleUID","_wealth","_weaponsCount","_woGear","_playerNear","_ownerPUID","_plotCheck"];
disableSerialization;
_display = findDisplay 2800;
_control = ((findDisplay 2800) displayCtrl 2802);
_vehicle = vg_vehicleList select (lbCurSel _control);
_typeOf = typeOf _vehicle;
_isLimitArray = typeName vg_limit == "ARRAY";
_overLimit = false;
_matchedCount = 0;
_storedVehicles = [];
{if (_typeOf isKindOf _x) exitWith {_overLimit = true;}} count vg_blackListed;
if (_overLimit) exitWith {localize "STR_CL_VG_BLACKLISTED" call dayz_rollingMessages;};
{
if (typeName _x == "ARRAY") then {
_storedVehicles set [count _storedVehicles,_x select 1];
};
} count vg_vehicleList;
_gearCount = {
private ["_counter"];
_counter = 0;
{_counter = _counter + _x;} count _this;
_counter
};
if (_isLimitArray) then {
{
_typeName = _x select 0;
_limit = _x select 1;
if (typeName _x == "ARRAY") then {
if (_typeOf isKindOf _typeName) then {
{
if (_x isKindOf _typeName) then {_matchedCount = _matchedCount +1};
if (_matchedCount >= _limit) then {_overLimit = true;};
} count _storedVehicles;
};
};
if (_overLimit) exitWith {};
} count vg_limit;
} else {
if (count _storedVehicles >= vg_limit) then {_overLimit = true;};
};
if (_overLimit) exitWith {
if (_isLimitArray) then {
systemChat localize "STR_CL_VG_LIMIT_ARRAY";
} else {
systemChat localize "STR_CL_VG_LIMIT_NUMBER";
};
};
vg_vehicleList = nil;
_woGear = _this select 0;
closeDialog 0;
if (!vg_storeWithGear && !_woGear) exitWith {localize "STR_CL_VG_NOSTOREWITHGEAR" call dayz_rollingMessages;};
_charID = _vehicle getVariable ["CharacterID","0"];
_vehicleID = _vehicle getVariable ["ObjectID","0"];
_vehicleUID = _vehicle getVariable ["ObjectUID","0"];
_weaponsCount = ((getWeaponCargo _vehicle) select 1) call _gearCount;
_magazineCount = ((getMagazineCargo _vehicle) select 1) call _gearCount;
_backPackCount = ((getBackpackCargo _vehicle) select 1) call _gearCount;
_cargoAmount = (_weaponsCount + _magazineCount + _backPackCount);
if (_vehicleID == "1" || _vehicleUID == "1") exitWith {localize "STR_CL_VG_STORE_MISSION" call dayz_rollingMessages;};
if (isNull DZE_myVehicle || !local DZE_myVehicle) exitWith {localize "STR_EPOCH_PLAYER_245" call dayz_rollingMessages;};
_hasKey = false;
_items = items player;
dayz_myBackpack = unitBackpack player;
if (!isNull dayz_myBackpack) then {
_backPackGear = (getWeaponCargo dayz_myBackpack) select 0;
_items = _items + _backPackGear;
};
if (_charID != "0") then {
{
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in DZE_itemKeys) then {
if (str(getNumber(configFile >> "CfgWeapons" >> _x >> "keyid")) == _charID) then {
_keyName = _x;
_hasKey = true;
};
};
} count _items;
} else {
if (vg_store_keyless_vehicles) then {
_hasKey = true;
};
};
if (vg_requireKey && {!_hasKey}) exitWith {localize "STR_CL_VG_REQUIRE_KEY" call dayz_rollingMessages;};
_name = getText(configFile >> "cfgVehicles" >> _typeOf >> "displayName");
{
if (_typeOf isKindOf (_x select 0)) exitWith {_amount = _x select 1};
} forEach vg_price;
if (_cargoAmount > 0) then {_amount = _amount + (_cargoAmount * vg_pricePer);};
if (!isNil "sk_dualCurrency") then {_amount = if (z_singleCurrency) then {_amount * 10} else {_amount};};
/*
_playerNear = {isPlayer _x && (_x != player)} count (([_vehicle] call FNC_GetPos) nearEntities ["CAManBase", 15]) > 0;
if (_playerNear) exitWith {localize "STR_CL_VG_PLAYERNEARVEHICLE" call dayz_rollingMessages;};
*/
if (count (crew _vehicle) > 0) exitWith {localize "STR_CL_VG_PLAYERINVEHICLE" call dayz_rollingMessages;};
_enoughMoney = false;
_moneyInfo = [false,[],[],[],0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= _amount);
} else {
Z_Selling = false;
if (Z_AllowTakingMoneyFromVehicle) then {false call Z_checkCloseVehicle};
_moneyInfo = _amount call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
};
_success = if (Z_SingleCurrency) then {true} else {[player,_amount,_moneyInfo,true,0] call Z_payDefault};
if (!_success && {_enoughMoney}) exitWith {systemChat localize "STR_EPOCH_TRADE_GEAR_AND_BAG_FULL"};
if (_enoughMoney) then {
_success = if (Z_SingleCurrency) then {_amount <= _wealth} else {[player,_amount,_moneyInfo,false,0] call Z_payDefault};
if (_success) then {
if (Z_SingleCurrency) then {player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth - _amount),true];};
[_vehicle,true] call local_lockUnlock;
DZE_myVehicle = objNull;
PVDZE_storeVehicle = if (vg_tiedToPole) then {
_plotCheck = [player,false] call FNC_find_plots;
_ownerPUID = if (_plotCheck select 1 > 0) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID};
[_vehicle,player,_woGear,_ownerPUID]
} else {
[_vehicle,player,_woGear]
};
publicVariableServer "PVDZE_storeVehicle";
waitUntil {!isNil "PVDZE_storeVehicleResult"};
PVDZE_storeVehicle = nil;
PVDZE_storeVehicleResult = nil;
format[localize "STR_CL_VG_VEHICLE_STORED",_name] call dayz_rollingMessages;
if (vg_removeKey && {_charID != "0"}) then {
if (_keyName in (items player)) then {
[player,_keyName,1] call BIS_fnc_invRemove;
} else {
private ["_weparray", "_qtyarray", "_arraycnt","_newwepqty","_newwep","_newarray","_cntarray","_weapon","_weaponqty"];
_weparray = [];
_qtyarray = [];
_arraycnt = -1;
_backPackGear = getWeaponCargo dayz_myBackpack;
{
_arraycnt = _arraycnt + 1;
if (_x == _keyName) then {
} else {
_newwep = (_backPackGear select 0) select _arraycnt;
_newwepqty = (_backPackGear select 1) select _arraycnt;
_weparray set [count _weparray, _newwep];
_qtyarray set [count _qtyarray,_newwepqty];
};
} forEach (_backPackGear select 0);
_newarray = [];
_newarray = [_weparray] + [_qtyarray];
clearWeaponCargoGlobal dayz_myBackpack;
_cntarray = count _weparray;
for "_i" from 0 to (_cntarray-1) do {
_weapon = (_newarray select 0) select _i;
_weaponqty = (_newarray select 1) select _i;
dayz_myBackpack addWeaponCargoGlobal [_weapon,_weaponqty];
};
};
};
} else {
systemChat localize "STR_EPOCH_TRADE_DEBUG";
};
} else {
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[_amount,true] call z_calcCurrency};
if (Z_SingleCurrency) then {
systemChat format[localize "STR_CL_VG_NEED_COINS",[_amount] call BIS_fnc_numberText,_itemText,_name];
} else {
systemChat format[localize "STR_CL_VG_NEED_BRIEFCASES",_itemText,_name];
};
};

View File

@@ -0,0 +1,110 @@
// Developed by [GZA] David for German Zombie Apocalypse Servers (https://zombieapo.eu/)
// Rewritten by salival (https://github.com/oiad)
private ["_backPackCount","_backPackSlots","_cargoAmount","_control","_counter","_DateStored","_formattedText","_index","_inventory","_localVehicle","_magazineCount","_magazineSlots","_name","_picture","_price","_typeOf","_vehicle","_weaponSlots","_weaponsCount","_MaintainDays","_DateMaintained"];
disableSerialization;
_control = (_this select 0) select 0;
_index = (_this select 0) select 1;
_localVehicle = typeName (vg_vehicleList select _index) == "OBJECT";
_DateMaintained = "";
_MaintainDays = -1;
_gearCount = {
private ["_counter"];
_counter = 0;
{_counter = _counter + _x;} count _this;
_counter;
};
if (_localVehicle) then {
_vehicle = vg_vehicleList select _index;
_typeOf = typeOf _vehicle;
_weaponsCount = ((getWeaponCargo _vehicle) select 1) call _gearCount;
_magazineCount = ((getMagazineCargo _vehicle) select 1) call _gearCount;
_backPackCount = ((getBackpackCargo _vehicle) select 1) call _gearCount;
ctrlShow[2852,false]; // getVehicle
ctrlShow[2850,true]; // storeVehicle
ctrlShow[2851,true]; // storeVehicleWithGear
} else {
_vehicle = (vg_vehicleList select _index) select 1;
_inventory = (vg_vehicleList select _index) select 2;
_DateStored = (vg_vehicleList select _index) select 4;
_DateMaintained = (vg_vehicleList select _index) select 5;
_MaintainDays = (vg_vehicleList select _index) select 6;
_typeOf = _vehicle;
_weaponsCount = _inventory select 0;
_magazineCount = _inventory select 1;
_backPackCount = _inventory select 2;
ctrlShow[2852,true]; // getVehicle
ctrlShow[2850,false]; // storeVehicle
ctrlShow[2851,false]; // storeVehicleWithGear
};
_weaponSlots = getNumber(configFile >> "CfgVehicles" >> _typeOf >> "transportMaxWeapons");
_magazineSlots = getNumber(configFile >> "CfgVehicles" >> _typeOf >> "transportMaxMagazines");
_backPackSlots = getNumber(configFile >> "CfgVehicles" >> _typeOf >> "transportmaxbackpacks");
_name = getText(configFile >> "CfgVehicles" >> _typeOf >> "displayName");
_picture = getText (configFile >> 'CfgVehicles' >> _typeOf >> 'picture');
_cargoAmount = (_weaponsCount + _magazineCount + _backPackCount);
if (_localVehicle) then {
{
if (_typeOf isKindOf (_x select 0)) exitWith {_price = _x select 1;};
} forEach vg_price;
if (_cargoAmount > 0) then {
_price = _price + (_cargoAmount * vg_pricePer);
ctrlShow[2850,false];
} else {
ctrlShow[2851,false];
};
_price = if (_price == 0) then {localize "strwffree"} else {
if (!isNil "sk_dualCurrency") then {_price = if (z_singleCurrency) then {_price * 10} else {_price};};
if (z_singleCurrency) then {
format ["%1 %2",[_price] call BIS_fnc_numberText,currencyName]
} else {
[_price,true] call z_calcCurrency
};
};
};
_formattedText = format [
"<img image='%1' size='3' align='center'/><br />" +
"<t color='#33BFFF' size='0.7'>%2: </t><t color='#ffffff' size='0.7'>%3</t><br />" +
"<t color='#33BFFF' size='0.7'>%4: </t><t color='#ffffff' size='0.7'>%5</t><br />" +
"<t color='#33BFFF' size='0.7'>%6: </t><t color='#ffffff' size='0.7'><img image='%7'/> %13/%10 <img image='%8'/> %14/%11 <img image='%9'/> %15/%12</t><br />",
_picture,
localize "STR_EPOCH_NAME",
_name,
localize "STR_EPOCH_CLASS",
_typeOf,
localize "STR_EPOCH_CARGO_SPACE",
"\z\addons\dayz_code\gui\gear\gear_ui_slots_weapons_white.paa",
"\z\addons\dayz_code\gui\gear\gear_ui_slots_items_white.paa",
"\z\addons\dayz_code\gui\gear\gear_ui_slots_backPacks_white.paa",
_weaponSlots,
_magazineSlots,
_backPackSlots,
_weaponsCount,
_magazineCount,
_backPackCount
];
if (_localVehicle) then {_formattedText = _formattedText + format ["<t color='#33BFFF' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2</t><br />",localize "STR_CL_VG_PRICE",_price];};
if (!_localVehicle) then {
if (_DateStored != "old") then {
_formattedText = _formattedText + format ["<t color='#33BFFF' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2</t><br />",localize "STR_CL_VG_STOREDATE",_DateStored];
if (_MaintainDays >= 0) then {
_formattedText = _formattedText + format ["<t color='#33BFFF' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2</t><br /><t color='#33BFFF' size='0.7'>%3: </t><t color='#ffffff' size='0.7'>%4</t><br />",localize "STR_CL_VG_MAINTAINDATE",_DateMaintained,localize "STR_CL_VG_MAINTAININTERVAL",_MaintainDays];
};
} else {
_formattedText = _formattedText + format ["<t color='#33BFFF' size='0.7'>%1: </t><t color='#ffffff' size='0.7'>%2</t><br />",localize "STR_CL_VG_STOREDATE",localize "STR_CL_VG_STOREDATE_INVALID"];
};
};
((findDisplay 2800) displayCtrl 2803) ctrlSetStructuredText parseText _formattedText;
ctrlShow [2803,true];
ctrlShow [2830,true];

View File

@@ -0,0 +1,64 @@
// Developed by [GZA] David for German Zombie Apocalypse Servers (https://zombieapo.eu/)
// Rewritten by salival (https://github.com/oiad)
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_class","_control","_displayName","_heliPad","_isNearPlot","_itemText","_localVehicles","_plotCheck","_storedVehicles","_vgDisplCtl"];
disableSerialization;
vg_hasRun = false;
createDialog "virtualGarage";
{ctrlShow [_x,false]} count [2803,2830,2850,2851,2852,2853];
_plotCheck = [player,false] call FNC_find_plots;
_isNearPlot = (_plotCheck select 1) > 0;
PVDZE_queryVehicle = if (vg_tiedToPole) then {
[player,if (_isNearPlot) then {(_plotCheck select 2) getVariable ["ownerPUID","0"]} else {dayz_playerUID}]
} else {
[player]
};
publicVariableServer "PVDZE_queryVehicle";
waitUntil {!isNil "PVDZE_queryVehicleResult"};
_storedVehicles = PVDZE_queryVehicleResult;
PVDZE_queryVehicle = nil;
PVDZE_queryVehicleResult = nil;
_localVehicles = ([player] call FNC_getPos) nearEntities [["Air","LandVehicle","Ship"],Z_VehicleDistance];
_heliPad = nearestObjects [if (_isNearPlot) then {_plotCheck select 2} else {player},vg_heliPads,if (_isNearPlot) then {DZE_maintainRange} else {Z_VehicleDistance}];
if (count _heliPad > 0 && {_isNearPlot}) then {ctrlShow[2853,true];};
_control = ((findDisplay 2800) displayCtrl 2802);
lbClear _control;
if (count _storedVehicles == 0 && {isNull DZE_myVehicle || {!(alive DZE_myVehicle)} || {!(local DZE_myVehicle)}}) exitWith {ctrlSetText[2811,localize "STR_CL_VG_NO_VEHICLES"];};
vg_vehicleList = [];
{
_displayName = getText(configFile >> "CfgVehicles" >> (_x select 1) >> "displayName");
_control lbAdd _displayName;
_control lbSetData [(lbSize _control)-1,str(_x)];
vg_vehicleList set [count vg_vehicleList,_x];
} count _storedVehicles;
{
if (!isNull DZE_myVehicle && {local DZE_myVehicle} && {alive DZE_myVehicle} && {DZE_myVehicle == _x}) then {
_class = typeOf _x;
_displayName = getText(configFile >> "CfgVehicles" >> _class >> "displayName");
_control lbAdd _displayName;
_control lbSetData [(lbSize _control)-1,_class];
_control lbSetColor [(lbSize _control)-1,[0, 1, 0, 1]];
vg_vehicleList set [count vg_vehicleList,_x];
};
} count _localVehicles;
ctrlShow[2810,false];
ctrlShow[2811,false];
ctrlSetText [2804, format ["%1 (%2 %3)",localize "STR_CL_VG_YOUR_VEHICLES",count (_storedVehicles),localize "STR_CL_VG_VEHICLES"]];

View File

@@ -869,7 +869,24 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis
s_player_butcher_human = -1;
};
};
};
};
if (DZE_Virtual_Garage) then {
if (_typeOfCursorTarget in vg_List) then {
if (s_garage_dialog < 0) then {
local _hasAccess = [player,_cursorTarget] call FNC_check_access;
local _plotCheck = [player, false] call FNC_find_plots;
local _isNearPlot = ((_plotCheck select 1) > 0);
if ((_isNearPlot && ((_hasAccess select 0) || (_hasAccess select 2) || (_hasAccess select 3) || (_hasAccess select 4))) || !_isNearPlot) then {
s_garage_dialog = player addAction [format["<t color='#0059FF'>%1</t>",localize "STR_CL_VG_VIRTUAL_GARAGE"],"\z\addons\dayz_code\actions\virtualGarage\virtualGarage.sqf",_cursorTarget,3,false,true];
};
};
} else {
player removeAction s_garage_dialog;
s_garage_dialog = -1;
};
};
// ZSC
if (Z_singleCurrency) then {
@@ -1153,6 +1170,8 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis
s_player_copyToKey = -1;
player removeAction s_player_claimVehicle;
s_player_claimVehicle = -1;
player removeAction s_garage_dialog;
s_garage_dialog = -1;
};
//Dog actions on player self

View File

@@ -131,6 +131,7 @@ class DefaultEventhandlers {
#include "Configs\RscDisplay\zscDialogs.hpp"
#include "Configs\RscDisplay\remoteVehicle.hpp"
#include "Configs\RscDisplay\vehicleKeyChanger.hpp"
#include "Configs\RscDisplay\virtualGarage.hpp"
//#include "Configs\RscDisplay\tradermenu.hpp"
class CfgTasks

View File

@@ -37,7 +37,10 @@ if (Z_SingleCurrency) then {
Z_VehicleDistance = 40; // Max distance a vehicle can be sold or accessed from at a trader.
// Vehicle Key Changer
DZE_VehicleKey_Changer = true; // Enable Vehicle Key Changer. Create or change the key for a vehicle.
DZE_VehicleKey_Changer = false; // Enable Vehicle Key Changer. Create or change the key for a vehicle.
// Virtual Garage
DZE_Virtual_Garage = false; // Enable the Virtual Garage to store vehicles.
// Plot Management and Plot for Life
DZE_permanentPlot = true; // Plot ownership saves after death. Enables Plot for Life by @RimBlock and Plot Management by @DevZupa.
@@ -107,6 +110,12 @@ if (isServer) then {
if (DZE_VehicleKey_Changer) then {
vkc_clearAmmo = true; // Clear the ammo of vehicles after they have been rekeyed/claimed? (stops users getting a free rearm)
vkc_disableThermal = [""]; // Array of vehicle config classes as well as vehicle classnames to disable thermal on when being spawned. i.e: ["All","Land","Air","Ship","StaticWeapon","AH1Z","MTVR"];
};
if (DZE_Virtual_Garage) then {
vg_clearAmmo = true; // Clear the ammo of vehicles spawned during the same restart they are stored? (stops users storing a vehicle for a free rearm)
vg_disableThermal = []; // Array of vehicle config classes as well as vehicle classnames to disable thermal on when being spawned. i.e: ["All","Land","Air","Ship","StaticWeapon","AH1Z","MTVR"];
vg_sortColumn = 0; //0 or an out of range value sorts by the default column 'DisplayName', otherwise 1 = 'DateStored', 2 = 'id', 3 = 'Name' (of storing player), 4 = 'DateMaintained'
};
};
@@ -304,6 +313,38 @@ if (!isDedicated) then {
vkc_changePrice = 5000; // Amount in worth for changing the key for a vehicle. See the top of this script for an explanation.
};
if (DZE_Virtual_Garage) then {
vg_list = ["Plastic_Pole_EP1_DZ"]; // List of objects/traders that are allowed to interact with virtual garage. i.e: ["Plastic_Pole_EP1_DZ","Worker2"];
vg_blackListed = []; // Array of vehicle config classes as well as vehicle classnames that are blacklisted from being stored, i.e ["All","Land","Air","Ship","StaticWeapon","AH1Z","MTVR"]
vg_heliPads = ["Helipad_Civil_DZ","Helipad_Rescue_DZ","Helipad_Army_DZ","Helipad_Cross_DZ","Helipad_ParkBorder_DZ"]; // Array of heli pad classnames
vg_store_keyless_vehicles = false; // Allow storing of keyless vehicle (map or mission spawned)
vg_removeKey = true; // Remove the key from the players inventory after storing vehicle?
vg_requireKey = true; // Require the player to have the key when storing a locked vehicle.
vg_storeWithGear = true; // Allow storing vehicles with gear?
vg_tiedToPole = true; // Tie the virtual garage to a local plot pole? If no plot pole is present (i.e a communal garage at a trader etc) the players UID will be used.
vg_pricePer = 100; // Price in worth to store a vehicle per gear item, use 0 if you want it to be free.
vg_maintainCost = 10000; //cost is 1000 per 10oz gold, gem cost is as defined in DZE_GemWorthArray; if you use ZSC then this is an amount of coins. This is a flate rate for all vehicles in the garage/per player depending on vg_tiedToPole
vg_price = [["Land",500],["Air",500],["Ship",500]];
/*
vg_price can be an array of vehicle config classes as well as vehicle classnames, you need to put these in order of what you prefer to get checked first.
Price is in worth for briefcases or coins for gold based servers (10,000 worth is considered 1 briefcase, 100,000 coins is considered 1 briefcase)
i.e:
vg_price = [["Land",500],["Air",300],["Ship",100]];
vg_price = [["350z_red",200],["Land",500],["AH1Z",1000],["Air",300],["Ship",100]];
*/
vg_limit = [["Land",5],["Air",5],["Ship",5]];
/*
vg_limit can be an array of vehicle config classes and classnames to narrow down what players can store or it can be a numerical value for a total limit.
These can be classnames as well as config classnames, you need to put these in order of what you prefer to get checked first.
i.e:
vg_limit = [["Land",5],["Air",3],["Ship",1]];
vg_limit = [["350z_red",2],["Land",5],["AH1Z",1],["Air",3],["Ship",1]];
vg_limit = 5;
*/
};
// Bloodsuckers
DZE_Bloodsuckers = false; // Enable bloodsucker spawning.

View File

@@ -212,6 +212,29 @@ if (!isDedicated) then {
vkc_vehicleInfo = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\vkc\vehicleInfo.sqf";
};
if (DZE_Virtual_Garage) then {
player_getVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\virtualGarage\player_getVehicle.sqf";
player_removePad = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\virtualGarage\player_removePad.sqf";
player_storeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\virtualGarage\player_storeVehicle.sqf";
Player_MaintainVG = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\virtualGarage\player_MaintainVG.sqf";
vehicleInfo = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\virtualGarage\vehicleInfo.sqf";
vg_maintainSetText = {
disableSerialization;
waituntil {!isNull (findDisplay 2800)};
_vgDisplCtl = (findDisplay 2800) displayCtrl 2854;
if (vg_maintainCost > 0) then {
_itemText = if (Z_SingleCurrency) then {CurrencyName} else {[vg_maintainCost,true] call z_calcCurrency};
if (Z_SingleCurrency) then {
_vgDisplCtl ctrlSetText format["%1 (%2 %3)",localize "STR_CL_VG_MAINTAIN_GARAGE",vg_maintainCost,_itemText];
} else {
_vgDisplCtl ctrlSetText format["%1 (%2)",localize "STR_CL_VG_MAINTAIN_GARAGE",_itemText];
};
} else {
_vgDisplCtl ctrlSetText format["%1 (%2)",localize "STR_CL_VG_MAINTAIN_GARAGE",localize "strwffree"];
};
};
};
if (DZE_Service_Points) then {
execVM "\z\addons\dayz_code\actions\servicePoints\init.sqf";
};

View File

@@ -213,7 +213,8 @@ if (!isDedicated) then {
s_player_bury_human = -1;
s_player_butcher_human = -1;
s_player_copyToKey = -1;
s_player_claimVehicle = -1;
s_player_claimVehicle = -1;
s_garage_dialog = -1;
};
call dayz_resetSelfActions;

View File

@@ -32171,6 +32171,10 @@
<German>Währung</German>
<Russian>Валюта</Russian>
</Key>
<Key ID="STR_EPOCH_TRADER_CATEGORY_HELI_PADS">
<English>Heli Pads</English>
<German>Helipads</German>
</Key>
<Key ID="STR_EPOCH_TRADER_CATEGORY_TRADE_ITEMS">
<English>Trade %1 %2 for %3 %4</English>
<German>%1 %2 für %3 %4 handeln</German>

View File

@@ -135,6 +135,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -142,6 +144,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -181,6 +181,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -188,6 +190,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -179,6 +179,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -186,6 +188,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -138,6 +138,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -145,6 +147,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -128,6 +128,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -135,6 +137,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -181,6 +181,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -188,6 +190,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -181,6 +181,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -188,6 +190,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -88,6 +88,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -179,6 +179,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -186,6 +188,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -181,6 +181,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -188,6 +190,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -174,6 +174,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -181,6 +183,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -181,6 +181,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -188,6 +190,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -167,6 +167,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -174,6 +176,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -181,6 +181,8 @@ menu_Profiteer2 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer2 select 0) set [count (menu_Profiteer2 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Wholesaler*********/
menu_Profiteer3 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_WHOLESALE",50]],
@@ -188,6 +190,8 @@ menu_Profiteer3 = [
"neutral"
];
if (DZE_Virtual_Garage) then {(menu_Profiteer3 select 0) set [count (menu_Profiteer3 select 0), [localize "STR_EPOCH_TRADER_CATEGORY_HELI_PADS",52]];};
/***************Banker*********/
menu_Functionary1_EP1 = [
[[localize "STR_EPOCH_TRADER_CATEGORY_CURRENCY",51]],

View File

@@ -0,0 +1,54 @@
server_queryVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\garage\server_queryVehicle.sqf";
server_spawnVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\garage\server_spawnVehicle.sqf";
server_storeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\garage\server_storeVehicle.sqf";
server_maintainGarage = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\garage\server_maintainVehicles.sqf";
"PVDZE_queryVehicle" addPublicVariableEventHandler {(_this select 1) spawn server_queryVehicle};
"PVDZE_spawnVehicle" addPublicVariableEventHandler {(_this select 1) spawn server_spawnVehicle};
"PVDZE_storeVehicle" addPublicVariableEventHandler {(_this select 1) spawn server_storeVehicle};
"PVDZE_maintainGarage" addPublicVariableEventHandler {(_this select 1) spawn server_maintainGarage};
// Thanks to icomrade/DayZ Epoch for this code: https://github.com/EpochModTeam/DayZ-Epoch/commit/8035df0ba0cd928b84085e288c5cb88260870a3e#diff-ad0636fc2328a27bd80bad9f46126307
VG_RandomizeMyKey = {
_randomInput = toArray "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
_return = [];
for "_i" from 0 to (_this) do {
_return set [count _return, (_randomInput call BIS_fnc_selectRandom)];
};
_return;
};
vg_serverKey = toString (8 call VG_RandomizeMyKey);
vg_alreadySpawned = [];
VG_ClearTurrets = {
//By denvdmj (probably, I found it on the biki)
private ["_weaponArray","_findRecurse","_class","_obj","_turret","_mags"];
_obj = _this;
_weaponArray = [];
_weaponArray set [count _weaponArray,[-1]];
_findRecurse = {
private ["_root", "_class", "_path", "_currentPath", "_thisThis"];
_root = (_this select 0);
_path = +(_this select 1);
_thisThis = _this select 2;
for "_i" from 0 to count _root -1 do {
_class = _root select _i;
if (isClass _class) then {
_currentPath = _path + [_i];
{_weaponArray set [count _weaponArray, _currentPath];} count getArray (_class >> "weapons");
_class = _class >> "turrets";
if (isClass _class) then {[_class, _currentPath, _thisThis] call _findRecurse;};
};
};
};
[configFile >> "CfgVehicles" >> typeOf (_obj) >> "turrets", [], _this] call _findRecurse;
{
_turret = _x;
_mags = _obj magazinesTurret _turret;
{_obj removeMagazinesTurret[_x,_turret];} count _mags;
} forEach _weaponArray;
};

View File

@@ -0,0 +1,9 @@
private ["_player","_playerUID","_key","_message"];
_player = _this select 0;
_playerUID = if (count _this > 1) then {_this select 1} else {getPlayerUID _player};
_key = format["CHILD:803:%1:",_playerUID];
_key call server_hiveWrite;
_message = format["GARAGE: %1 (%2) maintained vehicles linked to UID: %3 @%4 %5",if (alive _player) then {name _player} else {"DeadPlayer"},getPlayerUID _player,_playerUID,mapGridPosition _player,getPosATL _player];
diag_log _message;

View File

@@ -0,0 +1,12 @@
private ["_player","_query","_result","_clientID","_playerUID"];
_player = _this select 0;
_clientID = owner _player;
_playerUID = if (count _this > 1) then {_this select 1} else {getPlayerUID _player};
_key = format["CHILD:800:%1:%2:",_playerUID,vg_sortColumn];
_result = _key call server_hiveReadWrite;
PVDZE_queryVehicleResult = _result;
if (!isNull _player) then {_clientID publicVariableClient "PVDZE_queryVehicleResult";};

View File

@@ -0,0 +1,112 @@
private ["_isAir","_VG_ObjID","_characterID","_class","_clientID","_clrinit","_clrinit2","_colour","_colour2","_dam","_damage","_dir","_fuel","_hitpoints","_id","_inventory","_key","_location","_message","_object","_oid","_outcome","_player","_result","_selection","_serverKey","_uid","_worldSpace"];
_worldSpace = _this select 0;
_player = _this select 1;
_id = _this select 2;
_dir = _worldSpace select 0;
_location = _worldSpace select 1;
_worldSpace = [_dir,_location];
_uid = _worldSpace call dayz_objectUID2;
_key = str formatText["CHILD:801:%1:%2:%3:",_id,_worldSpace,_uid];
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if (_outcome != "PASS") exitWith {diag_log("HIVE VIRTUAL GARAGE SPAWN VEHICLE FAILED TO EXECUTE: " + _key);};
_class = _result select 1;
_characterID = _result select 2;
_inventory = _result select 3;
_hitpoints = _result select 4;
_fuel = _result select 5;
_damage = _result select 6;
_colour = _result select 7;
_colour2 = _result select 8;
_serverKey = _result select 9;
_VG_ObjID = _result select 10;
_clientID = owner _player;
if (_VG_ObjID in vg_alreadySpawned) exitWith {
diag_log format["VG ERROR: Vehicle with VGObjID = %1 has already been spawned and will not be spawned again. PlayerUID: %2", _VG_ObjID, (getPlayerUID _player)];
};
_key = format["CHILD:388:%1:",_uid];
#ifdef OBJECT_DEBUG
diag_log ("HIVE: WRITE: "+ str(_key));
#endif
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if (_outcome != "PASS") then {
diag_log("CUSTOM: failed to get id for : " + str(_uid));
} else {
_VG_ObjID = (toString (18 call VG_RandomizeMyKey)); //new ID
vg_alreadySpawned set [(count vg_alreadySpawned), _VG_ObjID];
_oid = _result select 1;
#ifdef OBJECT_DEBUG
diag_log("CUSTOM: Selected " + str(_oid));
#endif
_object = _class createVehicle _location;
if (surfaceIsWater _location && {({_x != _object} count (_location nearEntities ["Ship",8])) == 0}) then {
_object setPos _location;
};
_object addEventHandler ["HandleDamage",{false}];
clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;
if (vg_clearAmmo && {vg_serverKey == _serverKey}) then {_object call VG_ClearTurrets;};
_object setFuel _fuel;
_object setDamage _damage;
[_inventory select 0,_inventory select 1,_inventory select 2,_object] call fn_addCargo;
_object setVariable ["ObjectID", _oid, true];
_object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["VGObjectID",_VG_ObjID, false];
if (_colour != "0") then {
_object setVariable ["Colour",_colour,true];
_clrinit = format ["#(argb,8,8,3)color(%1)",_colour];
_object setVehicleInit "this setObjectTexture [0,"+str _clrinit+"];";
};
if (_colour2 != "0") then {
_object setVariable ["Colour2",_colour2,true];
_clrinit2 = format ["#(argb,8,8,3)color(%1)",_colour2];
_object setVehicleInit "this setObjectTexture [1,"+str _clrinit2+"];";
};
processInitCommands;
_characterID = str(_characterID);
_object setVariable ["CharacterID", _characterID, true];
if (_characterID != "0" && !(_object isKindOf "Bicycle")) then {_object setVehicleLock "LOCKED";};
_isAir = _object isKindOf "Air";
{
_selection = _x select 0;
_dam = _x select 1;
_dam = [_x select 1,(_x select 1) min 0.8] select (!_isAir && {_selection in dayZ_explosiveParts});
[_object,_selection,_dam] call fnc_veh_setFixServer;
} forEach _hitpoints;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
_object call fnc_veh_ResetEH;
{if (_object isKindOf _x) exitWith {_object disableTIEquipment true;}} count vg_disableThermal;
PVDZE_veh_Init = _object;
publicVariable "PVDZE_veh_Init";
PVDZE_spawnVehicleResult = _characterID;
if (!isNull _player) then {_clientID publicVariableClient "PVDZE_spawnVehicleResult";};
_message = format["%1 (%2) retrieved %3 @%4 %5",if (alive _player) then {name _player} else {"DeadPlayer"},getPlayerUID _player,_class,mapGridPosition _player,getPosATL _player];
diag_log _message;
};

View File

@@ -0,0 +1,92 @@
private ["_damageVeh","_VGobjID","_array","_backPack","_backPackCount","_charID","_class","_clientID","_colour","_colour2","_damage","_displayName","_fnc_sanitizeInput","_fuel","_gearCount","_hit","_hitpoints","_index","_inventory","_inventoryCount","_key","_magazine","_magazineCount","_message","_name","_objectID","_objectUID","_player","_playerUID","_selection","_vehicle","_weapons","_weaponsCount","_woGear"];
_vehicle = _this select 0;
_player = _this select 1;
_woGear = _this select 2;
_clientID = owner _player;
_playerUID = if (count _this > 3) then {_this select 3} else {getPlayerUID _player};
_gearCount = {
private ["_counter"];
_counter = 0;
{_counter = _counter + _x;} count _this;
_counter;
};
_fnc_sanitizeInput = {
private ["_input","_badChars"];
_input = _this;
_input = toArray (_input);
_badChars = [60,62,38,123,125,91,93,59,58,39,96,126,44,46,47,63,124,92,34];
{
_input = _input - [_x];
} forEach _badChars;
_input = toString (_input);
_input
};
_class = typeOf _vehicle;
_displayName = (getText(configFile >> "cfgVehicles" >> _class >> "displayName")) call _fnc_sanitizeInput;
_name = if (alive _player) then {(name _player) call _fnc_sanitizeInput;} else {"unknown player";};
_charID = _vehicle getVariable ["CharacterID","0"];
_objectID = _vehicle getVariable ["ObjectID","0"];
_objectUID = _vehicle getVariable ["ObjectUID","0"];
_VGobjID = _vehicle getVariable ["VGObjectID","0"];
if (_VGobjID == "0") then {
_VGobjID = (toString (18 call VG_RandomizeMyKey)); //normally spawned vehicle
} else {
_index = vg_alreadySpawned find _VGobjID;
if (_index >= 0) then {
vg_alreadySpawned = vg_alreadySpawned - [_VGobjID];
} else {
diag_log format["VG Error: Could not find vehicle with VGobjUID = %1 in vg_alreadySpawned array (server_storeVehicle.sqf) - possible duplicate vehicle being stored. PlayerUID: %2", _VGobjID, (getPlayerUID _player)];
};
};
_damageVeh = damage _vehicle;
_fuel = fuel _vehicle;
_colour = _vehicle getVariable ["Colour","0"];
_colour2 = _vehicle getVariable ["Colour2","0"];
_array = [];
_inventory = [[[],[]],[[],[]],[[],[]]];
_inventoryCount = [0,0,0];
if (isNil "_colour") then {_colour = "0";};
if (isNil "_colour2") then {_colour2 = "0";};
_hitpoints = _vehicle call vehicle_getHitpoints;
{
_hit = [_vehicle,_x] call object_getHit;
_damage = _hit select 0;
_selection = getText (configFile >> "CfgVehicles" >> _class >> "HitPoints" >> _x >> "name");
if (_damage > 0) then {_array set [count _array,[_selection,_damage]]};
} count _hitpoints;
if (!_woGear) then {
_weapons = getWeaponCargo _vehicle;
_magazine = getMagazineCargo _vehicle;
_backPack = getBackpackCargo _vehicle;
_weaponsCount = (_weapons select 1) call _gearCount;
_magazineCount = (_magazine select 1) call _gearCount;
_backPackCount = (_backPack select 1) call _gearCount;
_inventory = [_weapons, _magazine, _backPack];
_inventoryCount = [_weaponsCount, _magazineCount, _backPackCount];
};
_key = str formatText["CHILD:802:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:",_playerUID,_name,_displayName,_class,_charID,_inventory,_array,_fuel,_damageVeh,_colour,_colour2,vg_serverKey,_VGobjID,_inventoryCount];
_key call server_hiveWrite;
PVDZE_storeVehicleResult = true;
[_objectID,_objectUID,_vehicle] call server_deleteObjDirect;
deleteVehicle _vehicle;
if (!isNull _player) then {_clientID publicVariableClient "PVDZE_storeVehicleResult";};
_message = format["GARAGE: %1 (%2) stored %3 @%4 %5",_name,_playerUID,_class,mapGridPosition _player,getPosATL _player];
diag_log _message;

View File

@@ -58,6 +58,10 @@ spawn_mineveins = compile preprocessFileLineNumbers "\z\addons\dayz_server\compi
spawn_roadblocks = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_roadblocks.sqf";
spawn_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.sqf";
if (DZE_Virtual_Garage) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\garage\init.sqf";
};
fnc_veh_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
server_medicalSync = {

View File

@@ -8,7 +8,7 @@
1 ^Smoke !=SmokeShell(|Red|Green|Yellow) !=SmokeLauncherAmmo
1 ^Chem !=Chem(Green|Red|Blue)
1 ^._40mm !=(G_40mm_HE|G_40mm_Smoke|F_40mm_White|F_40mm_Green)
1 _DZ$ !=(BanditW?[12]|Camo1|Sniper1W?|Soldier1|SurvivorW?([123]|desert|pink|combat|urban|winter)|Blood_Trail)_DZ !=(Land_Fire|Sandbag1|Hedgehog|BearTrap|CamoNet|GrenadeHandTimedWest|flamable)_DZ !=(Priest|Doctor|Assistant|Worker[134]|Soldier_(Crew|TL|Sniper|Bodyguard_AA12)_PMC)_DZ !=((Functionary1|Haris_Press|Pilot|US_Soldier)_EP1|Reporter|MafiaBoss|Dealer)_DZ !=pz_(policeman|suit[12]|worker[123]|doctor|teacher|hunter|villager[123]|priest)_DZ !=(GUE_Soldier_(MG|Sniper|Crew|CO|2)|Apo_Rifleman_0[1-6])_DZ !=(UN_CDF_Soldier(_Guard)?_EP1|BAF_Soldier_(Officer|N)_MTP|Nac_Soldier|Tamika)_DZ !=GhillieFull_(Desert0[1-8]|Snow0[1-5]|Urban01|Wood(0[1-9]|1[1-6]))_DZ !=SG_GRU_(TL|Scout|Sniper|Spotter|Assaultman|Medic|Marksman|Operator|MG)(|_W|_D)_DZ !=(Firefighter([1-5]|_Officer[12])|Postman[1-4]|SchoolTeacher|Civilian([1-9]|1[0-4]))_DZ !=((Drake|Graves)_Light|GUE_Commander|Hunter|Gardener|RUS_(Soldier1|Commander))_DZ !=(RU_(Soldier(|_Officer|_Crew)|Policeman2?)|Ins_(Soldier_(2|GL|Crew)|Commander))_DZ !=(MVD_Soldier|CDF_Soldier|Prisoner[123]|Rocker[1-4]|BusinessMan|Rocket)_DZ !=(INS_(Lopotev|Soldier_(AR|CO)|Bardak|Worker2)|USMC_Soldier_(Officer|MG|Pilot))_DZ !=FR_(TL|R|Marksman|Assault_R|OHara|Rodriguez|Sapper)_DZ !=TK_(Special_Forces_MG|Soldier_Sniper|Commander|GUE_Soldier|CIV_Takistani0[1346]|INS_(Soldier(_AR)?|Warlord))_EP1_DZ !=gsc_(military_helmet_|military_head_)(|wdl|grey)_DZ !=gsc_(scientist[12](_head)?|cloth_loner_head)_DZ !=gsc_eco_stalker_(mask|head)_(camo|neutral|head|fred|duty)_DZ !=CZ_(Soldier_(805|Crew|Officer|Recon|Spec([123]|_Demo)|Sniper|Light)(|_Wdl|_Dst)|Soldier805_DES)_ACR_DZ !=CZ_(Special_Forces_GL_DES|Soldier_Sniper|Soldier_SL_DES)_EP1_DZ !=GER_Soldier(_TL)?_EP1(|_des|_wdl)_DZ !=(Plastic_Pole_EP1|Generator|Server_Rack|FuelPump|FireBarrel|GunRack|GunRack2|WoodCrate|WoodCrate2|WorkBench)_DZ !_Preview_DZ !=CamoWinter(1|2|1W|2W)_DZ !=HookerW(1-5)_DZ !=TK_INS_Soldier_EP(1-3)_DZ !=CinderGarageOpenTop(|Frame|Locked)_DZ !=CinderWall(Doorway|Door|DoorLocked|Window|Half)_DZ !=Wood(Ramp|Floor(|Stairs|Half|Quarter|4x)|TriangleFloor|Large(Wall(|Door|Win))|Small(Wall(|Third|Win|Door))|TriangleWall|GateFrame|Stairs(|Rails|Sans)|Ladder|Handrail|Pillar)_DZ !=MetalFloor(|_Half|_Quarter|4x)_DZ !=GlassFloor(|_Half|_Quarter)_DZ !=(DesertLarge|Desert|Winter|WinterLarge|Forest|ForestLarge)CamoNet_DZ !WoodenFence_ !MetalFence_
1 _DZ$ !=(BanditW?[12]|Camo1|Sniper1W?|Soldier1|SurvivorW?([123]|desert|pink|combat|urban|winter)|Blood_Trail)_DZ !=(Land_Fire|Sandbag1|Hedgehog|BearTrap|CamoNet|GrenadeHandTimedWest|flamable)_DZ !=(Priest|Doctor|Assistant|Worker[134]|Soldier_(Crew|TL|Sniper|Bodyguard_AA12)_PMC)_DZ !=((Functionary1|Haris_Press|Pilot|US_Soldier)_EP1|Reporter|MafiaBoss|Dealer)_DZ !=pz_(policeman|suit[12]|worker[123]|doctor|teacher|hunter|villager[123]|priest)_DZ !=(GUE_Soldier_(MG|Sniper|Crew|CO|2)|Apo_Rifleman_0[1-6])_DZ !=(UN_CDF_Soldier(_Guard)?_EP1|BAF_Soldier_(Officer|N)_MTP|Nac_Soldier|Tamika)_DZ !=GhillieFull_(Desert0[1-8]|Snow0[1-5]|Urban01|Wood(0[1-9]|1[1-6]))_DZ !=SG_GRU_(TL|Scout|Sniper|Spotter|Assaultman|Medic|Marksman|Operator|MG)(|_W|_D)_DZ !=(Firefighter([1-5]|_Officer[12])|Postman[1-4]|SchoolTeacher|Civilian([1-9]|1[0-4]))_DZ !=((Drake|Graves)_Light|GUE_Commander|Hunter|Gardener|RUS_(Soldier1|Commander))_DZ !=(RU_(Soldier(|_Officer|_Crew)|Policeman2?)|Ins_(Soldier_(2|GL|Crew)|Commander))_DZ !=(MVD_Soldier|CDF_Soldier|Prisoner[123]|Rocker[1-4]|BusinessMan|Rocket)_DZ !=(INS_(Lopotev|Soldier_(AR|CO)|Bardak|Worker2)|USMC_Soldier_(Officer|MG|Pilot))_DZ !=FR_(TL|R|Marksman|Assault_R|OHara|Rodriguez|Sapper)_DZ !=TK_(Special_Forces_MG|Soldier_Sniper|Commander|GUE_Soldier|CIV_Takistani0[1346]|INS_(Soldier(_AR)?|Warlord))_EP1_DZ !=gsc_(military_helmet_|military_head_)(|wdl|grey)_DZ !=gsc_(scientist[12](_head)?|cloth_loner_head)_DZ !=gsc_eco_stalker_(mask|head)_(camo|neutral|head|fred|duty)_DZ !=CZ_(Soldier_(805|Crew|Officer|Recon|Spec([123]|_Demo)|Sniper|Light)(|_Wdl|_Dst)|Soldier805_DES)_ACR_DZ !=CZ_(Special_Forces_GL_DES|Soldier_Sniper|Soldier_SL_DES)_EP1_DZ !=GER_Soldier(_TL)?_EP1(|_des|_wdl)_DZ !=(Plastic_Pole_EP1|Generator|Server_Rack|FuelPump|FireBarrel|GunRack|GunRack2|WoodCrate|WoodCrate2|WorkBench)_DZ !_Preview_DZ !=CamoWinter(1|2|1W|2W)_DZ !=HookerW(1-5)_DZ !=TK_INS_Soldier_EP(1-3)_DZ !=CinderGarageOpenTop(|Frame|Locked)_DZ !=CinderWall(Doorway|Door|DoorLocked|Window|Half)_DZ !=Wood(Ramp|Floor(|Stairs|Half|Quarter|4x)|TriangleFloor|Large(Wall(|Door|Win))|Small(Wall(|Third|Win|Door))|TriangleWall|GateFrame|Stairs(|Rails|Sans)|Ladder|Handrail|Pillar)_DZ !=MetalFloor(|_Half|_Quarter|4x)_DZ !=GlassFloor(|_Half|_Quarter)_DZ !=(DesertLarge|Desert|Winter|WinterLarge|Forest|ForestLarge)CamoNet_DZ !WoodenFence_ !MetalFence_ !Helipad_
1 ^Trap Trap(_Cans|Tripwire(Flare|Grenade|Smoke)|BearTrap(Smoke|Flare))
1=(SmallSecondary|HelicopterExplo(Small|Big)) // log explosions (optional)
1=(PipeBomb|Grenade(_|HandTimed)(West|East)) // log grenades (optional)

View File

@@ -1,5 +1,5 @@
//new
5 !=remEx(Field|FP) !=(PVCDZ_obj_GutBody|BIS_effects_gepv) !=PVDZ_(hlt_Bleed|obj_(Delete|Publish|RoadFlare|Destroy|Fire)|veh_Save|veh_SF) !=PVDZ_(plr_(Death|Login[12]|LoginRecord|Save|SwitchMove|Delete)|Server(_Simulation|StoreVar|_UpdateGroup)) !=PVDZ_(playerMedicalSync|groupInvite|send|sec_atp) !=PVDZ_objgather_(Delete|Knockdown) !=PVDZE_(obj_(Swap|Trade)|maintainArea|PingSend|veh_(Lock|Publish2|Upgrade)|handleSafeGear|plr_(DeathB|FriendRQ)) !=SK_changeCode
5 !=remEx(Field|FP) !=(PVCDZ_obj_GutBody|BIS_effects_gepv) !=PVDZ_(hlt_Bleed|obj_(Delete|Publish|RoadFlare|Destroy|Fire)|veh_Save|veh_SF) !=PVDZ_(plr_(Death|Login[12]|LoginRecord|Save|SwitchMove|Delete)|Server(_Simulation|StoreVar|_UpdateGroup)) !=PVDZ_(playerMedicalSync|groupInvite|send|sec_atp) !=PVDZ_objgather_(Delete|Knockdown) !=PVDZE_(obj_(Swap|Trade)|maintainArea|PingSend|veh_(Lock|Publish2|Upgrade)|handleSafeGear|plr_(DeathB|FriendRQ)) !=SK_changeCode !=PVDZE_(query|store|spawn)Vehicle !=PVDZE_maintainGarage
1=BIS_effects_gepv|PVDZ_(hlt_Bleed|obj_Delete|obj_Destroy|obj_Publish|plr_Death|plr_LoginRecord|sec_atp|send)
1=PVDZ_veh_(Save|SF)
1=PVDZE_obj_Swap

File diff suppressed because one or more lines are too long

View File

@@ -72,6 +72,18 @@ Password = ChangeMe
;Do not use double quotation marks, only use single quotation marks [']
;MaintenanceObjects = 'Land_DZE_GarageWoodDoorLocked','Land_DZE_LargeWoodDoorLocked','Land_DZE_WoodDoorLocked','CinderWallDoorLocked_DZ','CinderWallDoorSmallLocked_DZ','Plastic_Pole_EP1_DZ'
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Virtual Garage Addition ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Table name for the virtual garage data to be stored in, default table is 'garage'
;VGTable = garage
; Days for a stored vehicle to be cleaned up after, if set to -1 this feature is disabled. Default 35 days
;CleanupVehStoredDays = 35
; Log object cleanup DELETE statements (per object), including virtual garage. Default is false
;LogObjectCleanup = false
;If using OFFICIAL hive, the settings in this section have no effect, it will manage objects on its own
[ObjectDB]
;Setting this to true separates the Object fetches from the Character fetches

View File

@@ -1,9 +1,8 @@
/*
DayZ Epoch 1.0.7
DayZ Epoch 1.0.7.1
ONLY RUN THIS FILE IF CREATING A NEW DATABASE.
EXISTING 1051 DATABASES SHOULD USE 1.0.6_UPDATES.SQL INSTEAD AND THEN RUN 1.0.6.2_UPDATES.SQL.
EXISTING 1061 DATABASES SHOULD USE 1.0.6.2_UPDATES.SQL INSTEAD.
EXISTING 1.0.7 DATABASES SHOULD USE update epoch 1.0.7 to 1.0.7.1.sql INSTEAD.
*/
SET FOREIGN_KEY_CHECKS=0;
@@ -108,6 +107,36 @@ CREATE TABLE IF NOT EXISTS `Player_LOGIN` (
-- Records of player_login
-- ----------------------------
-- ----------------------------
-- Table structure for `garage`
-- ----------------------------
CREATE TABLE IF NOT EXISTS `garage` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`PlayerUID` varchar(20) NOT NULL DEFAULT '0',
`Name` varchar(50) NOT NULL DEFAULT '',
`DisplayName` varchar(50) NOT NULL DEFAULT '',
`Classname` varchar(50) DEFAULT NULL,
`Datestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`DateStored` varchar(10) NOT NULL DEFAULT 'old',
`DateMaintained` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`CharacterID` bigint(20) unsigned NOT NULL DEFAULT '0',
`StorageCounts` varchar(30) NOT NULL DEFAULT '[0,0,0]',
`Inventory` mediumtext,
`Hitpoints` mediumtext,
`Fuel` double(13,5) NOT NULL DEFAULT '1.00000',
`Damage` double(13,5) NOT NULL DEFAULT '0.00000',
`Colour` varchar(50) NOT NULL,
`Colour2` varchar(50) NOT NULL,
`serverKey` varchar(10) NOT NULL DEFAULT 'old',
`ObjUID` varchar(20) NOT NULL DEFAULT 'old',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of garage
-- ----------------------------
/*
THIS PROCEDURE IS REQUIRED FOR 1062 AND RETURNS THE OBJECT ID MUCH MORE EFFICENTLY THAN THE METHOD IN 1061 SQF
*/

View File

@@ -2,3 +2,25 @@ UPDATE character_data SET Backpack = REPLACE(Backpack, '"Skin_gsc_cloth_loner_he
UPDATE character_data SET Inventory = REPLACE(Inventory, '"Skin_gsc_cloth_loner_head_DZ"', '"Skin_Survivor2_DZ"') WHERE INSTR(Inventory, '"Skin_gsc_cloth_loner_head_DZ"') > 0;
UPDATE object_data SET Inventory = REPLACE(Inventory, '"Skin_gsc_cloth_loner_head_DZ"', '"Skin_Survivor2_DZ"') WHERE INSTR(Inventory, '"Skin_gsc_cloth_loner_head_DZ"') > 0;
UPDATE character_data SET Model = "Survivor2_DZ" WHERE Model = "gsc_cloth_loner_head_DZ";
CREATE TABLE IF NOT EXISTS `garage` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`PlayerUID` varchar(20) NOT NULL DEFAULT '0',
`Name` varchar(50) NOT NULL DEFAULT '',
`DisplayName` varchar(50) NOT NULL DEFAULT '',
`Classname` varchar(50) DEFAULT NULL,
`Datestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`DateStored` varchar(10) NOT NULL DEFAULT 'old',
`DateMaintained` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`CharacterID` bigint(20) unsigned NOT NULL DEFAULT '0',
`StorageCounts` varchar(30) NOT NULL DEFAULT '[0,0,0]',
`Inventory` mediumtext,
`Hitpoints` mediumtext,
`Fuel` double(13,5) NOT NULL DEFAULT '1.00000',
`Damage` double(13,5) NOT NULL DEFAULT '0.00000',
`Colour` varchar(50) NOT NULL,
`Colour2` varchar(50) NOT NULL,
`serverKey` varchar(10) NOT NULL DEFAULT 'old',
`ObjUID` varchar(20) NOT NULL DEFAULT 'old',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;