This commit is contained in:
2022-04-21 16:15:41 +03:00
commit 9d4fc88901
601 changed files with 66252 additions and 0 deletions

View File

@ -0,0 +1,51 @@
/*
DZE_CLICK_ACTIONS
This is where you register your right-click actions
FORMAT -- (no comma after last array entry)
[_classname,_text,_execute,_condition],
PARAMETERS
_classname : the name of the class to click on (example = "ItemBloodbag")
_text : the text for the option that is displayed when right clicking on the item (example = "Self Transfuse")
_execute : compiled code to execute when the option is selected (example = "execVM 'my\scripts\self_transfuse.sqf';")
_condition : compiled code evaluated to determine whether or not the option is displayed (example = {true})
*/
DZE_CLICK_ACTIONS = [
/*
["ItemGPS",localize "STR_CL_CA_SCAN_NEARBY","if(isNil 'CA_GPS_RANGE') then {CA_GPS_RANGE = 1500;};CA_ZOMBIE_COUNT = count ((position player) nearEntities ['zZombie_Base',CA_GPS_RANGE]); CA_MAN_COUNT = count ((position player) nearEntities ['CAManBase',CA_GPS_RANGE]); format[localize 'STR_CL_CA_SCAN',CA_GPS_RANGE,CA_MAN_COUNT - CA_ZOMBIE_COUNT,count ((position player) nearEntities ['zZombie_Base',CA_GPS_RANGE]),count ((position player) nearEntities ['allVehicles',CA_GPS_RANGE]) - CA_MAN_COUNT] call dayz_rollingMessages;","true"],
["ItemGPS",localize "STR_CL_CA_RANGE_UP","if(isNil 'CA_GPS_RANGE') then {CA_GPS_RANGE = 1500;};CA_GPS_RANGE = (CA_GPS_RANGE + 100) min 2500; format[localize 'STR_CL_CA_RANGE_GPS',CA_GPS_RANGE] call dayz_rollingMessages;","true"],
["ItemGPS",localize "STR_CL_CA_RANGE_DOWN","if(isNil 'CA_GPS_RANGE') then {CA_GPS_RANGE = 1500;};CA_GPS_RANGE = (CA_GPS_RANGE - 100) max 1000; format[localize 'STR_CL_CA_RANGE_GPS',CA_GPS_RANGE] call dayz_rollingMessages;","true"]
*/
["ItemGPS",localize "STR_CL_LV_LOCATE_VEHICLES","[] spawn locateVehicle;","true"],
["ItemMap",localize "STR_CL_LV_LOCATE_VEHICLES","[] spawn locateVehicle;","true"],
["ItemKey",localize "STR_CL_RV_CA_EJECT","spawn remoteVehicle;","true",1],
["ItemKey",localize "STR_CL_RV_CA_ENGINE","spawn remoteVehicle;","true",2],
["ItemKey",localize "STR_CL_RV_CA_UNLOCK","spawn remoteVehicle;","true",3],
["ItemKey",localize "STR_CL_RV_CA_LOCK","spawn remoteVehicle;","true",4]
//["ItemKey",localize "STR_CL_RV_CA_LIGHTS","spawn remoteVehicle;","true",5]
];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","View Distance:","systemChat('Change View Distance Locally. Click on one of the distance options');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","400 Meters","setViewDistance 400; systemChat('ViewDistance: 400'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","600 Meters","setViewDistance 600; systemChat('ViewDistance: 600'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","800 Meters","setViewDistance 800; systemChat('ViewDistance: 800'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","1000 Meters","setViewDistance 1000; systemChat('ViewDistance: 1000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","1250 Meters","setViewDistance 1250; systemChat('ViewDistance: 1250'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","1500 Meters","setViewDistance 1500; systemChat('ViewDistance: 1500'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","1750 Meters","setViewDistance 1750; systemChat('ViewDistance: 1750'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","2000 Meters","setViewDistance 2000; systemChat('ViewDistance: 2000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","3000 Meters","setViewDistance 3000; systemChat('ViewDistance: 3000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","4000 Meters","setViewDistance 4000; systemChat('ViewDistance: 4000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular_Vector","5000 Meters","setViewDistance 5000; systemChat('ViewDistance: 5000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","View Distance:","systemChat('Change View Distance Locally. Click on one of the distance options');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","400 Meters","setViewDistance 400; systemChat('ViewDistance: 400'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","600 Meters","setViewDistance 600; systemChat('ViewDistance: 600'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","800 Meters","setViewDistance 800; systemChat('ViewDistance: 800'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","1000 Meters","setViewDistance 1000; systemChat('ViewDistance: 1000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","1250 Meters","setViewDistance 1250; systemChat('ViewDistance: 1250'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","1500 Meters","setViewDistance 1500; systemChat('ViewDistance: 1500'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","1750 Meters","setViewDistance 1750; systemChat('ViewDistance: 1750'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","2000 Meters","setViewDistance 2000; systemChat('ViewDistance: 2000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","3000 Meters","setViewDistance 3000; systemChat('ViewDistance: 3000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","4000 Meters","setViewDistance 4000; systemChat('ViewDistance: 4000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [["Binocular","5000 Meters","setViewDistance 5000; systemChat('ViewDistance: 5000'); systemChat('Warning: Higher the view distance Lower the FPS');","true"]];

View File

@ -0,0 +1,57 @@
// **FORMAT** -- (note no comma after last array entry)
//
// DZE_DEPLOYABLES_CONFIG = [
// [_clickItem,_deployOffset,_packDistance,_damageLimit,_packAny,_cargo,_ammo,_hive,_plot,_simulation,_road,_deployables,_near,_parts,_condition],
// [_clickItem,_deployOffset,_packDistance,_damageLimit,_packAny,_cargo,_ammo,_hive,_plot,_simulation,_road,_deployables,_near,_parts,_condition],
// [...more stuff here...]
// ];
//
// parameter | description | type | example
// --------------|---------------------------------------------------------------------|--------|--------
// _clickItem | class name of the item to click on | string | "ItemToolbox"
// _deployOffset | [_side,_front,_up] array to offset the deployable when buiding | array | [0,2,1]
// _packDistance | how close does the packer need to be to pack the object? | number | 5
// _damageLimit | item can't be repacked if damage is > this. (-1 = no re-packing) | number | 0.1
// _packAny | can anyone repack the deployable? | bool | false
// _cargo | clear the cargo of the deployable? | bool | false
// _ammo | should vehicle ammo be cleared? (does not persist through restart) | bool | true
// _hive | write deployable to database? | bool | false
// _plot | require a plot from the owner to build the deployable? | bool | false
// _simulation | enable simulation (movement/damage) for the object? (true for cars) | bool | true
// _road | enable road building for this object? | bool | true
// _deployables | array of class names that can be deployed with this method | array | ["MMT_Civ"]
// _near | array of items required nearby to build (workshop/fire/fueltank) | array | []
// _parts | array of parts required to build (will be taken from player) | array | ["ItemToolbox"]
// _condition | string of code to evaluate to determine whether action is shown | string | "!(isNull player) && {(getPlayerUID player) in DZE_DEPLOYABLE_ADMINS}"
DZE_DEPLOYABLES_CONFIG = [
// deploy a non-permanent bike from a toolbox right in front of the player that can be re-packed by the owner as long as it's under 10% damage
["ItemToolbox",[0,6,1],5,0.1,false,false,false,false,false,true,true,["MMT_Civ"],[],["ItemToolbox"],"true"],
["ItemToolbox",[0,6,1],5,0.1,false,false,false,false,false,true,true,["CSJ_GyroC"],[],["PartVRotor", "PartEngine", "ItemToolbox"],"true"],
["ItemToolbox",[0,6,1],5,0.1,false,false,false,false,false,true,true,["TT650_Civ"],[],["PartEngine", "ItemToolbox"],"true"]
// deploy fortifications from etool 3 meters in front of player that are permanent until server restart
//["ItemEtool",[0,3,0],5,-1,false,true,false,true,false,false,["Land_fort_rampart","Fort_StoneWall_EP1","Land_fort_bagfence_round"],[],["ItemEtool"],"true"],
// deploy a permanent helicopter from ruby 5 meters in front of player that can be re-packed by anyone as long as it's under 10% damage
//["ItemEtool",[0,8,0],5,-1,false,true,true,true,false,false,["Land_fortified_nest_big"],[],["ItemSandbagExLarge5x","ItemSandbagExLarge5x","ItemSandbagExLarge5x"],"true"],
//["PartWoodPile",[0,2,0],5,1,true,true,true,true,false,false,["Pile_of_wood"],[],["PartWoodPile","PartWoodPile","PartWoodPile","PartWoodPile","PartWoodPile"],"true"],
//["ItemSapphire",[0,2,0],5,1,true,true,true,true,false,false,["DSHKM_CDF","M2StaticMG","SearchLight_CDF"],[],["ItemSapphire"],"true"]
];
// **DZE_DEPLOYABLE_NAME_MAP format
//
// DZE_DEPLOYABLE_NAME_MAP = [
// [_class,_name],
// [_class,_name],
// [... more ...]
// ];
//
// parameter | description | type | example
// --------------|---------------------------------------------------------------------|--------|--------
// _class | class name of the item you want to replace the name of | string | "Notebook"
// _name | new name to display when right clicking | string | "Macbook Pro"
//
DZE_DEPLOYABLE_NAME_MAP = [
["Notebook","Macbook Pro"]
];
DZE_DEPLOYABLE_ADMINS = [];

View File

@ -0,0 +1,46 @@
private["_exitWith","_position","_display","_object","_handle","_deployableName"];
_exitWith = "nil";
disableSerialization;
_display = findDisplay 106;
if (!(isNull _display)) then {
_display closeDisplay 0;
};
_deployableName = _this call getDeployableDisplay;
{
if (_x select 0) exitWith {_exitWith = (_x select 1);};
} forEach [
[(dayz_playerUID in DZE_DEPLOYABLE_ADMINS),"admin"],
[!([player,_this] call getHasDeployableParts),format["You need %1 to build %2",str (_this call getDeployableParts),_deployableName]],
[!(call fnc_can_do),format["You can't build a %1 right now.",_deployableName]],
[(player getVariable["inCombat",false]), format["Can't build a %1 while in combat!",(_this call getDeployableDisplay)]],
[DZE_DEPLOYING,"You are already building something!"],
[DZE_PACKING,"You are already packing something!"]
];
if (_exitWith != "nil" && {_exitWith != "admin"}) exitWith {
taskHint [_exitWith, DZE_COLOR_DANGER, "taskFailed"];
};
DZE_DEPLOYING = true;
DZE_DEPLOYING_SUCCESSFUL = false;
_handle = (_this call getDeployableClass) spawn player_deploy;
waitUntil {scriptDone _handle;};
DZE_DEPLOYING = false;
if (!DZE_DEPLOYING_SUCCESSFUL) then {
taskHint ["Deploying Failed!", DZE_COLOR_DANGER, "taskFailed"];
} else {
taskHint [format["You've built a %1!",_deployableName], DZE_COLOR_PRIMARY, "taskDone"];
uiSleep 10;
if (!(_this call getPermanent)) then {
"Warning: Deployed vehicles DO NOT SAVE after server restart!" call dayz_rollingMessages;
} else {
"This vehicle is permanent and will persist through server restarts!" call dayz_rollingMessages;
};
};

View File

@ -0,0 +1,84 @@
// this function checks if play is on ladder/passed out/being drug
fnc_can_do = {
private ["_onLadder"];
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
(!r_drag_sqf && !r_player_unconscious && !_onLadder)
};
// this goes through a crafting animation until the loop is interrupted until interrupted by a set of conditions fed to the function
// it then returns the result of what broke the loop, or "nil" -- yes, string of "nil" -- if not broken
fnc_bike_crafting_animation = {
private ["_isLoopDone","_isAnimationStarted","_isAnimationCompleted","_animationState","_isAnimationActive","_exitWith"];
[player,(getPosATL player),30,"repair"] spawn fnc_alertZombies;
player playActionNow "Medic";
r_interrupt = false;
_isLoopDone = false;
_isAnimationStarted = false;
_isAnimationCompleted = false;
_animationState = animationState player;
_isAnimationActive = false;
_exitWith = "nil";
while {!_isLoopDone} do {
_animationState = animationState player;
_isAnimationActive = ["medic",_animationState] call fnc_inString;
if (_isAnimationActive) then {
_isAnimationStarted = true;
};
if (_isAnimationStarted && !_isAnimationActive) then {
_isLoopDone = true;
_isAnimationCompleted = true;
};
{
if (call compile (_x select 0)) exitWith {
_exitWith = _x select 1;
};
} forEach _this;
if (_exitWith != "nil") then {
_isLoopDone = true;
player switchMove "";
player playActionNow "stop";
};
sleep 0.3;
};
_exitWith
};
fnc_set_temp_deployable_id = {
_this setVariable ["DeployedBy",call fnc_temp_deployable_id, true];
};
fnc_set_perm_deployable_id = {
_this setVariable ["CharacterID",call fnc_perm_deployable_id, true];
};
fnc_get_perm_deployable_id = {
private["_return","_parse"];
_return = _this getVariable ["CharacterID","0"];
_parse = parseNumber _return;
if(_parse < 500000) then {
_return = "nil";
};
_return
};
fnc_get_temp_deployable_id = {
_this getVariable ["DeployedBy","nil"]
};
fnc_perm_deployable_id = {
private["_calc","_return"];
_calc = 999999 - (parseNumber dayz_characterID);
if(_calc < 500000) then {
_return = "nil";
} else {
_return = (str _calc);
};
_return
};
fnc_temp_deployable_id = {
getPlayerUID player
};

View File

@ -0,0 +1,101 @@
call compile preprocessFileLineNumbers "scripts\deployAnything\config.sqf";
call compile preprocessFileLineNumbers "scripts\deployAnything\wrapper.sqf";
call compile preprocessFileLineNumbers "scripts\deployAnything\functions.sqf";
_DZE_DEPLOYABLE_VERSION = "3.0.1";
diag_log format["Deploy Anything: loading version %1 ...",_DZE_DEPLOYABLE_VERSION];
player_deploy = compile preprocessFileLineNumbers "scripts\deployAnything\player_deploy.sqf";
DZE_DEPLOYABLES = [];
{
private["_class","_distance","_deployables","_packDist","_packOthers","_clearCargo","_clearAmmo","_permanent","_damage","_needNear","_parts","_requirePlot","_enableSim","_road","_condition"];
_class = _x select 0;
_distance = _x select 1;
_packDist = _x select 2;
_damage = _x select 3;
_packOthers = _x select 4;
_clearCargo = _x select 5;
_clearAmmo = _x select 6;
_permanent = _x select 7;
_requirePlot = _x select 8;
_enableSim = _x select 9;
_road = _x select 10;
_deployables = _x select 11;
_needNear = _x select 12;
_parts = _x select 13;
_condition = _x select 14;
{
DZE_DEPLOYABLES set [count DZE_DEPLOYABLES,[_class,_distance,_packDist,_damage,_packOthers,_clearCargo,_clearAmmo,_permanent,_requirePlot,_enableSim,_road,_x,_needNear,_parts,_condition]];
} forEach _deployables;
} forEach DZE_DEPLOYABLES_CONFIG;
if (isServer) exitWith {
diag_log "Deploy Anything: adding deployables to safe vehicle list...";
{
local _classname = _forEachIndex call getDeployableClass;
DZE_safeVehicle = DZE_safeVehicle + [_classname];
if (_forEachIndex call getPermanent && (!(_classname isKindof "AllVehicles") || (_classname isKindOf "StaticWeapon"))) then {
DayZ_SafeObjects set [count DayZ_SafeObjects,_classname];
};
} forEach DZE_DEPLOYABLES;
};
[] spawn {
if (!isDedicated && {isNil "DZE_CLICK_ACTIONS"}) exitWith {
diag_log "Deploy Anything: ERROR -- Click Actions Handler missing!";
};
{
DZE_CLICK_ACTIONS = DZE_CLICK_ACTIONS + [[(_forEachIndex call getDeployableKitClass),format["Deploy %1",(_forEachIndex call getDeployableDisplay)],format["%1 execVM 'scripts\deployAnything\deploy.sqf';",_forEachIndex],(_forEachIndex call getDeployableCondition)]];
} forEach DZE_DEPLOYABLES;
DZE_DEPLOYING = false;
DZE_PACKING = false;
DZE_COLOR_PRIMARY = [(51/255),(181/255),(229/255),1];
DZE_COLOR_SUCCESS = [(153/255),(204/255),0,1];
DZE_COLOR_DANGER = [1,(68/255),(68/255),1];
diag_log "Deploy Anything: waiting for login...";
waitUntil{!isNil "Dayz_loginCompleted"};
[] spawn {
waitUntil {sm_done;};
{
if (parseNumber(_x getVariable["CharacterID","0"]) > 500000) then {
[_x,false] call local_lockUnlock;
};
} forEach vehicles;
};
while {true} do {
if (!isNull player) then {
{
private ["_cursorTarget"];
_cursorTarget = cursorTarget;
if (!(isNull _cursorTarget)
&& {_forEachIndex call getDeployablePackAny}
&& {typeOf _cursorTarget == (_forEachIndex call getDeployableClass)}
&& {call fnc_can_do}
&& {(((_cursorTarget call fnc_get_temp_deployable_id) != "nil") || ((_cursorTarget call fnc_get_perm_deployable_id) != "nil"))}
&& {(
((_cursorTarget call fnc_get_perm_deployable_id) == (call fnc_perm_deployable_id))
|| ((_cursorTarget call fnc_get_temp_deployable_id) == (call fnc_temp_deployable_id))
|| (_forEachIndex call getDeployablePackOthers)
|| ((getPlayerUID player) in DZE_DEPLOYABLE_ADMINS)
)}
&& {(player distance _cursorTarget) < (_forEachIndex call getDeployablePackDistance)}) then {
if ((_forEachIndex call getActionId) < 0) then {
[_forEachIndex,player addaction["<t color='#33b5e5'>" + format["Pack %1",(_forEachIndex call getDeployableDisplay)] + "</t>","scripts\deployAnything\pack.sqf",[_forEachIndex,_cursorTarget],0,false,true]] call setActionId;
};
} else {
player removeAction (_forEachIndex call getActionId);
[_forEachIndex,-1] call setActionId;
};
} forEach DZE_DEPLOYABLES;
};
uiSleep 2.5;
};
};

View File

@ -0,0 +1,60 @@
private["_isPackingLocked","_lastPackTime","_exitWith","_deployable","_cursorTarget","_deployableName"];
_exitWith = "nil";
_deployable = (_this select 3) select 0;
_cursorTarget = (_this select 3) select 1;
_lastPackTime = _cursorTarget getVariable["lastPackTime",diag_tickTime - 11];
_isPackingLocked = diag_tickTime - _lastPackTime < 10;
_deployableName = _deployable call getDeployableDisplay;
{
if (_x select 0) exitWith {_exitWith = (_x select 1);};
} forEach [
[(dayz_playerUID in DZE_DEPLOYABLE_ADMINS),"admin"],
[!(call fnc_can_do),format["You can't pack your %1 right now.",_deployableName]],
[(player getVariable["inCombat",false]),format["Can't pack a %1 while in combat!",_deployableName]],
[(damage cursorTarget > (_deployable call getDamageLimit)),format["The %1 must be under %2 percent damaged to pack!",_deployableName,(_deployable call getDamageLimit) * 100]],
[_isPackingLocked,format["Someone just tried to pack that %1! Try again in a few seconds.",_deployableName]],
[DZE_PACKING,"You are already packing something!"],
[DZE_DEPLOYING,"You are already building something!"]
];
if (_exitWith != "nil" && {_exitWith != "admin"}) exitWith {
taskHint [_exitWith, DZE_COLOR_DANGER, "taskFailed"];
};
_cursorTarget setVariable["lastPackTime",diag_tickTime,true];
DZE_PACKING = true;
_exitWith = [
["dayz_playerUID in DZE_DEPLOYABLE_ADMINS","admin"],
["r_interrupt",format["Packing %1 interrupted!",_deployableName]],
["(player getVariable['inCombat',false])",format["You can't pack your %1 while in combat!",_deployableName]]
] call fnc_bike_crafting_animation;
if (_exitWith != "nil" && {_exitWith != "admin"}) exitWith {
DZE_PACKING = false;
taskHint [_exitWith, DZE_COLOR_DANGER, "taskFailed"];
};
{
if (isClass(configFile >> "CfgWeapons" >> _x)) then {
player addWeapon _x;
};
if (isClass(configFile >> "CfgMagazines" >> _x)) then {
player addMagazine _x;
};
} forEach (_deployable call getDeployableParts);
if (_deployable call getPermanent) then {
PVDZ_obj_Destroy = [_cursorTarget getVariable["ObjectID","0"],_cursorTarget getVariable["ObjectUID","0"],player,_cursorTarget,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
} else {
deleteVehicle _cursorTarget;
};
player removeAction (_deployable call getActionId);
[_deployable,-1] call setActionId;
DZE_PACKING = false;
taskHint [format["You have packed your %1 back into your %2.",_deployableName,(_deployable call getDeployableKitDisplay)], DZE_COLOR_PRIMARY, "taskDone"];

View File

@ -0,0 +1,463 @@
/*
DayZ Base Building
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_vector","_IsNearPlot","_abort","_animState","_buildables","_buildcheck","_canBuild","_cancel","_classname","_classnametmp","_counter","_dir","_distance","_exitWith","_finished","_friendlies","_hasbuilditem","_hasrequireditem","_hastoolweapon","_index","_inVehicle","_isAllowedUnderGround","_isMedic","_isNear","_isOk","_isfriendly","_isowner","_limit","_location","_location1","_location2","_message","_missing","_nearestPole","_needNear","_needText","_objHDiff","_object","_offset","_onLadder","_ownerID","_plotcheck","_position","_proceed","_reason","_requireplot","_rotate","_started","_text","_tmpbuilt","_vehicle","_zheightchanged","_zheightdirection","_havePad","_heliPad","_charID"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_40" call dayz_rollingMessages;};
dayz_actionInProgress = true;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_cancel = false;
_reason = "";
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
DZE_Q = false;
DZE_Z = false;
DZE_Q_alt = false;
DZE_Z_alt = false;
DZE_Q_ctrl = false;
DZE_Z_ctrl = false;
DZE_5 = false;
DZE_4 = false;
DZE_6 = false;
DZE_cancelBuilding = false;
call gear_ui_init;
closeDialog 1;
if (dayz_isSwimming) exitWith {dayz_actionInProgress = false; localize "str_player_26" call dayz_rollingMessages;};
if (_inVehicle) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_42" call dayz_rollingMessages;};
if (_onLadder) exitWith {dayz_actionInProgress = false; localize "str_player_21" call dayz_rollingMessages;};
if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_43" call dayz_rollingMessages;};
_abort = false;
_reason = "";
_index = _this call getDeployableIndex;
_needNear = _index call getDeployableNeedNearBy;
{
switch (_x) do {
case "fire": {
_distance = 3;
_isNear = {inflamed _x} count (getPosATL player nearObjects _distance);
if (_isNear == 0) then {
_abort = true;
_reason = localize "STR_EPOCH_FIRE";
};
};
case "workshop": {
_distance = 3;
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
if (_isNear == 0) then {
_abort = true;
_reason = localize "STR_BLD_name_ItemWorkshop";
};
};
case "fueltank": {
_distance = 30;
_isNear = count (nearestObjects [player, dayz_fuelsources, _distance]);
if (_isNear == 0) then {
_abort = true;
_reason = localize "STR_EPOCH_VEHUP_TNK";
};
};
};
} forEach _needNear;
if (_abort) exitWith {
dayz_actionInProgress = false;
format[localize "str_epoch_player_135",_reason,_distance] call dayz_rollingMessages;
};
_classname = _index call getDeployableClass;
_classnametmp = _classname;
_text = _index call getDeployableDisplay;
if (_index call getDeployableRequirePlot) then {_requireplot = 1;} else {_requireplot = 0;};
_isAllowedUnderGround = 1;
if (isNumber (configFile >> "CfgVehicles" >> _classname >> "nounderground")) then {
_isAllowedUnderGround = getNumber(configFile >> "CfgVehicles" >> _classname >> "nounderground");
};
_offset = _index call getDeployableDistanceOffset;
_distance = DZE_PlotPole select 0;
_needText = localize "str_epoch_player_246";
_canBuild = false;
_nearestPole = objNull;
_ownerID = 0;
_friendlies = [];
_plotcheck = [player, false] call FNC_find_plots;
_distance = DZE_PlotPole select 0;
_IsNearPlot = _plotcheck select 1;
_nearestPole = _plotcheck select 2;
if (_IsNearPlot == 0) then {
if (_requireplot == 0) then {
_canBuild = true;
} else {
_exitWith = localize "STR_EPOCH_PLAYER_135";
};
} else {
if (_requireplot == 0) then {
_canBuild = true;
} else {
_ownerID = _nearestPole getVariable["CharacterID","0"];
if (dayz_characterID == _ownerID) then {
_canBuild = true;
} else {
if (DZE_permanentPlot) then {
_buildcheck = [player, _nearestPole] call FNC_check_access;
_isowner = _buildcheck select 0;
_isfriendly = ((_buildcheck select 1) or (_buildcheck select 3));
if (_isowner || _isfriendly) then {
_canBuild = true;
} else {
_exitWith = localize "STR_EPOCH_PLAYER_134";
};
} else {
_friendlies = player getVariable ["friendlyTo",[]];
if (_ownerID in _friendlies) then {
_canBuild = true;
} else {
_exitWith = localize "STR_EPOCH_PLAYER_134";
};
};
};
};
};
if (!_canBuild) exitWith {dayz_actionInProgress = false; format[_exitWith,_needText,_distance] call dayz_rollingMessages;};
_havePad = false;
if !(isNil "vg_list") then {
if (_className in vg_heliPads) then {
_heliPad = nearestObjects [player,vg_heliPads,vg_distance];
if (count _heliPad > 0) then {
_havePad = true;
};
};
};
if (_havePad) exitWith {
dayz_actionInProgress = false;
systemChat "You already have a heli pad!";
};
_missing = "";
_hasrequireditem = true;
_hastoolweapon = (_index call getDeployableKitClass) in ((weapons player) + (magazines player));
if (!_hastoolweapon) then { _hasrequireditem = false; _missing = (_index call getDeployableKitDisplay); };
_hasbuilditem = [player,_index] call getHasDeployableParts;
if (!_hasbuilditem) exitWith {dayz_actionInProgress = false; format[localize "str_player_31",str (_index call getDeployableParts),"build"] call dayz_rollingMessages; };
if (!_hasrequireditem) exitWith {dayz_actionInProgress = false; format[localize "str_epoch_player_137",_missing] call dayz_rollingMessages; };
if (_hasrequireditem) then {
_dir = getdir player;
_location = getPos player;
_location = [(_location select 0)+8*sin(_dir),(_location select 1)+8*cos(_dir),0];
_isOk = true;
_location1 = getPosATL player;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_object setVehicleLock "LOCKED";
_object setVariable["ObjectUID","1",true];
_object attachTo [player,_offset];
_object setDir _dir;
_position = getPosATL _object;
[localize "str_epoch_player_45",1] call dayz_rollingMessages;
_objHDiff = 0;
while {_isOk} do {
_zheightchanged = false;
_zheightdirection = "";
_rotate = false;
if (DZE_Q) then {
DZE_Q = false;
_zheightdirection = "up";
_zheightchanged = true;
};
if (DZE_Z) then {
DZE_Z = false;
_zheightdirection = "down";
_zheightchanged = true;
};
if (DZE_Q_alt) then {
DZE_Q_alt = false;
_zheightdirection = "up_alt";
_zheightchanged = true;
};
if (DZE_Z_alt) then {
DZE_Z_alt = false;
_zheightdirection = "down_alt";
_zheightchanged = true;
};
if (DZE_Q_ctrl) then {
DZE_Q_ctrl = false;
_zheightdirection = "up_ctrl";
_zheightchanged = true;
};
if (DZE_Z_ctrl) then {
DZE_Z_ctrl = false;
_zheightdirection = "down_ctrl";
_zheightchanged = true;
};
if (DZE_4) then {
_rotate = true;
DZE_4 = false;
_dir = _dir + 30;
};
if (DZE_6) then {
_rotate = true;
DZE_6 = false;
_dir = _dir - 30;
};
if (_rotate) then {
_object setDir _dir;
_object setPosATL _position;
};
if (_zheightchanged) then {
detach _object;
_position = getPosATL _object;
if (_zheightdirection == "up") then {
_position set [2,((_position select 2)+0.1)];
_objHDiff = _objHDiff + 0.1;
};
if (_zheightdirection == "down") then {
_position set [2,((_position select 2)-0.1)];
_objHDiff = _objHDiff - 0.1;
};
if (_zheightdirection == "up_alt") then {
_position set [2,((_position select 2)+1)];
_objHDiff = _objHDiff + 1;
};
if (_zheightdirection == "down_alt") then {
_position set [2,((_position select 2)-1)];
_objHDiff = _objHDiff - 1;
};
if (_zheightdirection == "up_ctrl") then {
_position set [2,((_position select 2)+0.01)];
_objHDiff = _objHDiff + 0.01;
};
if (_zheightdirection == "down_ctrl") then {
_position set [2,((_position select 2)-0.01)];
_objHDiff = _objHDiff - 0.01;
};
if ((_isAllowedUnderGround == 0) && ((_position select 2) < 0)) then {
_position set [2,0];
};
_object setPosATL _position;
_object attachTo [player];
_object setDir _dir;
};
uiSleep 0.5;
_location2 = getPosATL player;
if (DZE_5) exitWith {
_isOk = false;
_position = [_object] call FNC_GetPos;
detach _object;
_dir = getDir _object;
_vector = [(vectorDir _object),(vectorUp _object)];
deleteVehicle _object;
};
if (_location1 distance _location2 > DZE_buildMaxMoveDistance) exitWith {
_isOk = false;
_cancel = true;
_reason = format [localize "STR_EPOCH_BUILD_FAIL_MOVED",DZE_buildMaxMoveDistance];
detach _object;
deleteVehicle _object;
};
if (abs(_objHDiff) > DZE_buildMaxHeightDistance) exitWith {
_isOk = false;
_cancel = true;
_reason = format [localize "STR_EPOCH_BUILD_FAIL_HEIGHT",DZE_buildMaxHeightDistance];
detach _object;
deleteVehicle _object;
};
if (DZE_cancelBuilding) exitWith {
_isOk = false;
_cancel = true;
_reason = localize "STR_EPOCH_PLAYER_46";
detach _object;
deleteVehicle _object;
};
};
if (!(_index call getDeployableBuildOnRoad)) then {if (isOnRoad [_position select 0, _position select 1, 0]) then { _cancel = true; _reason = localize "STR_EPOCH_BUILD_FAIL_ROAD";};};
if (_classname isKindOf "MotorCycle") then {
if (count (nearestObjects [_position, ["Building","DZE_Housebase"], 5]) > 0) then {
_cancel = true;
_reason = format ["%1 can not be built near a wall/door",_text];
};
};
if (!_cancel) then {
_classname = _classnametmp;
_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_tmpbuilt setVehicleLock "LOCKED";
if (!(_index call getDeployableSimulation)) then {
_tmpbuilt enableSimulation false;
};
_tmpbuilt setVariable ["ObjectUID", "1", true];
if (_index call getPermanent) then {
_tmpbuilt setVectorDirAndUp _vector;
} else {
_tmpbuilt setdir _dir; // setdir is incompatible with setVectorDirAndUp and should not be used together on the same object https://community.bistudio.com/wiki/setVectorDirAndUp
};
_location = _position;
if ((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then {
_location set [2,0];
};
_tmpbuilt setPosATL _location;
format[localize "str_epoch_player_138",_text] call dayz_rollingMessages;
_limit = 3;
if (DZE_StaticConstructionCount > 0) then {
_limit = DZE_StaticConstructionCount;
} else {
if (isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then {
_limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount");
};
};
_isOk = true;
_proceed = false;
_counter = 0;
while {_isOk} do {
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
if !((getPlayerUID player) in DZE_DEPLOYABLE_ADMINS) then {
player playActionNow "Medic";
[player,"repair",0,false,20] call dayz_zombieSpeak;
[player,20,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
if (DZE_cancelBuilding) exitWith {
r_doLoop = false;
};
uiSleep 0.1;
};
r_doLoop = false;
} else {
_finished = true;
};
if (!_finished) exitWith {
_isOk = false;
_proceed = false;
};
if (_finished) then {
_counter = _counter + 1;
};
format[localize "str_epoch_player_139",_text, _counter,_limit] call dayz_rollingMessages;
if (_counter == _limit) exitWith {
_isOk = false;
_proceed = true;
};
};
if (_proceed) then {
if ([player,_index] call getHasDeployableParts) then {
[player,_index] call removeDeployableParts;
[format[localize "str_build_01",_text],1] call dayz_rollingMessages;
_tmpbuilt setVariable ["OEMPos",_location,true];
if (_index call getPermanent) then {
_charID = dayz_characterID;
_tmpbuilt setVariable ["CharacterID",_charID,true];
PVDZ_obj_Publish = [_charID,_tmpbuilt,[_dir,_position,dayz_playerUID,_vector],[],player,dayz_authKey];
publicVariableServer "PVDZ_obj_Publish";
};
if (_index call getClearCargo) then {
clearWeaponCargoGlobal _tmpbuilt;
clearMagazineCargoGlobal _tmpbuilt;
};
if (_index call getDeployableClearAmmo) then {
_tmpbuilt setVehicleAmmo 0;
};
_tmpbuilt call fnc_set_temp_deployable_id;
player reveal _tmpbuilt;
_tmpbuilt call fnc_veh_ResetEH;
// for non JIP users this should make sure everyone has eventhandlers for vehicles.
PVDZE_veh_Init = _tmpbuilt;
publicVariable "PVDZE_veh_Init";
_tmpbuilt setVehicleLock "UNLOCKED";
DZE_DEPLOYING_SUCCESSFUL = true;
} else {
deleteVehicle _tmpbuilt;
localize "str_epoch_player_46" call dayz_rollingMessages;
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
deleteVehicle _tmpbuilt;
localize "str_epoch_player_46" call dayz_rollingMessages;
};
} else {
format[localize "str_epoch_player_47",_text,_reason] call dayz_rollingMessages;
};
};
dayz_actionInProgress = false;

View File

@ -0,0 +1,180 @@
/* this sqf file is used to manipulate the deployable array to work more like a class than an array */
/* this gets the item that makes the deployable */
getDeployableKitClass = {
(DZE_DEPLOYABLES select _this) select 0
};
/* this gets the distance of the deployable */
getDeployableDistanceOffset = {
(DZE_DEPLOYABLES select _this) select 1
};
/* this gets the distance a player must be to pack the deployable back up */
getDeployablePackDistance = {
(DZE_DEPLOYABLES select _this) select 2
};
/* if the damage is higher than this, it can't be packed again */
getDamageLimit = {
(DZE_DEPLOYABLES select _this) select 3
};
/* should players be allowed to pack deployables placed by others? */
getDeployablePackOthers = {
(DZE_DEPLOYABLES select _this) select 4
};
/* checks if cargo should be cleared for this item */
getClearCargo = {
(DZE_DEPLOYABLES select _this) select 5
};
/* should vehicle ammo be cleared when spawned? */
getDeployableClearAmmo = {
(DZE_DEPLOYABLES select _this) select 6
};
/* should the vehicle be saved permanently to the database */
getPermanent = {
(DZE_DEPLOYABLES select _this) select 7
};
/* does the deployable require a plot to build ? */
getDeployableRequirePlot = {
(DZE_DEPLOYABLES select _this) select 8
};
/* does the object have simulation enabled? */
getDeployableSimulation = {
(DZE_DEPLOYABLES select _this) select 9
};
/* can the object be built on a road? */
getDeployableBuildOnRoad = {
(DZE_DEPLOYABLES select _this) select 10
};
/* this gets the class of the deployable */
getDeployableClass = {
(DZE_DEPLOYABLES select _this) select 11
};
getDeployableNeedNearBy = {
(DZE_DEPLOYABLES select _this) select 12
};
/* the parts required to make this item */
getDeployableParts = {
(DZE_DEPLOYABLES select _this) select 13
};
/* what condition is used to determine whether or not the player sees the option? */
getDeployableCondition = {
(DZE_DEPLOYABLES select _this) select 14
};
/* should players be allowed to pack deployables at all? */
getDeployablePackAny = {
((_this call getDamageLimit) >= 0) || (!(isNull player) && {dayz_playerUID in DZE_DEPLOYABLE_ADMINS});
};
/* this gets what type of item the kit is*/
getDeployableKitType = {
private["_return"];
if(isClass(configFile >> "CfgWeapons" >> (_this call getDeployableKitClass))) then {
_return = "CfgWeapons";
} else {
_return = "CfgMagazines";
};
_return
};
/* this is a wrapper function for getting the value of the scroll action */
getActionId = {
call compile format["
if (isNil 'DZE_ACTION_DEPLOYABLE_PACK_%1') then {
DZE_ACTION_DEPLOYABLE_PACK_%1 = -1;
};
DZE_ACTION_DEPLOYABLE_PACK_%1
",_this];
};
/* this is a wrapper function for setting the value of the scroll action */
setActionId = {
call compile format["DZE_ACTION_DEPLOYABLE_PACK_%1 = %2;",_this select 0,_this select 1];
};
/* this gets the display name of the kit or falls back to class name if unsuccessful */
getDeployableKitDisplay = {
private["_display"];
_display = getText (configFile >> (_this call getDeployableKitType) >> (_this call getDeployableKitClass) >> "displayName");
if((isNil "_display")||_display == "") then {
_display = (_this call getDeployableKitClass);
};
_display
};
/* this gets the display name of the deployable or falls back to class name if unsuccessful */
getDeployableDisplay = {
private["_display","_class"];
_class = (_this call getDeployableClass);
_display = getText (configFile >> "CfgVehicles" >> _class >> "displayName");
if((isNil "_display")||_display == "") then {
_display = _class;
};
{
if(_class == (_x select 0)) then {
_display = (_x select 1);
};
} forEach DZE_DEPLOYABLE_NAME_MAP;
_display
};
/* looks up the index of a deployable based on the class */
getDeployableIndex = {
private["_return"];
_return = -1;
{
if(_this == (_forEachIndex call getDeployableClass)) then {
_return = _forEachIndex;
}
} forEach DZE_DEPLOYABLES;
_return
};
/* check if player has required parts to build the item */
/* [player,_partIndex] call getHasDeployableParts; */
getHasDeployableParts = {
private["_player","_weapons","_parts","_item","_params","_index","_part","_return","_inventory"];
_params = _this;
_player = _params select 0;
_index = _params select 1;
_parts = _index call getDeployableParts;
_inventory = (weapons _player) + (magazines _player);
_return = true;
{
_part = _x;
if(!(_part in _inventory)) exitWith {_return = false;};
{
_item = _x;
if(_item == _part) exitWith {_inventory set [_forEachIndex,"nil"];};
} forEach _inventory;
} forEach _parts;
_return
};
/* remove this item's parts from the players inventory */
/* [player,_partIndex] call removeDeployableParts; */
removeDeployableParts = {
private["_player","_params","_index","_parts","_part"];
_params = _this;
_player = _params select 0;
_index = _params select 1;
_parts = _index call getDeployableParts;
{
_part = _x;
_player removeWeapon _part;
_player removeMagazine _part;
} forEach _parts;
};

View File

@ -0,0 +1,57 @@
/*
locateVehicle by salival (https://github.com/oiad)
*/
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_characterID","_found","_i","_keyID","_keyIDS","_keyList","_keyName","_keyNames","_locateMarkerDelete","_locateMarkerTime","_marker","_name","_position","_vehicle"];
_keyList = call epoch_tempKeys;
_keyIDS = _keyList select 0;
_keyNames = _keyList select 1;
_locateMarkerDelete = true; // Delete markers after a certain amount of time to avoid cluttering the map?
_locateMarkerTime = 60; // Time in seconds before markers are deleted if enabled above.
_i = 0;
for "_i" from 0 to 60 do {deleteMarkerLocal ("vehicleMarker"+ (str _i));};
if (count _keyIDS < 1) exitWith {dayz_actionInProgress = false; systemChat localize "STR_CL_LV_NO_KEYS";};
_i = 0;
{
_keyID = parseNumber (_keyIDS select _forEachIndex);
_keyName = _keyNames select _forEachIndex;
_found = 0;
{
_vehicle = typeOf _x;
_characterID = parseNumber (_x getVariable ["CharacterID","0"]);
if ((_characterID == _keyID) && {_vehicle isKindOf "Air" || {_vehicle isKindOf "LandVehicle"} || {_vehicle isKindOf "Ship"}}) then {
_found = _found +1;
_i = _i +1;
_position = getPos _x;
_name = getText (configFile >> "CfgVehicles" >> _vehicle >> "displayName");
_marker = createMarkerLocal ["vehicleMarker" + (str _i),[_position select 0,_position select 1]];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "DOT";
_marker setMarkerColorLocal "ColorOrange";
_marker setMarkerSizeLocal [1.0, 1.0];
_marker setMarkerTextLocal format ["%1",_name];
systemChat format[localize "STR_CL_LV_BELONGS",_keyName,_name,if (!alive _x) then {toLower (format [" (%1)",localize "str_artdlg_destroyed"])} else {""}];
};
} forEach vehicles;
if (_found == 0) then {systemChat format[localize "STR_CL_LV_NO_VEHICLES",_keyName]};
} forEach _keyIDS;
if (_i > 0) then {
systemChat format[localize "STR_CL_LV_FOUND",_i];
if (_locateMarkerDelete) then {
_locateMarkerTime spawn {
uiSleep _this;
for "_i" from 0 to 60 do {deleteMarkerLocal ("vehicleMarker"+ (str _i));};
};
};
};
dayz_actionInProgress = false;

View File

@ -0,0 +1,116 @@
/*
DayZ Epoch Client-Side Marker Manager
Author: JasonTM
* Manages map markers locally on each client
* Markers are updated on demand instead of on a server side loop
* Localizes marker text
* JIP: request and create all server side markers
* Mission Start: create the markers for the mission
* Mission Update: update the single marker with text. ex. A.I. counter.
* Mission End: remove all markers
[
position, - 2D or 3D array
createMarker, - String
setMarkerColor, - String
setMarkerType, - String
setMarkerShape, - String
setMarkerBrush, - String
setMarkerSize, - 2D array
setMarkerText, - Array of Strings and Scalar - can be localized.
setMarkerAlpha - Scalar
]
*/
fnc_localizeMarkerText = {
local _text = _this;
{
local _index = _forEachIndex;
if (typeName _x == "ARRAY") then {
{
if (typeName _x == "STRING") then {
if (["STR_",_x] call fnc_inString) then {
(_text select _index) set [_forEachIndex, localize _x];
};
};
} forEach _x;
_text set [_index, format _x];
} else {
if (typeName _x == "STRING") then {
if (["STR_",_x] call fnc_inString) then {
_text set [_index, localize _x];
};
};
};
} forEach _text;
_text = format _text;
_text
};
fnc_markerManager = {
local _option = _this select 0;
local _args = _this select 1; // Always an array except for remove single marker option.
if (_option == "textSingle") exitWith {
(_args select 0) setMarkerTextLocal ((_args select 1) call fnc_localizeMarkerText);
};
if (_option == "removeSingle") exitWith {
deleteMarkerLocal _args;
};
if (_option == "createSingle") exitWith {
deleteMarkerLocal (_args select 1); // delete marker if it exits.
local _marker = createMarkerLocal [(_args select 1),(_args select 0)];
if ((_args select 2) != "") then {_marker setMarkerColorLocal (_args select 2);};
if ((_args select 3) != "") then {_marker setMarkerTypeLocal (_args select 3);};
if ((_args select 4) != "") then {_marker setMarkerShapeLocal (_args select 4);};
if ((_args select 5) != "") then {_marker setMarkerBrushLocal (_args select 5);};
if ( count (_args select 6) > 0) then {_marker setMarkerSizeLocal (_args select 6);};
if ( count (_args select 7) > 0) then {_marker setMarkerTextLocal ((_args select 7) call fnc_localizeMarkerText);};
if ((_args select 8) > 0) then {_marker setMarkerAlphaLocal (_args select 8);};
};
if (_option == "start") exitWith {
{
if (typeName _x == "ARRAY") then {
local _marker = createMarkerLocal [(_x select 1),(_x select 0)];
if ((_x select 2) != "") then {_marker setMarkerColorLocal (_x select 2);};
if ((_x select 3) != "") then {_marker setMarkerTypeLocal (_x select 3);};
if ((_x select 4) != "") then {_marker setMarkerShapeLocal (_x select 4);};
if ((_x select 5) != "") then {_marker setMarkerBrushLocal (_x select 5);};
if (count (_x select 6) > 0) then {_marker setMarkerSizeLocal (_x select 6);};
if ( count (_x select 7) > 0) then {_marker setMarkerTextLocal ((_x select 7) call fnc_localizeMarkerText);};
if ((_x select 8) > 0) then {_marker setMarkerAlphaLocal (_x select 8);};
};
} count _args;
};
if (_option == "end") exitWith {
{
deleteMarkerLocal _x;
} count _args;
};
if (_option == "JIP") exitWith {
for "_i" from 0 to ((count _args) - 1) do {
local _current = _args select _i;
if (typeName _current == "ARRAY") then {
{
if (typeName _x == "ARRAY") then {
local _marker = createMarkerLocal [(_x select 1),(_x select 0)];
if ((_x select 2) != "") then {_marker setMarkerColorLocal (_x select 2);};
if ((_x select 3) != "") then {_marker setMarkerTypeLocal (_x select 3);};
if ((_x select 4) != "") then {_marker setMarkerShapeLocal (_x select 4);};
if ((_x select 5) != "") then {_marker setMarkerBrushLocal (_x select 5);};
if (count (_x select 6) > 0) then {_marker setMarkerSizeLocal (_x select 6);};
if ( count (_x select 7) > 0) then {_marker setMarkerTextLocal ((_x select 7) call fnc_localizeMarkerText);};
if ((_x select 8) > 0) then {_marker setMarkerAlphaLocal (_x select 8);};
};
} count _current;
};
};
};
};
"PVDZ_ServerMarkerSend" addPublicVariableEventHandler {(_this select 1) call fnc_markerManager;};

View File

@ -0,0 +1,304 @@
class rv_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 rv_RscTitle : rv_RscText {
idc = -1;
style = 0;
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {0.95, 0.95, 0.95, 1};
};
class rv_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 = "true";
};
class AttributesImage {
font = "Zeppelin32";
color = "#E5E5E5";
align = "left";
};
soundPush[] = { "", 0, 1 };
soundEnter[] ={ "", 0, 1 };
soundClick[] ={ "", 0, 1 };
soundEscape[] ={ "", 0, 1 };
sound[] ={ "", 0, 1 };
};
class rv_RscButtonMenu : rv_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 = "false";
};
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 rv_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 rv_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 remoteVehicle {
idd = 8800;
name="remoteVehicle";
onLoad = "uiNamespace setVariable ['rv_dialog', _this select 0]";
movingEnabled = 0;
enableSimulation = 1;
class controlsBackground {
class rv_RscTitleBackground : rv_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 : rv_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 VehicleInfoHeader : rv_RscText {
idc = 8830;
text = $STR_CL_RV_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 : rv_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 Title : rv_RscTitle {
idc = 8801;
text = "";
x = 0.1;
y = 0.2;
w = 0.8;
h = (1 / 25);
};
class VehicleList : rv_RscListBox {
idc = 8802;
text = "";
sizeEx = 0.04;
colorBackground[] = {0.1,0.1,0.1,0.9};
onLBSelChanged = "[_this] call rv_vehicleInfo;";
x = 0.11; y = 0.302;
w = 0.35; h = 0.49;
};
class VehicleTitleBox : rv_RscText {
idc = 8804;
text = $STR_CL_RV_VEHICLE_LIST;
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 selectVehicle : rv_RscButtonMenu {
idc = 8850;
text = $STR_CL_RV_SELECT_VEHICLE;
onButtonClick = "rv_isOk = true;closeDialog 0;";
x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = (6.25 / 20);
h = (1 / 25);
};
class vehicleInfomationList : rv_RscStructuredText {
idc = 8803;
text = "";
sizeEx = 0.035;
x = 0.47; y = 0.3;
w = 0.41; h = 0.5;
};
};
};

View File

@ -0,0 +1,157 @@
/*
Remote vehicle script by salival (https://github.com/oiad)
*/
private ["_characterID","_checkDistance","_display","_distance","_fuel","_group","_vehicleFound","_keyID","_keyName","_option","_time","_vehicle","_vehicleType","_index","_control","_keyDisplay","_exit"];
if (isNil "rv_init") then {
rv_vehicleInfo = compile preprocessFileLineNumbers "scripts\remoteVehicle\vehicleInfo.sqf";
rv_init = true;
};
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
_keyName = _this select 0;
_option = _this select 1;
_checkDistance = true; // Check to see if the player is too far away from the remote
_distance = 300; // Maximum distance the player can be away from the vehicle to be able to use the remote.
disableSerialization;
_exit = {
dayz_actionInProgress = false;
rv_vehicleList = nil;
rv_selected = nil;
};
_display = findDisplay 106;
_display closeDisplay 0;
_keyList = call epoch_tempKeys;
_keyID = 0;
_keyID = (_keyList select 0) select ((_keyList select 2) find _keyName);
_foundPos = (_keyList select 0) find _keyID;
if (_foundPos >= 0) then {
_keyDisplay = (_keyList select 1) select _foundPos;
};
if (_foundPos == -1) exitWith {systemChat localize "STR_CL_RV_NO_KEYS"; call _exit;};
rv_vehicleList = [];
_vehicleFound = false;
{
_vehicleType = typeOf _x;
_characterID = _x getVariable ["CharacterID","0"];
if ((_characterID == _keyID) && {_vehicleType isKindOf "Air" || _vehicleType isKindOf "LandVehicle" || _vehicleType isKindOf "Ship"}) then {
_vehicleFound = true;
rv_vehicleList set [count rv_vehicleList,_x];
};
} count vehicles;
if (count rv_vehicleList > 1) then {
rv_isOk = false;
createDialog "remoteVehicle";
_display = uiNamespace getVariable["rv_dialog", displayNull];
_display displayCtrl 8801 ctrlSetText(format[localize "STR_CL_RV_TITLE",_keyDisplay]);
_control = ((findDisplay 8800) displayCtrl 8802);
lbClear _control;
{
_control lbAdd getText(configFile >> "CfgVehicles" >> typeOf _x >> "displayName");
if (!isNull DZE_myVehicle && {local DZE_myVehicle} && {alive DZE_myVehicle} && {DZE_myVehicle == _x}) then {
_control lbSetColor [(lbSize _control)-1,[0, 1, 0, 1]];
};
} count rv_vehicleList;
_control lbSetCurSel 0;
waitUntil {!dialog};
} else {
rv_selected = rv_vehicleList select 0;
rv_isOk = true;
};
if (!rv_isOk) exitWith {call _exit;};
if (!_vehicleFound) exitWith {systemChat localize "STR_CL_RV_NO_VEHICLES"; call _exit;};
_vehicleType = typeOf rv_selected;
_displayName = getText(configFile >> "CfgVehicles" >> _vehicleType >> "displayName");
if (!alive rv_selected) exitWith {systemChat localize "STR_CL_RV_DESTROYED"; call _exit;};
if (_checkDistance && {(player distance rv_selected) >= _distance}) exitWith {format[localize "STR_CL_RV_RANGE_FAIL",_displayName] call dayz_rollingMessages; call _exit;};
if (_option == 1) then {
_group = units group player;
systemChat format[localize "STR_CL_RV_EJECT",_displayName];
{
if !(_x in _group) then {
_x action ["eject",rv_selected];
systemChat format[localize "STR_CL_RV_EJECT_PLAYER",name _x];
};
} forEach (crew rv_selected);
};
if (_option == 2) then {
systemChat format[localize "STR_CL_RV_ENGINE",if (isEngineOn rv_selected) then {localize "strwfoff"} else {localize "strwfon"},_displayName];
if (isEngineOn rv_selected) then {
if (rv_selected isKindOf "Helicopter") then { // This is needed because dayz_engineSwitch won't turn off the engine for a helicopter.
_fuel = fuel rv_selected;
rv_selected setFuel 0;
player action ["engineOff",rv_selected];
uiSleep 4.5;
rv_selected setFuel _fuel;
} else {
[rv_selected,false] call dayz_engineSwitch;
};
} else {
[rv_selected,true] call dayz_engineSwitch;
};
};
if (_option == 3) then {
systemChat format[localize "STR_BLD_UNLOCKED",_displayName];
PVDZE_veh_Lock = [rv_selected,false];
_time = diag_tickTime;
if (local rv_selected) then {
PVDZE_veh_Lock call local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
waitUntil {uiSleep 0.1;(!locked rv_selected or (diag_tickTime - _time > 4))};
};
};
if (_option == 4) then {
systemChat format[localize "STR_EPOCH_PLAYER_117",_displayName];
PVDZE_veh_Lock = [rv_selected,true];
_time = diag_tickTime;
if (local rv_selected) then {
PVDZE_veh_Lock call local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
waitUntil {uiSleep 0.1;(locked rv_selected or (diag_tickTime - _time > 4))};
};
};
if (_option == 5) then {
if !(rv_selected getVariable["vehicleLights",false]) then {
player action ["lightOn", rv_selected];
systemChat format[localize "STR_CL_RV_LIGHTS",localize "strwfon",_vehicleType];
rv_selected setVariable ["vehicleLights",true,true];
} else {
player action ["lightOff", rv_selected];
systemChat format[localize "STR_CL_RV_LIGHTS",localize "strwfoff",_vehicleType];
rv_selected setVariable ["vehicleLights",false,true];
};
};
call _exit;

View File

@ -0,0 +1,54 @@
private ["_backPackCount","_backPackCount_raw","_backPackSlots","_formattedText","_gearCount","_magazineCount","_magazineCount_raw","_magazineSlots","_name","_picture","_price","_text","_typeOf","_weaponSlots","_weaponsCount","_weaponsCount_raw","_control","_index"];
_gearCount = {
private ["_counter"];
_counter = 0;
{_counter = _counter + _x;} count _this;
_counter
};
_control = (_this select 0) select 0;
_index = (_this select 0) select 1;
rv_selected = rv_vehicleList select _index;
_typeOf = typeOf rv_selected;
_weaponsCount_raw = getWeaponCargo rv_selected;
_magazineCount_raw = getMagazineCargo rv_selected;
_backPackCount_raw = getBackpackCargo rv_selected;
_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');
_weaponsCount = (_weaponsCount_raw select 1) call _gearCount;
_magazineCount = (_magazineCount_raw select 1) call _gearCount;
_backPackCount = (_backPackCount_raw select 1) call _gearCount;
_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,
_text
];
((findDisplay 8800) displayCtrl 8803) ctrlSetStructuredText parseText _formattedText;
ctrlShow [8803,true];

View File

@ -0,0 +1,302 @@
/*
File: safe_zones.sqf
Creates safe zones in predefined areas (DZE_SafeZonePosArray)
Author: BigEgg
https://github.com/BigEgg17
*/
private ["_bubbles", "_speedLimit", "_preventTheft", "_timer", "_disableWeps", "_badWeps"];
/**************************************************** Config ****************************************************/
_bubbles = false; // Creates a circle of bubbles marking the circumference of the safe zone.
_speedLimit = 0; // Speed limit in safe zones. Set to 0 to disable speed limit.
_preventTheft = true; // Prevent vehicles from being stolen by assigning them an owner (this includes gear).
_timer = 0; // Delay ending safe zone protection for this many seconds upon leaving. Set to 0 to disable timer.
_disableWeps = false; // Drops any weapons in _badWeps array.
_badWeps = [ // Will remove these weapons from the player if they try to select them. Only used if _disableWeps = true.
"Vil_RPG29", "Vil_RPO_A", "Vil_RPG16", "Vil_RPG7V_PGO", "Vil_Panzerfaust3", "M136", "RPG7V", "vil_CG84T", "vilas_rpg22", "vilas_rpg26", "MAAWS", "Vil_RPG7d_PGO",
"RPG18", "MeleeHatchet", "MeleeCrowbar","MeleeMachete", "MeleeFishingPole", "MeleeSledge", "MeleeBaseBallBatNails", "MeleeBaseBallBatBarbed", "MeleeBaseBallBat"
];
/****************************************************************************************************************/
// Needed on both client and server for vehicle protection
fnc_veh_handleDam2 = fnc_veh_handleDam;
fnc_veh_handleDam = {
if ({(_this select 0) distance (_x select 0) <= (_x select 1)} count DZE_SafeZonePosArray > 0 || {(_this select 0) getVariable ["sz_immunity", false]}) exitWith {0};
_this call fnc_veh_handleDam2;
};
if (isServer && {_bubbles}) then {
private "_count";
_count = 0;
{
private ["_pos", "_rad"];
_pos = _x select 0;
_rad = _x select 1;
for "_i" from 0 to 360 step (1440 / _rad) do
{
private ["_loc", "_obj"];
_loc = [(_pos select 0) + ((cos _i) * _rad), (_pos select 1) + ((sin _i) * _rad), 0];
_obj = "Sign_sphere100cm_EP1" createVehicle [0,0,0];
_obj setPosATL _loc;
_count = _count + 1;
};
} count DZE_SafeZonePosArray;
diag_log format["INFO: Created %1 safe zone bubbles", [_count] call BIS_fnc_numberText];
};
if (!isDedicated) then {
private ["_enter", "_exit"];
safezone_enabled = false;
_enter = {
private "_msg";
safezone_enabled = true;
isInTraderCity = true;
canbuild = false;
safezone_time = diag_tickTime;
if (!DZE_BackpackAntiTheft) then {DZE_BackpackAntiTheft = true;};
_msg = localize "STR_CL_SZ_ENTER";
taskHint [_msg, [0,1,0,1], "taskDone"];
_msg call dayz_rollingMessages;
if (_preventTheft) then {
private "_vehicle";
_vehicle = vehicle player;
if (isNil "fn_gearMenuChecks1") then { // Make sure vehicle gear checks aren't already disabled
fn_gearMenuChecks1 = fn_gearMenuChecks;
};
if (_vehicle != player) then { // Reset owner when entering
if (driver _vehicle == player) then {
private "_owner";
_owner = [];
_owner set [count _owner, getPlayerUID player];
{
if !(getPlayerUID _x in _owner) then {
_owner set [count _owner, getPlayerUID _x];
};
} count (crew _vehicle);
_vehicle setVariable ["Owner", _owner, true];
localize "STR_CL_SZ_OWNER" call dayz_rollingMessages;
};
};
fn_gearMenuChecks = { // Prevent player from accessing gear of vehicles that aren't their's
if (vehicle player == player) then {
private ["_cursorTarget", "_dis"];
disableSerialization;
_display = _this select 0;
_cursorTarget = cursorTarget;
_dis = if (_cursorTarget isKindOf "USEC_ch53_E" || {_cursorTarget isKindOf "MV22"}) then {25} else {12};
if ((player distance _cursorTarget <= _dis) && {_cursorTarget isKindOf "Air" || {_cursorTarget isKindOf "LandVehicle"} || {_cursorTarget isKindOf "Ship"}}) then {
private ["_owner", "_deny"];
_owner = _cursorTarget getVariable ["Owner", []];
// Allow group members of the owner to access gear
_deny = true;
{
if (getPlayerUID _x == (_owner select 0)) exitWith {_deny = false;};
} count (units group player);
if (getPlayerUID player in _owner) then {_deny = false};
if (_deny) then {
_display closeDisplay 2;
localize "STR_CL_SZ_GEAR" call dayz_rollingMessages;
};
};
};
// Pass array on to normal gearMenuChecks
_this call fn_gearMenuChecks1;
};
};
if (isNil "fnc_usec_damageHandler1") then {
fnc_usec_damageHandler1 = fnc_usec_damageHandler;
};
fnc_usec_damageHandler = {0}; // God mode
if (isNil "player_zombieCheck1") then {
player_zombieCheck1 = player_zombieCheck;
};
player_zombieCheck = {false}; // No zombie aggro
if (isNil "player_fired1") then {
player_fired1 = player_fired;
};
player_fired = { // Block firing in safe zone
deleteVehicle (_this select 6);
cutText [localize "STR_CL_SZ_FIRE", "WHITE IN"];
};
[_speedLimit, _disableWeps, _badWeps, _preventTheft] spawn {
while {safezone_enabled} do
{
private "_vehicle";
_vehicle = vehicle player;
if (_this select 1) then {
private "_currentWeapon";
_currentWeapon = currentWeapon player;
if (_currentWeapon in (_this select 2)) then {
player action ["dropWeapon", player, _currentWeapon]; // Drops the weapon and the ammo for it
};
};
if (_vehicle != player) then {
// Speed Limit
if ((_this select 0) > 0) then {
if !(_vehicle isKindOf "Air") then {
private "_speed";
_speed = abs(speed _vehicle);
if (_speed > (_this select 0)) then {
private ["_velocity", "_mod"];
_velocity = velocity _vehicle;
_mod = if (_speed > 50) then {0.1} else {0.8};
_vehicle setVelocity [(_velocity select 0) * _mod, (_velocity select 1) * _mod, (_velocity select 2) * _mod];
};
};
};
// Remove player from vehicle if they lack ownership or aren't in owner's group
if (_this select 3) then {
private ["_owner", "_deny"];
_owner = _vehicle getVariable ["Owner", []];
if (driver _vehicle == player && {count _owner == 0}) then { // Set an owner if one doesn't exist
_owner set [count _owner, getPlayerUID player];
_vehicle setVariable ["Owner", _owner, true];
localize "STR_CL_SZ_OWNER" call dayz_rollingMessages;
};
if (count _owner > 0) then {
_deny = true;
{
if (getPlayerUID _x == (_owner select 0)) exitWith {_deny = false;};
} count (units group player);
if (getPlayerUID player in _owner) then {_deny = false;};
if (_deny) then {
player action ["Eject", _vehicle];
};
};
};
// Prevent player from firing vehicle guns in safe zone
if !(_vehicle getVariable ["safezoneEH", false]) then {
_vehicle setVariable ["safezoneEH", true];
_vehicle addEventHandler ["Fired", {_this call player_fired}];
};
};
// Prevent player from being unconscious in safe zone
{
player setVariable [_x, false, false];
} count ["NORRN_unconscious", "USEC_isCardiac"];
r_player_unconscious = false;
r_player_cardiac = false;
uiSleep 0.1;
};
};
};
_exit = {
private ["_msg", "_time", "_vehicle"];
safezone_enabled = false;
isInTraderCity = false;
canbuild = true;
_msg = localize "STR_CL_SZ_EXIT";
taskHint [_msg, [1,0,0,1], "taskFailed"];
_msg call dayz_rollingMessages;
_time = diag_tickTime - safezone_time;
_vehicle = vehicle player;
if (_timer > 0) then {
if (_time >= 60) then {
if (_vehicle != player) then {
[_vehicle, _timer] spawn {
(_this select 0) setVariable ["sz_immunity", true, true];
uiSleep (_this select 1);
(_this select 0) setVariable ["sz_immunity", false, true];
};
};
for "_x" from _timer to 1 step -1 do
{
[format[localize "STR_CL_SZ_ENDING", _x], 1] call dayz_rollingMessages;
uiSleep 1;
if ({_vehicle distance (_x select 0) <= (_x select 1)} count DZE_SafeZonePosArray > 0) exitWith {};
};
} else {
format[localize "STR_CL_SZ_TIME", round _time] call dayz_rollingMessages;
};
};
localize "STR_CL_SZ_DISABLED" call dayz_rollingMessages;
fnc_usec_damageHandler = fnc_usec_damageHandler1;
player_zombieCheck = player_zombieCheck1;
player_fired = player_fired1;
if (_preventTheft) then {
fn_gearMenuChecks = fn_gearMenuChecks1;
};
if (_vehicle != player) then {
_vehicle setVariable ["safezoneEH", false];
_vehicle removeAllEventHandlers "Fired";
};
};
while {69 == 69} do
{
private "_vehicle";
_vehicle = vehicle player;
if (!safezone_enabled) then {
if ({_vehicle distance (_x select 0) <= (_x select 1)} count DZE_SafeZonePosArray > 0) then {
call _enter;
};
} else {
if !({_vehicle distance (_x select 0) <= (_x select 1)} count DZE_SafeZonePosArray > 0) then {
call _exit;
};
};
uiSleep 1;
};
}

View File

@ -0,0 +1,279 @@
/*
Vehicle Service Point by Axe Cop
Rewritten for single currency, gems, briefcase support and 1.0.7 epoch compatibility by salival - https://github.com/oiad/
Requires DayZ Epoch 1.0.7
This version adds support for both single currency and gems (from the epoch 1.0.7 update) as well as the original epoch briefcase currency system.
Instead of pricing things like the original way, prices are now done on a "worth" similar to how coins are done. The price value of items are below.
1 silver = 1 worth
1 10oz silver = 10 worth
1 gold = 100 worth
1 10oz gold = 1,000 worth
1 briefcase = 10,000 worth
Please see dayz_code\configVariables.sqf for the value of gems (DZE_GemWorthArray) and their relevant worth if they are enabled.
Example config settings for _refuel_costs, _repair_costs and _rearm_costs:
All 3 sections can either be made free, disabled or a specifc price with the following examples:
["Air",_freeText] will make the vehicle config class of "Air" free for the specific action.
["Air",_disabledText] will make the vehicle config class of "Air" disabled for the specific action.
["Air",2000] will make the vehicle config class of "Air" have a worth of 2000 for the specific action.
["Armored_SUV_PMC",2000] will make the specific vehicle have a worth of 2000 for the specific action.
["Armored_SUV_PMC",_freeText] will make the specific vehicle be free for the specific action.
["Armored_SUV_PMC",_disabledText] will make the specific vehicle be disabled for the specific action.
Valid vehicle config classes as an example: "Air", "AllVehicles", "All", "APC", "Bicycle", "Car", "Helicopter", "Land", "Motorcycle", "Plane", "Ship", "Tank"
*/
private ["_folder","_servicePointClasses","_maxDistance","_actionTitleFormat","_actionCostsFormat","_message","_messageShown","_refuel_enable","_refuel_costs","_refuel_updateInterval","_refuel_amount","_repair_enable","_repair_costs","_repair_repairTime","_rearm_enable","_rearm_defaultcost","_rearm_costs","_rearm_magazineCount","_lastVehicle","_lastRole","_fnc_removeActions","_fnc_getCostsWep","_fnc_getCostsWep","_fnc_actionTitle","_fnc_isArmed","_fnc_getWeapons","_rearm_ignore","_cycleTime","_servicePoints","_vehicle","_role","_costs","_actionTitle","_weapons","_weaponName","_disabledText","_freeText"];
diag_log "Service Points: loading config...";
// general settings
_folder = "scripts\servicePoints\"; // folder where the service point scripts are saved, relative to the mission file
_servicePointClasses = ["Map_A_FuelStation_Feed","Land_A_FuelStation_Feed","FuelPump_DZ"]; // service point classes, You can also use dayz_fuelpumparray by its self for all the default fuel pumps.
_maxDistance = 50; // maximum distance from a service point for the options to be shown
_actionTitleFormat = "%1 (%2)"; // text of the vehicle menu, %1 = action name (Refuel, Repair, Rearm), %2 = costs (see format below)
_actionCostsFormat = "%2 %1"; // %1 = item name, %2 = item count
_message = localize "STR_CL_SP_MESSAGE"; // This is translated from your stringtable.xml in your mission folder root. Set to "" to disable
_cycleTime = 5; // Time in sections for how often the action menu will be refreshed and how often it will search for a nearby fuel station (setting this too low can make a lot of lag)
_disabledText = (localize "str_temp_param_disabled"); // Disabled text to show up when items are disabled, DO NOT CHANGE.
_freeText = (localize "strwffree"); // Free text to show up when items are free, DO NOT CHANGE.
// refuel settings
_refuel_enable = true; // enable or disable the refuel option
_refuel_costs = [
["Land",_freeText], // All vehicles are free to refuel.
["Air",1000] //1000 worth is 1 10oz gold for all air vehicles
];
_refuel_updateInterval = 1; // update interval (in seconds)
_refuel_amount = 0.05; // amount of fuel to add with every update (in percent)
// repair settings
_repair_enable = true; // enable or disable the repair option
_repair_repairTime = 2; // time needed to repair each damaged part (in seconds)
_repair_costs = [
["Air",4000], // 4000 worth is 4 10oz gold.
["AllVehicles",2000] // 2000 worth is 2 10oz gold for all other vehicles
];
// rearm settings
_rearm_enable = true; // enable or disable the rearm option
_rearm_defaultcost = 10000; // Default cost to rearm a weapon. (10000 worth == 1 briefcase)
_rearm_magazineCount = 2; // amount of magazines to be added to the vehicle weapon
_rearm_ignore = [(localize "str_dn_horn"),(localize "str_dn_laser_designator")]; // Array of weapon display names that are ignored in the rearm listing.
/*
_ream_costs is an array based on the AMMO type. I.e M240, MK19, PKM, PKT, M134 etc.
You can disable certain ammo types from being able to be rearmed by making the price _disabledText
example: ["M134",_disabledText]
*/
_rearm_costs = [
[(localize "str_mn_40rnd_grad"),_disabledText], // BM-21 Grad is disabled (ammo is broken)
[(localize "str_dn_flarelauncher"),2000], // Flares
[(localize "str_ep1_dn_smokelauncher"),2000], // Smokes
[(localize "str_dn_pk"),5000], // PKM
[(localize "str_dn_pkt"),5000], // PKT
[(localize "str_sn_m134"),5000], // M134
[(localize "str_dn_ags30"),5000], // AGS-30
[(localize "str_dn_dshkm"),5000], // DSHKM
[(localize "str_DN_VIKHR_CCP"),5000], // Vikhr 9A4172
[(localize "str_baf_baf_l94a10"),5000], // L94A1 Chain Gun
[(localize "str_baf_crv70"),5000], // CRV7
[(localize "str_baf_ctws0"),5000], // CTWS
[(localize "str_baf_m621_manual0"),5000], // M621
[(localize "str_dn_2a38m"),5000], // 2A38M Gun
[(localize "str_dn_2a42"),5000], // 2A42
[(localize "str_dn_2a46m"),5000], // 2A46M Cannon
[(localize "str_dn_2a46m_rocket"),5000], // 9M119M Refleks rocket
[(localize "str_dn_2a70"),5000], // 2A70 100mm
[(localize "str_dn_2a70_rocket"),5000], // 9M117M1 Arkan
[(localize "str_dn_2a72"),5000], // 2A72 30mm
[(localize "str_dn_80mmlauncher_burst"),5000], // S-8
[(localize "str_dn_9m311laucher"),5000], // Tunguska 9M311
[(localize "str_dn_ags17"),5000], // AGS-17
[(localize "str_dn_d81"),5000], // D-81
[(localize "str_dn_dt_veh"),5000], // DT
[(localize "str_dn_hellfire"),5000], // AGM-114 Hellfire
[(localize "str_dn_kord"),5000], // KORD
[(localize "str_dn_m197"),5000], // M197
[(localize "str_dn_m240"),5000], // M240
[(localize "str_dn_m242"),5000], // M242
[(localize "str_dn_m256"),5000], // M256
[(localize "str_dn_sidewinderlaucher"),5000], // AIM-9L Sidewinder
[(localize "str_dn_zis_s_53"),5000], // ZiS-S-53
[(localize "str_ep1_dn_57mmlauncher"),5000], // S-5
[(localize "str_ep1_dn_azp85"),5000], // AZP-23
[(localize "str_ep1_dn_ffarlauncher"),5000], // Hydra
[(localize "str_ep1_dn_m2"),5000], // M2 Machinegun
[(localize "str_ep1_dn_m230"),5000], // M230
[(localize "str_ep1_dn_m32_ep1"),5000], // M32
[(localize "str_ep1_dn_mk19"),5000], // Mk19
[(localize "str_ep1_dn_yakb"),5000], // Yak-B
[(localize "str_mn_at2_mi24d"),5000], // Falanga 3M11
[(localize "str_mn_at5_bmp2"),5000], // Konkurs 9M113
[(localize "str_mn_stinger"),5000], // FIM-92F Stinger
[(localize "str_mn_12rnd_mlrs"),5000], // MLRS
[(localize "str_baf_baf_l2a10"),5000], // L111A1
[(localize "STR_DN_D10_CCP"),5000], // D-10
[(localize "str_dn_tow"),5000], // M220 TOW
[(localize "str_dn_zu23"),5000], // ZU-23
[(localize "str_dn_kpvt"),5000], // KPVT
[(localize "str_dn_m3p"),5000], // M3P
[(localize "str_dn_spg9"),5000], // SPG-9
[(localize "str_dn_gau8"),5000], // GAU-8
[(localize "str_dn_maverick"),5000], // AGM-65 Maverick
[(localize "str_dn_gbu12"),5000], // GBU-12
[(localize "str_dn_gau12"),5000], // GAU-12
[(localize "STR_DN_KH29_CCP"),5000], // Kh-29L
[(localize "str_dn_r73"),5000], // R-73
[(localize "str_mn_fab250"),5000], // FAB-250
[(localize "str_dn_gsh301"),5000], // GSh-301
[(localize "str_mn_23mm_gsh23l"),5000], // GSh-23L
[(localize "str_sn_grenade"),5000], // Grenade
[(localize "str_mn_at9_mi24p"),5000], // Ataka-V 9M120
[(localize "str_mn_at6_mi24v"),5000], // Shturm 9K114
["SGMT",5000], // SGMT no localization available
["M68",5000], // M68 no localization available
["GAU-22",5000], // GAU-22 no localization available
["GSh-30",5000], // GSh-30 no localization available
["M60",5000], // M60 no localization available
["GSh-30K",5000] // GSh-30K no localization available
];
_lastVehicle = objNull;
_lastRole = [];
_messageShown = false;
SP_refuel_action = -1;
SP_repair_action = -1;
SP_rearm_actions = [];
_fnc_removeActions = {
if (isNull _lastVehicle) exitWith {};
_lastVehicle removeAction SP_refuel_action;
SP_refuel_action = -1;
_lastVehicle removeAction SP_repair_action;
SP_repair_action = -1;
{
_lastVehicle removeAction _x;
} forEach SP_rearm_actions;
SP_rearm_actions = [];
_lastVehicle = objNull;
_lastRole = [];
};
_fnc_getCosts = {
private ["_getVehicle","_getCosts","_cost","_getTypeName"];
_getVehicle = _this select 0;
_getCosts = _this select 1;
_cost = [];
{
_getTypeName = _x select 0;
if (_getVehicle isKindOf _getTypeName) exitWith {
_cost = _x select 1;
};
} forEach _getCosts;
_cost
};
_fnc_getCostsWep = {
private ["_weapon","_getCostsWep","_returnCostWep","_typeName"];
_weapon = _this select 0;
_getCostsWep = _this select 1;
_returnCostWep = _rearm_defaultcost;
{
_typeName = _x select 0;
if (_weapon == _typeName) exitWith {
_returnCostWep = _x select 1;
};
} forEach _getCostsWep;
_returnCostWep
};
_fnc_actionTitle = {
private ["_actionName","_actionCosts","_costsText","_return"];
_actionName = _this select 0;
_actionCosts = _this select 1;
if (typeName _actionCosts == "STRING") then {
_costsText = _actionCosts;
} else {
_costsText = if (Z_SingleCurrency) then {format ["%1 %2",[_actionCosts] call BIS_fnc_numberText,CurrencyName]} else {format ["%1",[_actionCosts,true] call z_calcCurrency]};
};
_return = format [_actionTitleFormat,_actionName,_costsText];
_return
};
_fnc_getWeapons = {
private ["_gWeaponsVehicle","_gWeaponsRole","_gWeapons","_gWeaponName","_gTurret","_gWeaponsTurret"];
_gWeaponsVehicle = _this select 0;
_gWeaponsRole = _this select 1;
_gWeapons = [];
if (count _gWeaponsRole > 1) then {
_gTurret = _gWeaponsRole select 1;
_gWeaponsTurret = _gWeaponsVehicle weaponsTurret _gTurret;
{
_gWeaponName = getText (configFile >> "CfgWeapons" >> _x >> "displayName");
if !(_gWeaponName in _rearm_ignore) then {
_gWeapons set [count _gWeapons, [_x,_gWeaponName,_gTurret]];
};
} forEach _gWeaponsTurret;
};
_gWeapons
};
while {true} do {
_vehicle = vehicle player;
if (_vehicle != player) then {
_servicePoints = (nearestObjects [getPosATL _vehicle,_servicePointClasses,_maxDistance]) - [_vehicle];
if (count _servicePoints > 0) then {
if (assignedDriver _vehicle == player) then {
_role = ["Driver", [-1]];
} else {
_role = assignedVehicleRole player;
};
if (((str _role) != (str _lastRole)) || {_vehicle != _lastVehicle}) then {
call _fnc_removeActions;
};
_lastVehicle = _vehicle;
_lastRole = _role;
if ((SP_refuel_action < 0) && _refuel_enable) then {
_costs = [_vehicle,_refuel_costs] call _fnc_getCosts;
_actionTitle = [localize "config_depot.sqf8",_costs] call _fnc_actionTitle;
SP_refuel_action = _vehicle addAction [_actionTitle,_folder + "servicePointActions.sqf",["refuel",_costs,_refuel_updateInterval,_refuel_amount],-1,false,true];
};
if ((SP_repair_action < 0) && _repair_enable) then {
_costs = [_vehicle,_repair_costs] call _fnc_getCosts;
_actionTitle = [localize "config_depot.sqf1",_costs] call _fnc_actionTitle;
SP_repair_action = _vehicle addAction [_actionTitle,_folder + "servicePointActions.sqf",["repair",_costs,_repair_repairTime],-1,false,true];
};
if ((count _role > 1) && _rearm_enable && {count SP_rearm_actions == 0}) then {
_weapons = [_vehicle,_role] call _fnc_getWeapons;
{
_weaponName = _x select 1;
_costs = [_weaponName,_rearm_costs] call _fnc_getCostsWep;
_actionTitle = [format["%1 %2",localize "config_depot.sqf5",_weaponName],_costs] call _fnc_actionTitle;
SP_rearm_action = _vehicle addAction [_actionTitle,_folder + "servicePointActions.sqf",["rearm",_costs,_rearm_magazineCount,_x],-1,false,true];
SP_rearm_actions set [count SP_rearm_actions, SP_rearm_action];
} forEach _weapons;
};
if (!_messageShown && {_message != ""}) then {
_messageShown = true;
_vehicle vehicleChat _message;
};
} else {
call _fnc_removeActions;
_messageShown = false;
};
} else {
call _fnc_removeActions;
_messageShown = false;
};
uiSleep _cycleTime;
};

View File

@ -0,0 +1,143 @@
// Vehicle Service Point (Rearm) by Axe Cop
// Rewritten for single currency, gems, briefcase support and 1.0.7 epoch compatibility by salival - https://github.com/oiad/
// Requires DayZ Epoch 1.0.7 for gem support.
private ["_vehicle","_costs","_fuel","_magazineCount","_weapon","_type","_name","_weaponType","_weaponName","_turret","_magazines","_ammo","_textMissing","_pos","_message","_action","_damage","_selection","_strH","_disabled","_amount","_enoughMoney","_moneyInfo","_wealth","_success","_reason","_cmpt"];
_vehicle = _this select 0;
_ammo = "";
_reason = "";
_action = (_this select 3) select 0;
_type = typeOf _vehicle;
_disabled = false;
_name = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_amount = (_this select 3) select 1;
if (_action == "rearm") then {
_magazineCount = (_this select 3) select 2;
_weapon = (_this select 3) select 3;
_weaponType = _weapon select 0;
_weaponName = _weapon select 1;
_turret = _weapon select 2;
};
if (typeName _amount == "STRING") then {
if (_amount == (localize "str_temp_param_disabled")) then {
if (_action == "rearm") then {_reason = format[localize "STR_CL_SP_UNABLE_REARM",_weaponName]; _disabled = true};
if (_action == "repair") then {_reason = format[localize "STR_CL_SP_UNABLE_REPAIR",_name]; _disabled = true};
if (_action == "refuel") then {_reason = format[localize "STR_CL_SP_UNABLE_REFUEL",_name]; _disabled = true};
};
if (_amount == (localize "strwffree")) then {_amount = 0};
};
if (_disabled) exitWith {[_reason,1] call dayz_rollingMessages};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
if (Z_SingleCurrency) then {
_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"}; // Not enough room in gear or bag to accept change
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];
};
[player,(getPosATL player),50,"refuel"] spawn fnc_alertZombies;
_vehicle engineOn false;
if (_action == "refuel") then {
[format[localize "STR_CL_SP_REFUELING",_name],1] call dayz_rollingMessages;
while {vehicle player == _vehicle} do {
if ([0,0,0] distance (velocity _vehicle) > 1) exitWith {[format[localize "STR_CL_SP_REFUELING_STOPPED",_name],1] call dayz_rollingMessages};
_fuel = (fuel _vehicle) + ((_this select 3) select 3);
if (_fuel > 0.99) exitWith {
_vehicle setFuel 1;
[format[localize "STR_CL_SP_REFUEL_OK",_name],1] call dayz_rollingMessages;
};
_vehicle setFuel _fuel;
uiSleep ((_this select 3) select 2);
};
};
if (_action == "repair") then {
[_vehicle,"repair",0,false] call dayz_zombieSpeak;
_hitpoints = _vehicle call vehicle_getHitpoints;
_allRepaired = true;
{
if ((vehicle player != _vehicle) || {[0,0,0] distance (velocity _vehicle) > 1}) exitWith {
_allRepaired = false;
[format[localize "STR_CL_SP_REPAIRING_STOPPED",_name],1] call dayz_rollingMessages;
};
_hits = [_vehicle,_x] call object_getHit;
_damage = _hits select 0;
if (_damage > 0) then {
_cmpt = [];
{
if (_forEachIndex > 2) then {_cmpt set [count _cmpt,_x]};
} forEach toArray (_x);
_cmpt = toString _cmpt;
[format[localize "STR_CL_SP_REPAIRING",_cmpt],1] call dayz_rollingMessages;
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _x >> "name");
_strH = "hit_" + (_selection);
_vehicle setHit[_selection,0];
_vehicle setVariable [_strH,0,true];
uiSleep ((_this select 3) select 2);
};
} forEach _hitpoints;
PVDZ_veh_Save = [_vehicle,"repair",true];
publicVariableServer "PVDZ_veh_Save";
if (_allRepaired) then {
_vehicle setDamage 0;
_vehicle setVelocity [0,0,1];
[format[localize "STR_CL_SP_REPAIR_OK",_name],1] call dayz_rollingMessages;
};
};
if (_action == "rearm") then {
_magazines = getArray (configFile >> "CfgWeapons" >> _weaponType >> "magazines");
_ammo = _magazines select 0;
if (_weaponType == "CMFlareLauncher") then {
_vehicle removeWeaponTurret ["CMFlareLauncher",_turret];
for "_i" from 1 to _magazineCount do {_vehicle addMagazineTurret [_ammo,_turret];};
_vehicle addWeaponTurret ["CMFlareLauncher",_turret];
} else {
{_vehicle removeMagazinesTurret [_x,_turret];} forEach _magazines;
for "_i" from 1 to _magazineCount do {_vehicle addMagazineTurret [_ammo,_turret];};
};
[format[localize "STR_CL_SP_REARMED",_weaponName,_name],1] call dayz_rollingMessages;
};
call player_forceSave;
} 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_SP_FAIL_COINS",[_amount] call BIS_fnc_numberText,_itemText,_action,_name];
} else {
systemChat format[localize "STR_CL_SP_FAIL_BRIEFCASES",_itemText,_action,_name];
};
};

View File

@ -0,0 +1,57 @@
/*
Originally by Zabn
Modified for DayZ Epoch 1.0.7+ by salival (https://github.com/oiad)
*/
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_body","_clothesTaken","_finished","_itemNew","_itemNewName","_okSkin","_playerNear","_result","_skin"];
_body = _this select 3;
player removeAction s_player_clothes;
s_player_clothes = -1;
if (isNull _body) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";};
_playerNear = {isPlayer _x} count (([_body] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
_skin = typeOf _body;
_itemNew = _skin;
switch (_itemNew) do {
case "Survivor3_DZ": {
_itemNew = "Survivor2_DZ";
};
case "Bandit1_DZ": {
_itemNew = "Survivor2_DZ";
};
};
_itemNew = "Skin_" + _itemNew;
_clothesTaken = _body getVariable["clothesTaken",false];
if (_clothesTaken) exitWith {dayz_actionInProgress = false; localize "STR_CL_TC_ALREADY_TAKEN" call dayz_rollingMessages;};
_okSkin = isClass (configFile >> "CfgMagazines" >> _itemNew);
if (!_okSkin) exitWith {dayz_actionInProgress = false; format[localize "STR_CL_TC_NOT_SUPPORTED",_skin] call dayz_rollingMessages;};
_finished = ["Medic",1] call fn_loopAction;
if (_finished) then {
_itemNewName = getText (configFile >> "CfgMagazines" >> _itemNew >> "displayName");
_result = [player,_itemNew] call BIS_fnc_invAdd;
if (_result) then {
_body setVariable["clothesTaken",true,true];
format[localize "STR_CL_TC_ADD_OK",_itemNewName] call dayz_rollingMessages;
} else {
format[localize "STR_CL_TC_ADD_FAIL",_itemNewName] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_26" call dayz_rollingMessages;
};
dayz_actionInProgress = false;

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];
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
if (Z_SingleCurrency) then {
_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,171 @@
// 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 {
_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];
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
if (Z_SingleCurrency) then {
_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 {[player,_keyName,1] call BIS_fnc_invRemove;};
} 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,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,90 @@
// Developed by [GZA] David for German Zombie Apocalypse Servers (https://zombieapo.eu/)
// Rewritten by salival (https://github.com/oiad)
private ["_class","_control","_displayName","_heliPad","_isNearPlot","_itemText","_localVehicles","_plotCheck","_storedVehicles","_vgDisplCtl"];
if (isNil "vg_init") then {
player_getVehicle = compile preprocessFileLineNumbers "scripts\virtualGarage\player_getVehicle.sqf";
player_removePad = compile preprocessFileLineNumbers "scripts\virtualGarage\player_removePad.sqf";
player_storeVehicle = compile preprocessFileLineNumbers "scripts\virtualGarage\player_storeVehicle.sqf";
Player_MaintainVG = compile preprocessFileLineNumbers "scripts\virtualGarage\player_MaintainVG.sqf";
vehicleInfo = compile preprocessFileLineNumbers "scripts\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"];
};
};
vg_init = true;
};
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
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

@ -0,0 +1,68 @@
private ["_backPackCount","_backPackCount_raw","_backPackSlots","_formattedText","_gearCount","_magazineCount","_magazineCount_raw","_magazineSlots","_name","_picture","_price","_text","_typeOf","_weaponSlots","_weaponsCount","_weaponsCount_raw"];
_gearCount = {
private ["_counter"];
_counter = 0;
{_counter = _counter + _x;} count _this;
_counter
};
if (vkc_action == "claim") then {
ctrlShow[4850,true];
_text = localize "STR_CL_VKC_CLAIM";
_price = vkc_claimPrice;
} else {
ctrlShow[4851,true];
_text = localize "STR_CL_VKC_CHANGE";
_price = vkc_changePrice;
};
_typeOf = typeOf vkc_cursorTarget;
_weaponsCount_raw = getWeaponCargo vkc_cursorTarget;
_magazineCount_raw = getMagazineCargo vkc_cursorTarget;
_backPackCount_raw = getBackpackCargo vkc_cursorTarget;
_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');
_weaponsCount = (_weaponsCount_raw select 1) call _gearCount;
_magazineCount = (_magazineCount_raw select 1) call _gearCount;
_backPackCount = (_backPackCount_raw select 1) call _gearCount;
if (!isNil "sk_dualCurrency") then {if (z_singleCurrency) then {_price = _price * 10};};
_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 />" +
"<t color='#33BFFF' size='0.7'>Price to %16: </t><t color='#ffffff' size='0.7'>%17</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,
toLower (_text),
_price
];
((findDisplay 4800) displayCtrl 4803) ctrlSetStructuredText parseText _formattedText;
ctrlShow [4803,true];

View File

@ -0,0 +1,181 @@
/*
Vehicle Key Changer by salival (https://github.com/oiad)
This version adds support for both single currency and gems (from the epoch 1.0.6 update) as well as the original epoch briefcase currency system.
Instead of pricing things like the original way, prices are now done on a "worth" similar to how coins are done. The price value of items are below.
If you are using coins, I would recommend using the _currencyModifier variable since coins typically are 10x the value of briefcase based currency (1 brief == 100,000 coins)
1 silver = 1 worth
1 10oz silver = 10 worth
1 gold = 100 worth
1 10oz gold = 1,000 worth
1 briefcase = 10,000 worth
Please see dayz_code\configVariables.sqf for the value of gems (DZE_GemWorthArray) and their relevant worth if they are enabled.
*/
disableSerialization;
if (isNil "vkc_init") then {
vkc_vehicleInfo = compile preprocessFileLineNumbers "scripts\vkc\vehicleInfo.sqf";
vkc_init = true;
};
private ["_amount","_characterID","_control","_currencyModifier","_enoughMoney","_exit","_foundPos","_index","_itemText","_message","_moneyInfo","_name","_playerNear","_position","_success","_typeOf","_vehicleID","_vehicleUID","_wealth"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
vkc_cursorTarget = (_this select 3) select 0;
_characterID = (_this select 3) select 1;
vkc_action = (_this select 3) select 2;
vkc_isOk = false;
player removeAction s_player_claimVehicle;
s_player_claimVehicle = 1;
player removeAction s_player_copyToKey;
s_player_copyToKey = 1;
_exit = {
vkc_action = nil;
vkc_keyList = nil;
vkc_keyName = nil;
vkc_charID = nil;
vkc_isOk = nil;
vkc_cursorTarget = nil;
s_player_copyToKey = -1;
s_player_claimVehicle = -1;
dayz_actionInProgress = false;
};
_playerNear = {isPlayer _x} count (([vkc_cursorTarget] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
if (_playerNear) exitWith {call _exit; localize "str_pickup_limit_5" call dayz_rollingMessages;};
if (isNull vkc_cursorTarget) exitWith {call _exit; systemChat localize "str_cursorTargetNotFound";};
if !(vkc_cursorTarget isKindOf "Air" || {vkc_cursorTarget isKindOf "LandVehicle"} || {vkc_cursorTarget isKindOf "Ship"}) exitWith {call _exit; localize "STR_CL_VKC_FAIL_CURSOR" call dayz_rollingMessages;};
if (isNull DZE_myVehicle || {!(alive DZE_myVehicle)} || {!(local DZE_myVehicle)}) exitWith {call _exit; localize "str_epoch_player_245" call dayz_rollingMessages;};
_vehicleID = vkc_cursorTarget getVariable ["ObjectID","0"];
_vehicleUID = vkc_cursorTarget getVariable ["ObjectUID","0"];
_typeOf = typeOf vkc_cursorTarget;
_name = getText(configFile >> "cfgVehicles" >> _typeOf >> "displayName");
if ((_vehicleID == "0" && {_vehicleUID == "0"}) || {_vehicleID == "1" || _vehicleUID == "1"}) exitWith {call _exit; format[localize "STR_CL_VKC_FAIL_SUPPORT",_name] call dayz_rollingMessages;};
if (_vehicleUID == "0") then {
_vehicleUID = "";
{
_x = _x * 10;
if (_x < 0) then {_x = _x * -10};
_vehicleUID = _vehicleUID + str(round(_x));
} forEach getPosATL vkc_cursorTarget;
_vehicleUID = _vehicleUID + str(round((getDir vkc_cursorTarget) + time));
vkc_cursorTarget setVariable["ObjectUID",_vehicleUID,true];
};
vkc_keyList = call epoch_tempKeys;
if (vkc_action == "change") then {
_amount = vkc_changePrice;
_message = [localize "STR_CL_VKC_CHANGE_MESSAGE_1",localize "STR_CL_VKC_CHANGE_MESSAGE_2",localize "STR_CL_VKC_CHANGE_MESSAGE_3"];
_foundPos = (vkc_keyList select 0) find _characterID;
if (_foundPos >= 0) then {
vkc_keyList set [0,(vkc_keyList select 0) - [(vkc_keyList select 0) select _foundPos]];
vkc_keyList set [1,(vkc_keyList select 1) - [(vkc_keyList select 1) select _foundPos]];
vkc_keyList set [2,(vkc_keyList select 2) - [(vkc_keyList select 2) select _foundPos]];
} else {
vkc_keyList = [[],[]];
};
} else {
_amount = vkc_claimPrice;
_message = [localize "STR_CL_VKC_CLAIM_MESSAGE_1",localize "STR_CL_VKC_CLAIM_MESSAGE_2",localize "STR_CL_VKC_CLAIM_MESSAGE_3"];
};
if (count (vkc_keyList select 0) == 0) exitWith {systemChat localize "STR_CL_VKC_FAIL_KEYS"; call _exit;};
if (!isNil "sk_dualCurrency") then {if (z_singleCurrency) then {_amount = _amount * 10};};
_itemText = if (Z_SingleCurrency) then {format ["%1 %2",[_amount] call BIS_fnc_numberText,CurrencyName]} else {[_amount,true] call z_calcCurrency};
createDialog "vkc";
{ctrlShow [_x,false]} count [4803,4850,4851];
call vkc_vehicleInfo;
_control = ((findDisplay 4800) displayCtrl 4802);
lbClear _control;
{
_index = _control lbAdd ((vkc_keyList select 1) select _forEachIndex);
_control lbSetPicture [_index,getText(configFile >> "CfgWeapons" >> ((vkc_keyList select 2) select _index) >> "picture")];
} forEach (vkc_keyList select 0);
_control lbSetCurSel 0;
waitUntil {!dialog};
if (!vkc_isOk) exitWith {call _exit;};
if (isNull DZE_myVehicle || {!(alive DZE_myVehicle)} || {!(local DZE_myVehicle)}) exitWith {call _exit; localize "str_epoch_player_245" call dayz_rollingMessages;};
_enoughMoney = false;
_moneyInfo = [false,[],[],[],0];
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
if (Z_SingleCurrency) then {
_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 {call _exit;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];};
vkc_cursorTarget setVehicleLock "LOCKED";
player playActionNow "Medic";
_position = [vkc_cursorTarget] call FNC_GetPos;
[_typeOf,objNull] call fn_waitForObject;
dze_waiting = nil;
PVDZE_veh_Upgrade = [vkc_cursorTarget,[getDir vkc_cursorTarget,_position],_typeOf,vkc_charID,player,dayz_authKey,if (vkc_action == "change") then {"changed the key for"} else {"claimed"}];
publicVariableServer "PVDZE_veh_Upgrade";
localize "STR_CL_VKC_WAIT" call dayz_rollingMessages;
waitUntil {!isNil "dze_waiting"};
if (dze_waiting == "fail") then {
systemChat format[localize "STR_CL_VKC_FAIL_UPGRADE",_name];
if (z_singleCurrency) then {
player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),_wealth,true];
} else {
Z_Selling = true;
_success = [_amount,0,false,0,[],[],false] call Z_returnChange;
};
} else {
{player reveal _x;} count (player nearEntities [["LandVehicle"],10]);
[format[_message select 0,_name,vkc_keyName],1] call dayz_rollingMessages;
};
} else {
systemChat localize "STR_EPOCH_TRADE_DEBUG";
};
} else {
systemChat format[localize "STR_CL_VKC_FAIL_MONEY",_itemText,_message select 1,_name];
};
call _exit;

View File

@ -0,0 +1,315 @@
class vkc_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 vkc_RscTitle : vkc_RscText {
idc = -1;
style = 0;
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {0.95, 0.95, 0.95, 1};
};
class vkc_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 = "true";
};
class AttributesImage {
font = "Zeppelin32";
color = "#E5E5E5";
align = "left";
};
soundPush[] = { "", 0, 1 };
soundEnter[] ={ "", 0, 1 };
soundClick[] ={ "", 0, 1 };
soundEscape[] ={ "", 0, 1 };
sound[] ={ "", 0, 1 };
};
class vkc_RscButtonMenu : vkc_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 = "false";
};
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 vkc_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 vkc_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 vkc {
idd = 4800;
name="vkc";
onload = "player setVariable['isBusy',true,true];";
onUnload = "player setVariable['isBusy',false,true];";
movingEnabled = 0;
enableSimulation = 1;
class controlsBackground {
class vkc_RscTitleBackground : vkc_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 : vkc_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 : vkc_RscTitle {
idc = 4801;
text = $STR_CL_VKC_TITLE;
x = 0.1;
y = 0.2;
w = 0.8;
h = (1 / 25);
};
class VehicleInfoHeader : vkc_RscText {
idc = 4830;
text = $STR_CL_VKC_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 : vkc_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 : vkc_RscListBox {
idc = 4802;
text = "";
sizeEx = 0.04;
colorBackground[] = {0.1,0.1,0.1,0.9};
onLBSelChanged = "vkc_charID = (vkc_keyList select 0) select (lbCurSel 4802);vkc_keyName = (vkc_keyList select 1) select (lbCurSel 4802);";
x = 0.11; y = 0.302;
w = 0.35; h = 0.49;
};
class VehicleTitleBox : vkc_RscText {
idc = 4804;
text = $STR_CL_VKC_KEYS;
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 claimVehicle : vkc_RscButtonMenu {
idc = 4850;
text = $STR_CL_VKC_CLAIM;
onButtonClick = "vkc_isOk = true;closeDialog 0;";
x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = (6.25 / 20);
h = (1 / 25);
};
class changeKey : vkc_RscButtonMenu {
idc = 4851;
text = $STR_CL_VKC_CHANGE;
onButtonClick = "vkc_isOk = true;closeDialog 0;";
x = 0.1 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = (6.25 / 20);
h = (1 / 25);
};
class vehicleInfomationList : vkc_RscStructuredText {
idc = 4803;
text = "";
sizeEx = 0.035;
x = 0.47; y = 0.3;
w = 0.41; h = 0.5;
};
};
};