This commit is contained in:
Illya Marchenko 2023-10-01 20:58:19 +03:00
parent 6268a86c47
commit 6576a3ab6f
53 changed files with 1249 additions and 508 deletions

@ -1,6 +1,6 @@
// Add UIDs and names of Admins and Mods Here. If an admin or mod wants to play with no admin tools, change name in profile. // Add UIDs and names of Admins and Mods Here. If an admin or mod wants to play with no admin tools, change name in profile.
#define SUPER_ADMIN_LIST ["76561198180152023","76500000000000000","76500000000000000"] #define SUPER_ADMIN_LIST ["76561198180152023","76500000000000000","76500000000000000"]
#define SUPER_ADMIN_NAMES ["Stuzer","SuperAdminName","SuperAdminName"] #define SUPER_ADMIN_NAMES ["stuzer05","SuperAdminName","SuperAdminName"]
#define ADMIN_LIST ["76500000000000000","76500000000000000","76500000000000000"] #define ADMIN_LIST ["76500000000000000","76500000000000000","76500000000000000"]
#define ADMIN_NAMES ["AdminName","AdminName","AdminName"] #define ADMIN_NAMES ["AdminName","AdminName","AdminName"]
#define MOD_LIST ["76500000000000000","76500000000000000","76500000000000000"] #define MOD_LIST ["76500000000000000","76500000000000000","76500000000000000"]

@ -20,7 +20,7 @@ DZAI_monitorRate = 300;
//Enable or disable verification and error-correction of classname tables used by DZAI. If invalid entries are found, they are removed and logged into the RPT log. //Enable or disable verification and error-correction of classname tables used by DZAI. If invalid entries are found, they are removed and logged into the RPT log.
//If disabled, any invalid classnames will not be removed and clients may crash if AI bodies with invalid items are looted. Only disable if a previous scan shows no invalid classnames (Default: true). //If disabled, any invalid classnames will not be removed and clients may crash if AI bodies with invalid items are looted. Only disable if a previous scan shows no invalid classnames (Default: true).
DZAI_verifyTables = true; DZAI_verifyTables = false;
//(Feature in development) Enables additional checking and error-correction of certain classname tables. (Default: false) //(Feature in development) Enables additional checking and error-correction of certain classname tables. (Default: false)
DZAI_extendedVerify = false; DZAI_extendedVerify = false;
@ -254,7 +254,7 @@ DZAI_banAIWeapons = [];
//List of launcher-type weapons for mid/high-level AI to use (by default, weapongrade 1/2/3), example: ["M136"]. If left empty, AI will not use launcher weapons. (Default: []) //List of launcher-type weapons for mid/high-level AI to use (by default, weapongrade 1/2/3), example: ["M136"]. If left empty, AI will not use launcher weapons. (Default: [])
//If AI encounter an armored player vehicle, they will switch to a randomly-selected launcher-type weapon to engage. //If AI encounter an armored player vehicle, they will switch to a randomly-selected launcher-type weapon to engage.
//Weapon classnames added here are verified if DZAI_verifyTables is set to true. Note: Launcher weapons are removed from the AI unit upon death. //Weapon classnames added here are verified if DZAI_verifyTables is set to true. Note: Launcher weapons are removed from the AI unit upon death.
DZAI_launcherTypes = [M_Igla_AA, M_AT13_AT, M_Strela_AA, Javelin, BAF_NLAW_Launcher, M47Launcher_EP1, MetisLauncher, SMAW]; DZAI_launcherTypes = ["M_Igla_AA", "M_AT13_AT", "M_Strela_AA", "Javelin", "BAF_NLAW_Launcher", "M47Launcher_EP1", "MetisLauncher", "SMAW"];
//List of AI weapongrades that are permitted to use launcher-type weapons. Individual custom weapongrade levels may be added to allow launcher use (Default: [1,2,3]) //List of AI weapongrades that are permitted to use launcher-type weapons. Individual custom weapongrade levels may be added to allow launcher use (Default: [1,2,3])
DZAI_launcherLevels = [1,2,3]; DZAI_launcherLevels = [1,2,3];

@ -32,7 +32,7 @@ DZMSObjectsDamageOff = false;
DZMSAnnounceType = "TitleText"; DZMSAnnounceType = "TitleText";
// Turn this on to enable troubleshooting. RPT entries might show where problems occur. // Turn this on to enable troubleshooting. RPT entries might show where problems occur.
DZMSDebug = false; DZMSDebug = true;
// Do you want your players to gain or lose humanity from killing mission AI? // Do you want your players to gain or lose humanity from killing mission AI?
DZMSMissHumanity = true; DZMSMissHumanity = true;
@ -62,7 +62,7 @@ DZMSRunGear = false;
// How long before bodies disappear? (in minutes) (default = 30) // How long before bodies disappear? (in minutes) (default = 30)
// Also used by WAI. Make sure they are the same if both are installed. // Also used by WAI. Make sure they are the same if both are installed.
DZE_NPC_CleanUp_Time = 30; DZE_NPC_CleanUp_Time = 40;
// Percentage of AI that must be dead before mission completes (default = 0) // Percentage of AI that must be dead before mission completes (default = 0)
//( 0 is 0% of AI / 0.50 is 50% / 1 is 100% ) //( 0 is 0% of AI / 0.50 is 50% / 1 is 100% )
@ -142,9 +142,9 @@ DZMSMissionArray = [
"Medical_Outpost", // Medical Supplies, Weapons "Medical_Outpost", // Medical Supplies, Weapons
"Weapons_Cache", // Weapons "Weapons_Cache", // Weapons
"Stash_house", // Weapons "Stash_house", // Weapons
"Weapons_Truck" // Weapons "Weapons_Truck", // Weapons
//"SMA1","SMA2","SMA3","SMA4","SMA5","SMA6", "SMA1","SMA2","SMA3","SMA4","SMA5","SMA6",
//"SMI1","SMI2","SMI3","SMI4","SM5I","SMI6" "SMI1","SMI2","SMI3","SMI4","SM5I","SMI6"
]; ];
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////

@ -2,7 +2,7 @@
wai_debug_mode = false; // enable debug wai_debug_mode = false; // enable debug
wai_user_spawnpoints = false; // setting this to true will disable the dynamic mission spawning system and enable server owners to define their own mission spawn points in WAI\configs\spawnpoints.sqf. wai_user_spawnpoints = false; // setting this to true will disable the dynamic mission spawning system and enable server owners to define their own mission spawn points in WAI\configs\spawnpoints.sqf.
wai_use_blacklist = true; // You can edit the blacklist per map in file WAI\configs\blacklist.sqf. wai_use_blacklist = false; // You can edit the blacklist per map in file WAI\configs\blacklist.sqf.
/* END GENERAL CONFIG */ /* END GENERAL CONFIG */

@ -19,36 +19,3 @@ VG_RandomizeMyKey = {
}; };
vg_serverKey = toString (8 call VG_RandomizeMyKey); vg_serverKey = toString (8 call VG_RandomizeMyKey);
vg_alreadySpawned = []; vg_alreadySpawned = [];
VG_ClearTurrets = {
//By denvdmj (probably, I found it on the biki)
private ["_weaponArray","_findRecurse","_class","_obj","_turret","_mags"];
_obj = _this;
_weaponArray = [];
_weaponArray set [count _weaponArray,[-1]];
_findRecurse = {
private ["_root", "_class", "_path", "_currentPath", "_thisThis"];
_root = (_this select 0);
_path = +(_this select 1);
_thisThis = _this select 2;
for "_i" from 0 to count _root -1 do {
_class = _root select _i;
if (isClass _class) then {
_currentPath = _path + [_i];
{_weaponArray set [count _weaponArray, _currentPath];} count getArray (_class >> "weapons");
_class = _class >> "turrets";
if (isClass _class) then {[_class, _currentPath, _thisThis] call _findRecurse;};
};
};
};
[configFile >> "CfgVehicles" >> typeOf (_obj) >> "turrets", [], _this] call _findRecurse;
{
_turret = _x;
_mags = _obj magazinesTurret _turret;
{_obj removeMagazinesTurret[_x,_turret];} count _mags;
} forEach _weaponArray;
};

@ -1,4 +1,4 @@
private ["_isAir","_VG_ObjID","_characterID","_class","_clientID","_clrinit","_clrinit2","_colour","_colour2","_dam","_damage","_dir","_fuel","_hitpoints","_id","_inventory","_key","_location","_message","_object","_oid","_outcome","_player","_result","_selection","_serverKey","_uid","_worldSpace"]; private ["_VG_ObjID","_characterID","_class","_clientID","_clrinit","_clrinit2","_colour","_colour2","_dam","_damage","_dir","_fuel","_hitpoints","_id","_inventory","_key","_location","_message","_object","_oid","_outcome","_player","_result","_selection","_serverKey","_uid","_worldSpace"];
_worldSpace = _this select 0; _worldSpace = _this select 0;
_player = _this select 1; _player = _this select 1;
@ -53,18 +53,17 @@ if (_outcome != "PASS") then {
_object setPos _location; _object setPos _location;
}; };
_object addEventHandler ["HandleDamage",{false}]; _object addEventHandler ["HandleDamage",{0}];
clearWeaponCargoGlobal _object; clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object; clearMagazineCargoGlobal _object;
if (vg_clearAmmo && {vg_serverKey == _serverKey}) then {_object call VG_ClearTurrets;};
_object setFuel _fuel; _object setFuel _fuel;
_object setDamage _damage; _object setDamage _damage;
[_inventory select 0,_inventory select 1,_inventory select 2,_object] call fn_addCargo; [_inventory select 0,_inventory select 1,_inventory select 2,_object] call fn_addCargo;
_object setVariable ["ObjectID", _oid, true]; _object setVariable ["ObjectID", _oid];
_object setVariable ["lastUpdate",diag_tickTime]; _object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["VGObjectID",_VG_ObjID, false]; _object setVariable ["VGObjectID",_VG_ObjID, false];
@ -83,22 +82,19 @@ if (_outcome != "PASS") then {
processInitCommands; processInitCommands;
_characterID = str(_characterID); _characterID = str(_characterID);
_object setVariable ["CharacterID", _characterID, true]; _object setVariable ["CharacterID", _characterID, [true,false] select (_characterID == "0")];
if (_characterID != "0" && !(_object isKindOf "Bicycle")) then {_object setVehicleLock "LOCKED";}; if (_characterID != "0" && !(_object isKindOf "Bicycle")) then {_object setVehicleLock "LOCKED";};
_isAir = _object isKindOf "Air";
{ [_object,_hitpoints] call server_setHitpoints;
_selection = _x select 0;
_dam = _x select 1; [_object,"all",true] call server_updateObject;
_dam = [_x select 1,(_x select 1) min 0.8] select (!_isAir && {_selection in dayZ_explosiveParts});
[_object,_selection,_dam] call fnc_veh_setFixServer; [_object,vg_clearAmmo,false] call fn_vehicleAddons;
} forEach _hitpoints;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object]; dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
_object call fnc_veh_ResetEH; _object call fnc_veh_ResetEH;
{if (_object isKindOf _x) exitWith {_object disableTIEquipment true;}} count vg_disableThermal;
PVDZE_veh_Init = _object; PVDZE_veh_Init = _object;
publicVariable "PVDZE_veh_Init"; publicVariable "PVDZE_veh_Init";

@ -1,4 +1,4 @@
private ["_damageVeh","_VGobjID","_array","_backPack","_backPackCount","_charID","_class","_clientID","_colour","_colour2","_damage","_displayName","_fnc_sanitizeInput","_fuel","_gearCount","_hit","_hitpoints","_index","_inventory","_inventoryCount","_key","_magazine","_magazineCount","_message","_name","_objectID","_objectUID","_player","_playerUID","_selection","_vehicle","_weapons","_weaponsCount","_woGear"]; private ["_damageVeh","_VGobjID","_array","_backPack","_backPackCount","_charID","_class","_clientID","_colour","_colour2","_damage","_displayName","_fuel","_hit","_hitpoints","_index","_inventory","_inventoryCount","_key","_magazine","_magazineCount","_message","_name","_objectID","_objectUID","_player","_playerUID","_selection","_vehicle","_weapons","_weaponsCount","_woGear"];
_vehicle = _this select 0; _vehicle = _this select 0;
_player = _this select 1; _player = _this select 1;
@ -6,31 +6,9 @@ _woGear = _this select 2;
_clientID = owner _player; _clientID = owner _player;
_playerUID = if (count _this > 3) then {_this select 3} else {getPlayerUID _player}; _playerUID = if (count _this > 3) then {_this select 3} else {getPlayerUID _player};
_gearCount = {
private ["_counter"];
_counter = 0;
{_counter = _counter + _x;} count _this;
_counter;
};
_fnc_sanitizeInput = {
private ["_input","_badChars"];
_input = _this;
_input = toArray (_input);
_badChars = [60,62,38,123,125,91,93,59,58,39,96,126,44,46,47,63,124,92,34];
{
_input = _input - [_x];
} forEach _badChars;
_input = toString (_input);
_input
};
_class = typeOf _vehicle; _class = typeOf _vehicle;
_displayName = (getText(configFile >> "cfgVehicles" >> _class >> "displayName")) call _fnc_sanitizeInput; _displayName = [(getText(configFile >> "cfgVehicles" >> _class >> "displayName")),1] call fnc_sanitizeInput;
_name = if (alive _player) then {(name _player) call _fnc_sanitizeInput;} else {"unknown player";}; _name = if (alive _player) then {[(name _player),1] call fnc_sanitizeInput;} else {"unknown player";};
_charID = _vehicle getVariable ["CharacterID","0"]; _charID = _vehicle getVariable ["CharacterID","0"];
_objectID = _vehicle getVariable ["ObjectID","0"]; _objectID = _vehicle getVariable ["ObjectID","0"];
@ -71,9 +49,9 @@ if (!_woGear) then {
_weapons = getWeaponCargo _vehicle; _weapons = getWeaponCargo _vehicle;
_magazine = getMagazineCargo _vehicle; _magazine = getMagazineCargo _vehicle;
_backPack = getBackpackCargo _vehicle; _backPack = getBackpackCargo _vehicle;
_weaponsCount = (_weapons select 1) call _gearCount; _weaponsCount = (_weapons select 1) call fnc_gearCount;
_magazineCount = (_magazine select 1) call _gearCount; _magazineCount = (_magazine select 1) call fnc_gearCount;
_backPackCount = (_backPack select 1) call _gearCount; _backPackCount = (_backPack select 1) call fnc_gearCount;
_inventory = [_weapons, _magazine, _backPack]; _inventory = [_weapons, _magazine, _backPack];
_inventoryCount = [_weaponsCount, _magazineCount, _backPackCount]; _inventoryCount = [_weaponsCount, _magazineCount, _backPackCount];
}; };

@ -2,7 +2,7 @@
changeCode - Safe, Lockbox and Door code changing script by salival (https://github.com/oiad) changeCode - Safe, Lockbox and Door code changing script by salival (https://github.com/oiad)
*/ */
private ["_backpacks","_charID","_characterID","_clientID","_coins","_dir","_holder","_inventory","_key","_lockedClass","_magazines","_message","_name","_object","_objectID","_objectUID","_ownerID","_ownerPUID","_player","_playerUID","_pos","_typeOf","_vector","_weapons","_worldSpace","_clientKey","_exitReason"]; private ["_isZSC","_backpacks","_charID","_characterID","_clientID","_coins","_dir","_holder","_inventory","_key","_lockedClass","_magazines","_message","_name","_object","_objectID","_objectUID","_ownerID","_ownerPUID","_player","_playerUID","_pos","_typeOf","_vector","_weapons","_worldSpace","_clientKey","_exitReason"];
if (count _this < 4) exitWith {diag_log "server_changeCode error: Improper parameter format";}; if (count _this < 4) exitWith {diag_log "server_changeCode error: Improper parameter format";};
@ -15,7 +15,7 @@ _typeOf = typeOf _object;
if !(_typeOf in DZE_unlockedStorage) exitWith {diag_log "server_changeCode called with invalid storage object!"}; if !(_typeOf in DZE_unlockedStorage) exitWith {diag_log "server_changeCode called with invalid storage object!"};
_lockedClass = getText (configFile >> "CfgVehicles" >> _typeOf >> "lockedClass"); _lockedClass = getText (configFile >> "CfgVehicles" >> _typeOf >> "lockedClass");
_pos = _object getVariable ["OEMPos",getPosATL _object]; _pos = getPosATL _object;
_dir = getDir _object; _dir = getDir _object;
_vector = [vectorDir _object, vectorUp _object]; _vector = [vectorDir _object, vectorUp _object];
_charID = _object getVariable ["CharacterID","0"]; _charID = _object getVariable ["CharacterID","0"];
@ -35,30 +35,30 @@ if (_exitReason != "") exitWith {diag_log _exitReason};
_weapons = getWeaponCargo _object; _weapons = getWeaponCargo _object;
_magazines = getMagazineCargo _object; _magazines = getMagazineCargo _object;
_backpacks = getBackpackCargo _object; _backpacks = getBackpackCargo _object;
if (Z_singleCurrency) then {_coins = _object getVariable ["cashMoney",0];}; _isZSC = false;
if (Z_singleCurrency) then {
_isZSC = _typeOf in DZE_MoneyStorageClasses && _lockedClass in DZE_MoneyStorageClasses;
};
if (_isZSC) then {_coins = _object getVariable ["cashMoney",0];};
[_objectID,_objectUID,_object] call server_deleteObjDirect; [_objectID,_objectUID,_object] call server_deleteObjDirect;
_holder = _lockedClass createVehicle [0,0,0]; _holder = _lockedClass createVehicle [0,0,0];
_holder setDir _dir; //_holder setDir _dir; // setdir is incompatible with setVectorDirAndUp and should not be used together on the same object https://community.bistudio.com/wiki/setVectorDirAndUp
_holder setVariable ["memDir",_dir,true]; _holder setVariable ["memDir",_dir,true];
_holder setVectorDirAndUp _vector; _holder setVectorDirAndUp _vector;
_holder setPosATL _pos; _holder setPosATL _pos;
_holder setVariable ["CharacterID",_characterID,true]; _holder setVariable ["CharacterID",_characterID,true];
_holder setVariable ["OEMPos",_pos,true];
if (DZE_permanentPlot) then {
_ownerPUID = if (_charID == "0000" || _charID == "10000") then {_playerUID} else {_ownerID}; _ownerPUID = if (_charID == "0000" || _charID == "10000") then {_playerUID} else {_ownerID};
_worldSpace = [_dir,_pos,_ownerPUID,_vector]; _worldSpace = [_dir,_pos,_ownerPUID,_vector];
_holder setVariable ["ownerPUID",_ownerPUID,true]; _holder setVariable ["ownerPUID",_ownerPUID,true];
} else {
_worldSpace = [_dir,_pos];
};
if (Z_singleCurrency) then {_holder setVariable ["cashMoney",_coins,true];};
if (_isZSC) then {_holder setVariable ["cashMoney",_coins,true];};
_objectUID = _worldSpace call dayz_objectUID2; _objectUID = _worldSpace call dayz_objectUID2;
_holder setVariable ["ObjectUID",_objectUID,true]; _holder setVariable ["ObjectUID",_objectUID];
deleteVehicle _object; deleteVehicle _object;
@ -69,7 +69,7 @@ _holder setVariable ["BackpackCargo",_backpacks,false];
[_characterID,_holder,_worldSpace,_inventory,_player,_clientKey] call server_publishObj; [_characterID,_holder,_worldSpace,_inventory,_player,_clientKey] call server_publishObj;
if (Z_singleCurrency) then { if (_isZSC) then {
_key = format["CHILD:309:%1:",_objectUID] + str _inventory + ":" + str _coins + ":"; _key = format["CHILD:309:%1:",_objectUID] + str _inventory + ":" + str _coins + ":";
_key call server_hiveWrite; _key call server_hiveWrite;
}; };

@ -1,38 +1,33 @@
/* /*
[_objectID,_objectUID,_activatingPlayer,_objPos,dayz_authKey] call server_deleteObj; [netID _activatingPlayer,netID _obj,dayz_authKey] call server_deleteObj;
For PV calls from the client use this function, otherwise if calling directly from the server use server_deleteObjDirect For PV calls from the client use this function, otherwise if calling directly from the server use server_deleteObjDirect
*/ */
private["_id","_uid","_key","_activatingPlayer","_objPos","_clientKey","_exitReason","_PlayerUID","_processDelete"]; if (count _this < 3) exitWith {diag_log "Server_DeleteObj error: Improper parameter format";};
if (count _this < 5) exitWith {diag_log "Server_DeleteObj error: Improper parameter format";}; local _activatingPlayer = objectFromNetID(_this select 0);
_id = _this select 0; local _obj = objectFromNetID(_this select 1);
_uid = _this select 1; local _clientKey = _this select 2;
_activatingPlayer = _this select 2; local _playerUID = getPlayerUID _activatingPlayer;
_objPos = _this select 3; //Can be object or position if _processDelete is false
_clientKey = _this select 4;
_processDelete = [true,_this select 5] select (count _this > 5);
_PlayerUID = getPlayerUID _activatingPlayer;
_exitReason = [_this,"DeleteObj",_objPos,_clientKey,_PlayerUID,_activatingPlayer] call server_verifySender; local _exitReason = [_this,"DeleteObj",_obj,_clientKey,_playerUID,_activatingPlayer] call server_verifySender;
if (_exitReason != "") exitWith {diag_log _exitReason}; if (_exitReason != "") exitWith {diag_log _exitReason};
if (isServer) then { local _id = _obj getVariable ["ObjectID","0"];
if (_processDelete) then {deleteVehicle _objPos}; local _uid = _obj getVariable ["ObjectUID","0"];
_type = typeOf _obj;
if (typeName _objPos != "ARRAY") then { local _processDelete = [true,_this select 3] select (count _this > 3);
_objPos = typeof _objPos; if (_processDelete) then {deleteVehicle _obj};
};
//remove from database //remove from database
if (parseNumber _id > 0) then { if (parseNumber _id > 0) then {
//Send request //Send request
_key = format["CHILD:304:%1:",_id]; _key = format["CHILD:304:%1:",_id];
_key call server_hiveWrite; _key call server_hiveWrite;
diag_log format["DELETE: Player %1(%2) deleted %4 with ID: %3",(_activatingPlayer call fa_plr2str), _PlayerUID, _id, _objPos]; diag_log format["DELETE: Player %1(%2) deleted %4 with ID: %3",(_activatingPlayer call fa_plr2str), _playerUID, _id, _type];
} else { } else {
//Send request //Send request
_key = format["CHILD:310:%1:",_uid]; _key = format["CHILD:310:%1:",_uid];
_key call server_hiveWrite; _key call server_hiveWrite;
diag_log format["DELETE: Player %1(%2) deleted %4 with UID: %3",(_activatingPlayer call fa_plr2str), _PlayerUID, _uid, _objPos]; diag_log format["DELETE: Player %1(%2) deleted %4 with UID: %3",(_activatingPlayer call fa_plr2str), _playerUID, _uid, _type];
};
}; };

@ -1,4 +1,4 @@
private ["_exitReason","_clientKey","_backpacks","_charID","_clientID","_dir","_holder","_lockCode","_lockedClass","_magazines","_name","_obj","_objectID","_objectUID","_ownerID","_packedClass","_player","_playerUID","_pos","_status","_statusText","_type","_unlockedClass","_vector","_weapons","_message","_suppliedCode","_damage","_coins","_wealth"]; private ["_isZSC","_exitReason","_clientKey","_backpacks","_charID","_clientID","_dir","_holder","_lockCode","_lockedClass","_magazines","_name","_obj","_objectID","_objectUID","_ownerID","_packedClass","_player","_playerUID","_pos","_status","_statusText","_type","_unlockedClass","_vector","_weapons","_message","_suppliedCode","_damage","_coins","_wealth"];
_player = _this select 0; _player = _this select 0;
_obj = _this select 1; _obj = _this select 1;
@ -6,7 +6,7 @@ _status = _this select 2;
_name = ["Dead Player",name _player] select (alive _player); _name = ["Dead Player",name _player] select (alive _player);
_type = typeOf _obj; _type = typeOf _obj;
_pos = _obj getVariable ["OEMPos",getPosATL _obj]; _pos = getPosATL _obj;
_dir = direction _obj; _dir = direction _obj;
_vector = [vectorDir _obj, vectorUp _obj]; _vector = [vectorDir _obj, vectorUp _obj];
_charID = _obj getVariable ["CharacterID","0"]; _charID = _obj getVariable ["CharacterID","0"];
@ -51,27 +51,30 @@ if !(_type in DZE_DoorsLocked) then {
if (_exitReason != "") exitWith {diag_log _exitReason}; if (_exitReason != "") exitWith {diag_log _exitReason};
call { call {
_isZSC = false;
if (Z_singleCurrency) then {
_isZSC = _type in DZE_MoneyStorageClasses;
};
if (_status == 0) exitwith { //Unlocking if (_status == 0) exitwith { //Unlocking
_unlockedClass = getText (configFile >> "CfgVehicles" >> _type >> "unlockedClass"); _unlockedClass = getText (configFile >> "CfgVehicles" >> _type >> "unlockedClass");
_weapons = _obj getVariable ["WeaponCargo",[]]; _weapons = _obj getVariable ["WeaponCargo",[]];
_magazines = _obj getVariable ["MagazineCargo",[]]; _magazines = _obj getVariable ["MagazineCargo",[]];
_backpacks = _obj getVariable ["BackpackCargo",[]]; _backpacks = _obj getVariable ["BackpackCargo",[]];
if (Z_singleCurrency) then {_coins = _obj getVariable ["cashMoney",0];}; if (_isZSC && {_unlockedClass in DZE_MoneyStorageClasses}) then {_coins = _obj getVariable ["cashMoney",0];};
_damage = damage _obj; _damage = damage _obj;
// Create new unlocked safe, then delete old locked safe // Create new unlocked safe, then delete old locked safe
_holder = _unlockedClass createVehicle [0,0,0]; _holder = _unlockedClass createVehicle [0,0,0];
_holder setDir _dir; //_holder setDir _dir; // setdir is incompatible with setVectorDirAndUp and should not be used together on the same object https://community.bistudio.com/wiki/setVectorDirAndUp
_holder setVariable ["memDir",_dir,true]; _holder setVariable ["memDir",_dir,true];
_holder setVectorDirAndUp _vector; _holder setVectorDirAndUp _vector;
_holder setPosATL _pos; _holder setPosATL _pos;
_holder setVariable ["CharacterID",_charID,true]; _holder setVariable ["CharacterID",_charID,true];
_holder setVariable ["ObjectID",_objectID,true]; _holder setVariable ["ObjectID",_objectID];
_holder setVariable ["ObjectUID",_objectUID,true]; _holder setVariable ["ObjectUID",_objectUID];
_holder setVariable ["OEMPos",_pos,true];
_holder setDamage _damage; _holder setDamage _damage;
if (DZE_permanentPlot) then {_holder setVariable ["ownerPUID",_ownerID,true];}; _holder setVariable ["ownerPUID",_ownerID,true];
if (Z_singleCurrency) then {_holder setVariable ["cashMoney",_coins,true];}; if (_isZSC && {_unlockedClass in DZE_MoneyStorageClasses}) then {_holder setVariable ["cashMoney",_coins,true];};
deleteVehicle _obj; deleteVehicle _obj;
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo; [_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
@ -84,22 +87,21 @@ call {
_weapons = getWeaponCargo _obj; _weapons = getWeaponCargo _obj;
_magazines = getMagazineCargo _obj; _magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj; _backpacks = getBackpackCargo _obj;
if (Z_singleCurrency) then {_coins = _obj getVariable ["cashMoney",0];}; if (_isZSC && {_lockedClass in DZE_MoneyStorageClasses}) then {_coins = _obj getVariable ["cashMoney",0];};
_damage = damage _obj; _damage = damage _obj;
// Create new locked safe, then delete old unlocked safe // Create new locked safe, then delete old unlocked safe
_holder = _lockedClass createVehicle [0,0,0]; _holder = _lockedClass createVehicle [0,0,0];
_holder setDir _dir; //_holder setDir _dir; // setdir is incompatible with setVectorDirAndUp and should not be used together on the same object https://community.bistudio.com/wiki/setVectorDirAndUp
_holder setVariable ["memDir",_dir,true]; _holder setVariable ["memDir",_dir,true];
_holder setVectorDirAndUp _vector; _holder setVectorDirAndUp _vector;
_holder setPosATL _pos; _holder setPosATL _pos;
_holder setVariable ["CharacterID",_charID,true]; _holder setVariable ["CharacterID",_charID,true];
_holder setVariable ["ObjectID",_objectID,true]; _holder setVariable ["ObjectID",_objectID];
_holder setVariable ["ObjectUID",_objectUID,true]; _holder setVariable ["ObjectUID",_objectUID];
_holder setVariable ["OEMPos",_pos,true];
_holder setDamage _damage; _holder setDamage _damage;
if (DZE_permanentPlot) then {_holder setVariable ["ownerPUID",_ownerID,true];}; _holder setVariable ["ownerPUID",_ownerID,true];
if (Z_singleCurrency) then {_holder setVariable ["cashMoney",_coins,true];}; if (_isZSC && {_lockedClass in DZE_MoneyStorageClasses}) then {_holder setVariable ["cashMoney",_coins,true];};
deleteVehicle _obj; deleteVehicle _obj;
// Local setVariable gear onto new locked safe for easy access on next unlock // Local setVariable gear onto new locked safe for easy access on next unlock
@ -114,7 +116,7 @@ call {
_weapons = getWeaponCargo _obj; _weapons = getWeaponCargo _obj;
_magazines = getMagazineCargo _obj; _magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj; _backpacks = getBackpackCargo _obj;
if (Z_singleCurrency) then {_coins = _obj getVariable ["cashMoney",0];}; if (_isZSC) then {_coins = _obj getVariable ["cashMoney",0];};
_holder = _packedClass createVehicle [0,0,0]; _holder = _packedClass createVehicle [0,0,0];
deleteVehicle _obj; deleteVehicle _obj;
@ -122,7 +124,7 @@ call {
_holder setPosATL _pos; _holder setPosATL _pos;
_holder addMagazineCargoGlobal [getText(configFile >> "CfgVehicles" >> _packedClass >> "seedItem"),1]; _holder addMagazineCargoGlobal [getText(configFile >> "CfgVehicles" >> _packedClass >> "seedItem"),1];
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo; [_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
if (Z_singleCurrency && {_coins > 0}) then { if (_isZSC && {_coins > 0}) then {
private "_displayName"; private "_displayName";
_displayName = getText (configFile >> "CfgVehicles" >> _type >> "displayName"); _displayName = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
@ -140,7 +142,7 @@ call {
if (_status < 4) then { if (_status < 4) then {
_type = call { _type = call {
if (_type in ["VaultStorageLocked","VaultStorage","VaultStorage2Locked","VaultStorage2","TallSafe"]) exitwith { if (_type in ["VaultStorageLocked","VaultStorage","VaultStorage2Locked","VaultStorage2","TallSafe","TallSafeLocked"]) exitwith {
if (_ownerID == _playerUID) then {_lockCode = format["%1 - Owner",_lockCode];}; if (_ownerID == _playerUID) then {_lockCode = format["%1 - Owner",_lockCode];};
"Safe" "Safe"
}; };

@ -1,47 +1,51 @@
/* Maintain Area - written by Skaronator */ /* Maintain Area - written by Skaronator
/* Updated by iben
1: PVDZE_maintainArea = [player,1,[[Object, _objectID, _objectUID],[Object, _objectID, _objectUID]...etc]];
2: PVDZE_maintainArea = [player,2,[Object, _objectID, _objectUID]]; 1: PVDZE_maintainArea = [netID player,1,[netID Object,netID Object,netID Object,...etc]];
2: PVDZE_maintainArea = [netID player,2,[netID Object]];
*/ */
private ["_player","_option","_obj","_name","_objectsInfo","_UID","_ID","_key"]; if ((_this select 1) == 1) exitWith {
_player = _this select 0;
_option = _this select 1;
_objectsInfo = _this select 2;
if (_option == 1) then {
{ {
_obj = _x select 0; local _obj = objectFromNetId _x;
_ID = _x select 1; local _ID = _obj getVariable ["ObjectID", "0"];
_UID = _x select 2;
if (_ID == "0") then { if (_ID == "0") then {
local _UID = _obj getVariable ["ObjectUID", "0"];
if (_UID != "0") then { if (_UID != "0") then {
_obj setDamage 0; _obj setDamage 0;
_key = format["CHILD:397:%1:", _UID]; (format ["CHILD:397:%1:", _UID]) call server_hiveWrite
_key call server_hiveWrite; }
};
} else { } else {
_obj setDamage 0; _obj setDamage 0;
_key = format["CHILD:396:%1:", _ID]; (format ["CHILD:396:%1:", _ID]) call server_hiveWrite
_key call server_hiveWrite; }
} count (_this select 2);
local _player = objectFromNetId (_this select 0);
local _position = getPosATL _player;
diag_log format [
"MAINTAIN AREA BY %1 - %2 Objects at %3, Grid: %4."
,if (alive _player) then {name _player} else {"Dead Player"}
,count (_this select 2), _position, mapGridPosition _position
]
}; };
} count _objectsInfo;
_name = if (alive _player) then { name _player; } else { "Dead Player"; };
diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3, Grid: %4", _name, (count _objectsInfo), (getPosATL _player), mapGridPosition(getPosATL _player)]; local _obj = objectFromNetId ((_this select 2) select 0);
} else { local _ID = _obj getVariable ["ObjectID", "0"];
_obj = _objectsInfo select 0;
_ID = _objectsInfo select 1; if (_ID == "0") exitWith {
_UID = _objectsInfo select 2; local _UID = _obj getVariable ["ObjectUID", "0"];
if (_ID == "0") then {
if (_UID != "0") then { if (_UID != "0") then {
_obj setDamage 0; _obj setDamage 0;
_key = format["CHILD:397:%1:", _UID]; (format ["CHILD:397:%1:", _UID]) call server_hiveWrite
_key call server_hiveWrite; }
}; };
} else {
_obj setDamage 0; _obj setDamage 0;
_key = format["CHILD:396:%1:", _ID]; (format ["CHILD:396:%1:", _ID]) call server_hiveWrite
_key call server_hiveWrite;
};
};

@ -18,7 +18,6 @@ _sourceID = _this select 10;
//Mark player as dead so we bypass the ghost system //Mark player as dead so we bypass the ghost system
dayz_died set [count dayz_died, _playerID]; dayz_died set [count dayz_died, _playerID];
_newObject setVariable ["bodyName",_playerName,true];
_newObject setVariable ["bodyUID",_playerID,true]; _newObject setVariable ["bodyUID",_playerID,true];
_pos = getPosATL _newObject; _pos = getPosATL _newObject;
@ -87,4 +86,3 @@ if (_playerName != "unknown" || {_sourceName != "unknown"}) then {
_newObject setDamage 1; _newObject setDamage 1;
_newObject setOwner 0; _newObject setOwner 0;
//dead_bodyCleanup set [count dead_bodyCleanup,_newObject];

@ -194,8 +194,3 @@ if (count dayz_activeInvites > 0) then {
PVCDZ_plr_PlayerAccepted = [_playerName,diag_ticktime]; PVCDZ_plr_PlayerAccepted = [_playerName,diag_ticktime];
(owner _playerObj) publicVariableClient "PVCDZ_plr_PlayerAccepted"; (owner _playerObj) publicVariableClient "PVCDZ_plr_PlayerAccepted";
if ((count DZE_ServerMarkerArray) > 0) then {
PVDZ_ServerMarkerSend = ["JIP",DZE_ServerMarkerArray];
(owner _playerObj) publicVariableClient "PVDZ_ServerMarkerSend";
};

@ -99,6 +99,7 @@ if (count _medical > 0) then {
_fractures = _medical select 9; _fractures = _medical select 9;
_playerObj setVariable ["hit_legs",(_fractures select 0),true]; _playerObj setVariable ["hit_legs",(_fractures select 0),true];
_playerObj setVariable ["hit_hands",(_fractures select 1),true]; _playerObj setVariable ["hit_hands",(_fractures select 1),true];
_playerObj setVariable ["unconsciousTime",(_medical select 10),true]; _playerObj setVariable ["unconsciousTime",(_medical select 10),true];
_playerObj setVariable ["messing",if (count _medical >= 14) then {(_medical select 13)} else {[0,0,0]},true]; _playerObj setVariable ["messing",if (count _medical >= 14) then {(_medical select 13)} else {[0,0,0]},true];
_playerObj setVariable ["blood_testdone",if (count _medical >= 15) then {(_medical select 14)} else {false},true]; _playerObj setVariable ["blood_testdone",if (count _medical >= 15) then {(_medical select 14)} else {false},true];
@ -114,7 +115,10 @@ if (count _medical > 0) then {
}; };
} else { } else {
//Reset bleeding wounds //Reset bleeding wounds
call fnc_usec_resetWoundPoints; {
_playerObj setVariable["hit_"+_x,false,true];
} forEach USEC_typeOfWounds;
//Reset fractures //Reset fractures
_playerObj setVariable ["hit_legs",0,true]; _playerObj setVariable ["hit_legs",0,true];
_playerObj setVariable ["hit_hands",0,true]; _playerObj setVariable ["hit_hands",0,true];
@ -228,7 +232,6 @@ if (_findIndex > -1) then {
// Sync weather settings for JIP player // Sync weather settings for JIP player
_clientID publicVariableClient "PVDZE_SetWeather"; _clientID publicVariableClient "PVDZE_SetWeather";
//PVCDZ_plr_Login2 = [_worldspace,_state,_randomKey];
PVCDZ_plr_Login2 = [[0,respawn_west_original],_state,_randomKey,_worldspace,_randomSpot,([_randomSpot,_playerID] call spawn_config)]; PVCDZ_plr_Login2 = [[0,respawn_west_original],_state,_randomKey,_worldspace,_randomSpot,([_randomSpot,_playerID] call spawn_config)];
_clientID publicVariableClient "PVCDZ_plr_Login2"; _clientID publicVariableClient "PVCDZ_plr_Login2";
if (dayz_townGenerator) then { if (dayz_townGenerator) then {
@ -240,7 +243,7 @@ _playerObj setVariable ["lastTime",diag_ticktime];
//set server-side inventory variable to monitor player gear //set server-side inventory variable to monitor player gear
if (count _inventory > 2) then { if (count _inventory > 2) then {
_playerObj setVariable["ServerMagArray",[_inventory select 1,_inventory select 2,_inventory select 0], false]; _playerObj setVariable["ServerMagArray",_inventory select 1, false];
}; };
//Record Player Login/LogOut //Record Player Login/LogOut

@ -2,8 +2,7 @@
local _character = _this select 0; local _character = _this select 0;
local _magazines = _this select 1; local _magazines = _this select 1;
local _dayz_onBack = _this select 2; local _dayz_onBack = _character getVariable ["dayz_onBack",""];
local _weaponsPlayer = _this select 3;
local _characterID = _character getVariable ["characterID","0"]; local _characterID = _character getVariable ["characterID","0"];
local _playerUID = getPlayerUID _character; local _playerUID = getPlayerUID _character;
local _charPos = getPosATL _character; local _charPos = getPosATL _character;
@ -41,7 +40,7 @@ local _usec_Dead = _character getVariable ["USEC_isDead",false];
local _lastTime = _character getVariable ["lastTime",-1]; local _lastTime = _character getVariable ["lastTime",-1];
local _modelChk = _character getVariable ["model_CHK",""]; local _modelChk = _character getVariable ["model_CHK",""];
local _temp = round (_character getVariable ["temperature",100]); local _temp = round (_character getVariable ["temperature",100]);
local _lastMagazines = _character getVariable ["ServerMagArray",[[],"",[]]]; local _lastMagazines = _character getVariable ["ServerMagArray",[]];
//Get difference between current stats and stats at last sync //Get difference between current stats and stats at last sync
local _statsDiff = [_character,_playerUID] call server_getStatsDiff; local _statsDiff = [_character,_playerUID] call server_getStatsDiff;
_humanity = _statsDiff select 0; _humanity = _statsDiff select 0;
@ -54,17 +53,12 @@ local _charPosLen = count _charPos;
local _magTemp = []; local _magTemp = [];
if (!isNil "_magazines") then { if (!isNil "_magazines") then {
_playerGear = [_weaponsPlayer,_magazines,_dayz_onBack]; _playerGear = [weapons _character,_magazines,_dayz_onBack];
_character setVariable["ServerMagArray",[_magazines,_dayz_onBack,_weaponsPlayer], false]; _character setVariable["ServerMagArray",_magazines, false];
} else { } else {
//check Magazines everytime they aren't sent by player_forceSave //check Magazines everytime they aren't sent by player_forceSave
_magTemp = (_lastMagazines select 0); _magTemp = _lastMagazines;
if (isNil "_dayz_onBack") then {
_dayz_onBack = _lastMagazines select 1;
};
if (isNil "_weaponsPlayer") then {
_weaponsPlayer = _lastMagazines select 2;
};
if (count _magTemp > 0) then { if (count _magTemp > 0) then {
_magazines = [(magazines _character),20] call array_reduceSize; _magazines = [(magazines _character),20] call array_reduceSize;
{ {
@ -73,7 +67,7 @@ if (!isNil "_magazines") then {
_class = _x select 0; _class = _x select 0;
}; };
if (_class in _magazines) then { if (_class in _magazines) then {
local _MatchedCount = {_compare = if (typeName _x == "ARRAY") then {_x select 0;} else {_x}; _compare == _class} count _magTemp; local _MatchedCount = {local _compare = if (typeName _x == "ARRAY") then {_x select 0;} else {_x}; _compare == _class} count _magTemp;
local _CountedActual = {_x == _class} count _magazines; local _CountedActual = {_x == _class} count _magazines;
if (_MatchedCount > _CountedActual) then { if (_MatchedCount > _CountedActual) then {
_magTemp set [_forEachIndex, "0"]; _magTemp set [_forEachIndex, "0"];
@ -81,16 +75,15 @@ if (!isNil "_magazines") then {
} else { } else {
_magTemp set [_forEachIndex, "0"]; _magTemp set [_forEachIndex, "0"];
}; };
} forEach (_lastMagazines select 0); } forEach _lastMagazines;
_magazines = _magTemp - ["0"]; _magazines = _magTemp - ["0"];
_magazines = [_magazines,_dayz_onBack,_weaponsPlayer];
_character setVariable["ServerMagArray",_magazines, false]; _character setVariable["ServerMagArray",_magazines, false];
_playerGear = [_magazines select 2,_magazines select 0,_magazines select 1]; _playerGear = [weapons _character,_magazines,_dayz_onBack];
} else { } else {
_magazines = [_magTemp,_dayz_onBack,_weaponsPlayer]; _magazines = _magTemp;
}; };
_character setVariable["ServerMagArray",_magazines, false]; _character setVariable["ServerMagArray",_magazines, false];
_playerGear = [_magazines select 2,_magazines select 0,_magazines select 1]; _playerGear = [weapons _character,_magazines,_dayz_onBack];
}; };
//Check if update is requested //Check if update is requested

@ -31,11 +31,12 @@ if ([_object, "Server"] call check_publishobject) then {
if !(_object isKindOf "TrapItems") then { if !(_object isKindOf "TrapItems") then {
if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then { if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then {
_object addEventHandler ["HandleDamage", {false}]; _object addEventHandler ["HandleDamage", {0}];
} else { } else {
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}]; _object addMPEventHandler ["MPKilled",{if !(isServer) exitWith {};_this call vehicle_handleServerKilled;}];
}; };
}; };
// Test disabling simulation server side on buildables only. // Test disabling simulation server side on buildables only.
_object enableSimulation false; _object enableSimulation false;

@ -63,25 +63,25 @@ if (_outcome != "PASS") then {
diag_log("CUSTOM: failed to get id for : " + str(_uid)); diag_log("CUSTOM: failed to get id for : " + str(_uid));
} else { } else {
_oid = _result select 1; _oid = _result select 1;
_object setVariable ["ObjectID", _oid, true]; _object setVariable ["ObjectID", _oid];
#ifdef OBJECT_DEBUG #ifdef OBJECT_DEBUG
diag_log("CUSTOM: Selected " + str(_oid)); diag_log("CUSTOM: Selected " + str(_oid));
#endif #endif
_object setVariable ["lastUpdate",diag_tickTime]; _object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["CharacterID", _characterID, true]; _object setVariable ["CharacterID", _characterID]; // Non key vehicles need no global set CharacterID
_object setDamage _damage; _object setDamage _damage;
{ [_object,_array] call server_setHitpoints;
_selection = _x select 0;
_dam = _x select 1;
if (_selection in dayZ_explosiveParts && _dam > 0.8) then {_dam = 0.8};
[_object,_selection,_dam] call fnc_veh_setFixServer;
} count _array;
_object setFuel _fuel; _object setFuel _fuel;
_object setvelocity [0,0,1]; _object setvelocity [0,0,1];
[_object,"all",true] call server_updateObject;
[_object,DZE_clearVehicleAmmo,DZE_addVehicleAmmo] call fn_vehicleAddons;
_object call fnc_veh_ResetEH; _object call fnc_veh_ResetEH;
PVDZE_veh_Init = _object; PVDZE_veh_Init = _object;

@ -73,15 +73,14 @@ if (_outcome != "PASS") then {
if(!_donotusekey) then { if(!_donotusekey) then {
_object setvehiclelock "locked"; _object setvehiclelock "locked";
//_object setVariable ["MF_Tow_Cannot_Tow",true,true];
}; };
clearWeaponCargoGlobal _object; clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object; clearMagazineCargoGlobal _object;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object]; dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
_object setVariable ["ObjectID", _oid, true]; _object setVariable ["ObjectID", _oid];
_object setVariable ["lastUpdate",diag_tickTime]; _object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["CharacterID", _characterID, true]; _object setVariable ["CharacterID", _characterID,[true,false] select (_donotusekey)]; // Set CharacterID global only for vehicles with a key.
if(DZE_TRADER_SPAWNMODE) then { if(DZE_TRADER_SPAWNMODE) then {
_object attachTo [_object_para, [0,0,-1.6]]; _object attachTo [_object_para, [0,0,-1.6]];
@ -95,8 +94,9 @@ if (_outcome != "PASS") then {
}; };
}; };
[_object,DZE_clearVehicleAmmo,DZE_addVehicleAmmo] call fn_vehicleAddons;
_object call fnc_veh_ResetEH; _object call fnc_veh_ResetEH;
_object setVariable ["Owner", [_playerUID], true];
PVDZE_veh_Init = _object; PVDZE_veh_Init = _object;
publicVariable "PVDZE_veh_Init"; publicVariable "PVDZE_veh_Init";

@ -1,7 +1,7 @@
private ["_coins","_activatingPlayer","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected" private ["_coins","_activatingPlayer","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected"
,"_characterID","_result","_outcome","_oid","_objectID","_objectUID","_newobject","_weapons","_magazines","_backpacks" ,"_characterID","_result","_outcome","_oid","_objectID","_objectUID","_newobject","_weapons","_magazines","_backpacks"
,"_clientKey","_exitReason","_playerUID","_isAir","_fuel","_selection","_dam","_hitpoints","_newHitpoints","_damage" ,"_clientKey","_exitReason","_playerUID","_isAir","_fuel","_selection","_dam","_hitpoints","_newHitpoints","_damage"
,"_hit","_inv","_action","_clearTurrets","_message"]; ,"_hit","_inv"];
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp" #include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
if (count _this < 6) exitWith { if (count _this < 6) exitWith {
@ -16,7 +16,6 @@ _class = _this select 2;
_keySelected = _this select 3; _keySelected = _this select 3;
_activatingPlayer = _this select 4; _activatingPlayer = _this select 4;
_clientKey = _this select 5; _clientKey = _this select 5;
_action = if (count _this > 6) then {_this select 6} else {""};
_playerUID = getPlayerUID _activatingPlayer; _playerUID = getPlayerUID _activatingPlayer;
_characterID = _keySelected; _characterID = _keySelected;
@ -47,7 +46,7 @@ _magazines = getMagazineCargo _object;
_backpacks = getBackpackCargo _object; _backpacks = getBackpackCargo _object;
_inv = [_weapons,_magazines,_backpacks]; _inv = [_weapons,_magazines,_backpacks];
if (Z_SingleCurrency && ZSC_VehicleMoneyStorage) then { if (Z_SingleCurrency && {ZSC_VehicleMoneyStorage}) then {
_coins = _object getVariable ["cashMoney",0]; _coins = _object getVariable ["cashMoney",0];
}; };
@ -67,9 +66,9 @@ diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0; _dir = _worldspace select 0;
_uid = _worldspace call dayz_objectUID2; _uid = _worldspace call dayz_objectUID2;
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, _inv, _newHitpoints, _fuel,_uid]; _key = str formatText["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, _inv, _newHitpoints, _fuel,_uid];
#ifdef OBJECT_DEBUG #ifdef OBJECT_DEBUG
diag_log ("HIVE: WRITE: "+ str(_key)); diag_log ("HIVE: WRITE: "+ _key);
#endif #endif
_key call server_hiveWrite; _key call server_hiveWrite;
@ -94,9 +93,6 @@ if (_outcome != "PASS") then {
diag_log("CUSTOM: Selected " + str(_oid)); diag_log("CUSTOM: Selected " + str(_oid));
#endif #endif
_colour = _object getVariable ["Colour","0"];
_colour2 = _object getVariable ["Colour2","0"];
deleteVehicle _object; deleteVehicle _object;
[_objectID,_objectUID,_object] call server_deleteObjDirect; [_objectID,_objectUID,_object] call server_deleteObjDirect;
@ -107,11 +103,11 @@ if (_outcome != "PASS") then {
// switch var to new vehicle at this point. // switch var to new vehicle at this point.
_object = _newobject; _object = _newobject;
_object setVariable ["ObjectID", _oid, true]; _object setVariable ["ObjectID", _oid];
_object setVariable ["lastUpdate",diag_tickTime]; _object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["CharacterID", _characterID, true]; _object setVariable ["CharacterID", _characterID, [false,true] select (_characterID != "0")];
if (Z_SingleCurrency && ZSC_VehicleMoneyStorage && {_coins > 0}) then { if (Z_SingleCurrency && {ZSC_VehicleMoneyStorage && (_coins > 0)}) then {
_object setVariable ["cashMoney",_coins,true]; _object setVariable ["cashMoney",_coins,true];
}; };
@ -126,80 +122,23 @@ if (_outcome != "PASS") then {
_object setVectorUp surfaceNormal _location; _object setVectorUp surfaceNormal _location;
_object setDamage _damage; _object setDamage _damage;
if (_colour != "0") then {
_object setVariable ["Colour",_colour,true];
_clrinit = format ["#(argb,8,8,3)color(%1)",_colour];
_object setVehicleInit "this setObjectTexture [0,"+str _clrinit+"];";
};
if (_colour2 != "0") then {
_object setVariable ["Colour2",_colour2,true];
_clrinit2 = format ["#(argb,8,8,3)color(%1)",_colour2];
_object setVehicleInit "this setObjectTexture [1,"+str _clrinit2+"];";
};
processInitCommands;
[_weapons,_magazines,_backpacks,_object] call fn_addCargo; [_weapons,_magazines,_backpacks,_object] call fn_addCargo;
_clearTurrets = {
//By denvdmj (probably, I found it on the biki)
private ["_weaponArray","_findRecurse","_class","_obj","_turret","_mags"];
_obj = _this;
_weaponArray = [];
_weaponArray set [count _weaponArray,[-1]];
_findRecurse = {
private ["_root", "_class", "_path", "_currentPath", "_thisThis"];
_root = (_this select 0);
_path = +(_this select 1);
_thisThis = _this select 2;
for "_i" from 0 to count _root -1 do {
_class = _root select _i;
if (isClass _class) then {
_currentPath = _path + [_i];
{_weaponArray set [count _weaponArray, _currentPath];} count getArray (_class >> "weapons");
_class = _class >> "turrets";
if (isClass _class) then {[_class, _currentPath, _thisThis] call _findRecurse;};
};
};
};
[configFile >> "CfgVehicles" >> typeOf (_obj) >> "turrets", [], _this] call _findRecurse;
{
_turret = _x;
_mags = _obj magazinesTurret _turret;
{_obj removeMagazinesTurret[_x,_turret];} count _mags;
} forEach _weaponArray;
};
_isAir = _object isKindOf "Air";
{
_selection = _x select 0;
_dam = [_x select 1,(_x select 1) min 0.8] select (!_isAir && {_selection in dayZ_explosiveParts});
_object setHit [_selection,_dam];
} count _newHitpoints;
_object setFuel _fuel; _object setFuel _fuel;
[_object,_newHitpoints] call server_setHitpoints;
[_object,"all",true] call server_updateObject; [_object,"all",true] call server_updateObject;
[_object,DZE_clearVehicleAmmo,false] call fn_vehicleAddons;
_object call fnc_veh_ResetEH; _object call fnc_veh_ResetEH;
// for non JIP users this should make sure everyone has eventhandlers for vehicles. // for non JIP users this should make sure everyone has eventhandlers for vehicles.
PVDZE_veh_Init = _object; PVDZE_veh_Init = _object;
publicVariable "PVDZE_veh_Init"; publicVariable "PVDZE_veh_Init";
{if (_object isKindOf _x) exitWith {_object disableTIEquipment true;}} count vkc_disableThermal;
if (vkc_clearAmmo) then {_object call _clearTurrets;};
dze_waiting = "success"; dze_waiting = "success";
(owner _activatingPlayer) publicVariableClient "dze_waiting"; (owner _activatingPlayer) publicVariableClient "dze_waiting";
if (_action == "") then { diag_log format["PUBLISH: %1(%2) upgraded %3 with UID %4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,(_location call fa_coor2str)];
_message = format["PUBLISH: %1(%2) upgraded %3 with UID %4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,(_location call fa_coor2str)];
} else {
_message = format["PUBLISH: %1(%2) %6 %3 with UID %4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,(_location call fa_coor2str),_action];
};
diag_log _message;
}; };

@ -0,0 +1,178 @@
private ["_coins","_activatingPlayer","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected"
,"_characterID","_result","_outcome","_oid","_objectID","_objectUID","_newobject","_weapons","_magazines","_backpacks"
,"_clientKey","_exitReason","_playerUID","_isAir","_fuel","_selection","_dam","_hitpoints","_newHitpoints","_damage"
,"_hit","_inv","_action","_clearTurrets","_message"];
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
if (count _this < 6) exitWith {
diag_log "Server_PublishVehicle3 error: Wrong parameter format";
dze_waiting = "fail";
(owner (_this select 4)) publicVariableClient "dze_waiting";
};
_object = _this select 0;
_worldspace = _this select 1;
_class = _this select 2;
_keySelected = _this select 3;
_activatingPlayer = _this select 4;
_clientKey = _this select 5;
_action = if (count _this > 6) then {_this select 6} else {""};
_playerUID = getPlayerUID _activatingPlayer;
_characterID = _keySelected;
_exitReason = [_this,"PublishVehicle3",(_worldspace select 1),_clientKey,_playerUID,_activatingPlayer] call server_verifySender;
if (_exitReason != "") exitWith {
diag_log _exitReason;
dze_waiting = "fail";
(owner _activatingPlayer) publicVariableClient "dze_waiting";
};
if (!(isClass(configFile >> "CfgVehicles" >> _class)) || isNull _object) exitWith {
diag_log ("HIVE-PublishVehicle3 Error: Vehicle does not exist: "+ str(_class));
dze_waiting = "fail";
(owner _activatingPlayer) publicVariableClient "dze_waiting";
};
_objectID = _object getVariable ["ObjectID","0"];
_objectUID = _object getVariable ["ObjectUID","0"];
if (_objectUID == "0") then {
_objectUID = "";
{
_x = _x * 10;
if (_x < 0) then {_x = _x * -10};
_objectUID = _objectUID + str(round(_x));
} forEach getPosATL _object;
_objectUID = _objectUID + str(round((getDir _object) + time));
_object setVariable ["ObjectUID",_objectUID];
};
_location = [_object] call fnc_getPos;
_fuel = fuel _object;
_hitpoints = _object call vehicle_getHitpoints;
_newHitpoints = [];
_damage = damage _object;
// add items from previous vehicle here
_weapons = getWeaponCargo _object;
_magazines = getMagazineCargo _object;
_backpacks = getBackpackCargo _object;
_inv = [_weapons,_magazines,_backpacks];
if (Z_SingleCurrency && {ZSC_VehicleMoneyStorage}) then {
_coins = _object getVariable ["cashMoney",0];
};
{
_hit = [_object,_x] call object_getHit;
if ((_hit select 0) > 0) then {
_newHitpoints set [count _newHitpoints,[(_hit select 1),(_hit select 0)]];
} else {
_newHitpoints set [count _newHitpoints,[(_hit select 1),0]];
};
} count _hitpoints;
#ifdef OBJECT_DEBUG
diag_log ("PUBLISH: Attempt " + str(_object));
#endif
_dir = _worldspace select 0;
_uid = _worldspace call dayz_objectUID2;
_key = str formatText["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, _inv, _newHitpoints, _fuel,_uid];
#ifdef OBJECT_DEBUG
diag_log ("HIVE: WRITE: "+ _key);
#endif
_key call server_hiveWrite;
// GET DB ID
_key = format["CHILD:388:%1:",_uid];
#ifdef OBJECT_DEBUG
diag_log ("HIVE: WRITE: "+ str(_key));
#endif
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if (_outcome != "PASS") then {
diag_log("HIVE-pv3: failed to get id for : " + str(_uid));
_key = format["CHILD:310:%1:",_uid];
_key call server_hiveWrite;
dze_waiting = "fail";
(owner _activatingPlayer) publicVariableClient "dze_waiting";
} else {
_oid = _result select 1;
#ifdef OBJECT_DEBUG
diag_log("CUSTOM: Selected " + str(_oid));
#endif
_colour = _object getVariable ["Colour","0"];
_colour2 = _object getVariable ["Colour2","0"];
deleteVehicle _object;
[_objectID,_objectUID,_object] call server_deleteObjDirect;
uiSleep 3;
_newobject = _class createVehicle [0,0,0];
// switch var to new vehicle at this point.
_object = _newobject;
_object setVariable ["ObjectID", _oid];
_object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["CharacterID", _characterID, true];
if (Z_SingleCurrency && {ZSC_VehicleMoneyStorage && {_coins > 0}}) then {
_object setVariable ["cashMoney",_coins,true];
};
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;
clearBackpackCargoGlobal _object;
_object setDir _dir;
_object setPosATL _location;
_object setVectorUp surfaceNormal _location;
_object setDamage _damage;
if (_colour != "0") then {
_object setVariable ["Colour",_colour,true];
_clrinit = format ["#(argb,8,8,3)color(%1)",_colour];
_object setVehicleInit "this setObjectTexture [0,"+str _clrinit+"];";
};
if (_colour2 != "0") then {
_object setVariable ["Colour2",_colour2,true];
_clrinit2 = format ["#(argb,8,8,3)color(%1)",_colour2];
_object setVehicleInit "this setObjectTexture [1,"+str _clrinit2+"];";
};
processInitCommands;
[_weapons,_magazines,_backpacks,_object] call fn_addCargo;
_object setFuel _fuel;
[_object,_newHitpoints] call server_setHitpoints;
[_object,"all",true] call server_updateObject;
[_object,DZE_clearVehicleAmmo,false] call fn_vehicleAddons;
_object call fnc_veh_ResetEH;
// for non JIP users this should make sure everyone has eventhandlers for vehicles.
PVDZE_veh_Init = _object;
publicVariable "PVDZE_veh_Init";
dze_waiting = "success";
(owner _activatingPlayer) publicVariableClient "dze_waiting";
if (_action == "") then {
_message = format["PUBLISH: %1(%2) upgraded %3 with UID %4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,(_location call fa_coor2str)];
} else {
_message = format["PUBLISH: %1(%2) %6 %3 with UID %4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,(_location call fa_coor2str),_action];
};
diag_log _message;
};

@ -0,0 +1,9 @@
local _obj = _this select 0;
local _hitpoints = _this select 1;
local _isAir = _obj isKindOf "Air";
{
local _selection = _x select 0;
local _dam = [_x select 1,(_x select 1) min 0.8] select (!_isAir && {_selection in dayZ_explosiveParts});
_obj setHit [_selection,_dam];
} count _hitpoints;

@ -1,4 +1,4 @@
private ["_gearClasses","_coins","_class","_uid","_charID","_object","_worldspace","_key","_allowed","_obj","_inv","_objectID","_objectUID","_proceed","_activatingplayer","_clientKey","_exitReason","_playerUID","_weapons","_magazines","_backpacks"]; private ["_setGlobal","_gearClasses","_coins","_class","_uid","_charID","_object","_worldspace","_key","_allowed","_obj","_inv","_objectID","_objectUID","_proceed","_activatingplayer","_clientKey","_exitReason","_playerUID","_weapons","_magazines","_backpacks"];
if (count _this < 8) exitWith {diag_log format ["Server_SwapObject error: Wrong parameter format from player %1",_this select 5];}; if (count _this < 8) exitWith {diag_log format ["Server_SwapObject error: Wrong parameter format from player %1",_this select 5];};
@ -67,10 +67,8 @@ if (!_allowed || !_proceed) exitWith {
}; };
// Publish variables // Publish variables
_object setVariable ["CharacterID",_charID,true]; _setGlobal = [false,true] select ((_class in DZE_isLockedStorageUpgrade) || (_class in DZE_DoorsLocked));
_object setVariable ["CharacterID",_charID,_setGlobal];
//_object setVariable ["ObjectUID",_objectUID,true];
_object setVariable ["OEMPos",(_worldspace select 1),true];
//diag_log ("PUBLISH: Attempt " + str(_object)); //diag_log ("PUBLISH: Attempt " + str(_object));
@ -84,15 +82,15 @@ _key = str formatText["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _cl
_key call server_hiveWrite; _key call server_hiveWrite;
_object setVariable ["lastUpdate",diag_tickTime]; _object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["ObjectUID", _uid,true]; _object setVariable ["ObjectUID", _uid];
// _object setVariable ["CharacterID",_charID,true];
if (DZE_GodModeBase && {!(_class in DZE_GodModeBaseExclude)}) then { if (DZE_GodModeBase && {!(_class in DZE_GodModeBaseExclude)}) then {
_object addEventHandler ["HandleDamage",{false}]; _object addEventHandler ["HandleDamage",{0}];
} else { } else {
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}]; _object addMPEventHandler ["MPKilled",{if !(isServer) exitWith {};_this call vehicle_handleServerKilled;}];
}; };
_gearClasses = ["Wooden_shed2_DZ","WoodShack2_DZ","StorageShed2_DZ","GunRack2_DZ","WoodCrate2_DZ","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4""DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4","TentStorageWinter0","TentStorageWinter1","TentStorageWinter2","TentStorageWinter3","TentStorageWinter4","WinterDomeTentStorage0","WinterDomeTentStorage1","WinterDomeTentStorage2","WinterDomeTentStorage3","WinterDomeTentStorage4"]; _gearClasses = ["Wooden_shed2_DZ","WoodShack2_DZ","StorageShed2_DZ","GunRack2_DZ","WoodCrate2_DZ","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4","TentStorageWinter0","TentStorageWinter1","TentStorageWinter2","TentStorageWinter3","TentStorageWinter4","WinterDomeTentStorage0","WinterDomeTentStorage1","WinterDomeTentStorage2","WinterDomeTentStorage3","WinterDomeTentStorage4"];
if (count _inv > 0 && {_class in _gearClasses}) then { if (count _inv > 0 && {_class in _gearClasses}) then {
[_weapons,_magazines,_backpacks,_object] call fn_addCargo; [_weapons,_magazines,_backpacks,_object] call fn_addCargo;

@ -5,28 +5,27 @@
This is useful to hinder and identify cheaters who attempt mass deletion or creation of hive objects via PVS. This is useful to hinder and identify cheaters who attempt mass deletion or creation of hive objects via PVS.
*/ */
private ["_clientKey","_exitReason","_function","_index","_objPos","_params","_player","_playerUID"]; local _params = _this select 0;
local _function = "Server_" + (_this select 1);
local _objPos = _this select 2; //Can be object or position
local _clientKey = _this select 3;
local _playerUID = _this select 4;
local _player = _this select 5;
local _playerPos = [_player] call fnc_getPos;
_params = _this select 0; local _index = dayz_serverPUIDArray find _playerUID;
_function = "Server_" + (_this select 1);
_objPos = _this select 2; //Can be object or position
_clientKey = _this select 3;
_playerUID = _this select 4;
_player = _this select 5;
_index = dayz_serverPUIDArray find _playerUID; local _exitReason = call {
_exitReason = call {
//If object or player is null distance returns 9999+ //If object or player is null distance returns 9999+
//If object or player was moved with setPos on client, position takes a second to update on server //If object or player was moved with setPos on client, position takes a second to update on server
//Coordinates can be used in place of object //Coordinates can be used in place of object
if (_objPos distance _player > (Z_VehicleDistance + 10)) exitwith { if (_objPos distance _playerPos > (Z_VehicleDistance + 10)) exitwith {
format["%1 error: Verification failed, player is too far from object. Distance: %2m/%3m limit PV ARRAY: %4",_function,round (_objPos distance _player),Z_VehicleDistance + 10,_params] format["%1 error: Verification failed, player is too far from object. Distance: %2m/%3m limit PV ARRAY: %4",_function,round (_objPos distance _playerPos),Z_VehicleDistance + 10,_params]
}; };
if (_index < 0) exitwith { if (_index < 0) exitwith {
format["%1 error: PUID NOT FOUND ON SERVER. PV ARRAY: %2",_function,_params] format["%1 error: PUID NOT FOUND ON SERVER. PV ARRAY: %2",_function,_params]
}; };
if (((dayz_serverClientKeys select _index) select 0 != owner _player) or ((dayz_serverClientKeys select _index) select 1 != _clientKey)) exitwith { if (((dayz_serverClientKeys select _index) select 0 != owner _player) || ((dayz_serverClientKeys select _index) select 1 != _clientKey)) exitwith {
format["%1 error: CLIENT AUTH KEY INCORRECT OR UNRECOGNIZED. PV ARRAY: %2",_function,_params] format["%1 error: CLIENT AUTH KEY INCORRECT OR UNRECOGNIZED. PV ARRAY: %2",_function,_params]
}; };
""; "";

@ -20,5 +20,4 @@ if ((count _position) == 2) then {
_veh enableSimulation false; _veh enableSimulation false;
_veh setDir round(random 360); _veh setDir round(random 360);
_veh setPos _position; _veh setPos _position;
_veh setVariable ["ObjectID","1",true];
}; };

@ -15,7 +15,7 @@ if ((count _position) == 2) then {
_veh enableSimulation false; _veh enableSimulation false;
_veh setDir round(random 360); _veh setDir round(random 360);
_veh setPos _position; _veh setPos _position;
_veh setVariable ["ObjectID","1",true];
_veh addEventHandler ["HandleDamage",{ _veh addEventHandler ["HandleDamage",{
local _damage = _this select 2; local _damage = _this select 2;
if ((_this select 4) == "Sledge_Swing_Ammo") then { if ((_this select 4) == "Sledge_Swing_Ammo") then {

@ -15,5 +15,4 @@ if ((count _position) == 2) then {
_veh enableSimulation false; _veh enableSimulation false;
_veh setDir round(random 360); _veh setDir round(random 360);
_veh setPos _position; _veh setPos _position;
_veh setVariable ["ObjectID","1",true];
}; };

@ -25,7 +25,7 @@ server_obj_inv = {
local _class = _this select 3; local _class = _this select 3;
local _inventory = call { local _inventory = call {
if (DZE_permanentPlot && {_class == "Plastic_Pole_EP1_DZ"}) exitwith { if (_class == "Plastic_Pole_EP1_DZ") exitwith {
_object getVariable ["plotfriends", []] //We're replacing the inventory with UIDs for this item _object getVariable ["plotfriends", []] //We're replacing the inventory with UIDs for this item
}; };
if (DZE_doorManagement && {_class in DZE_DoorsLocked}) exitwith { if (DZE_doorManagement && {_class in DZE_DoorsLocked}) exitwith {
@ -37,7 +37,6 @@ server_obj_inv = {
[getWeaponCargo _object, getMagazineCargo _object, getBackpackCargo _object] [getWeaponCargo _object, getMagazineCargo _object, getBackpackCargo _object]
}; };
local _previous = str(_object getVariable["lastInventory",[]]); local _previous = str(_object getVariable["lastInventory",[]]);
if (str _inventory != _previous) then { if (str _inventory != _previous) then {
local _key = ""; local _key = "";
@ -48,7 +47,7 @@ server_obj_inv = {
_key = format["CHILD:303:%1:",_objectID] + str _inventory + ":"; _key = format["CHILD:303:%1:",_objectID] + str _inventory + ":";
}; };
if (Z_SingleCurrency) then { if (Z_SingleCurrency && {(_class in DZE_MoneyStorageClasses) || {ZSC_VehicleMoneyStorage && (_object isKindOf "AllVehicles") && !(_object isKindOf "StaticWeapon")}}) then {
local _coins = _object getVariable ["cashMoney", -1]; //set to invalid value if getVariable fails to prevent overwriting of coins in DB local _coins = _object getVariable ["cashMoney", -1]; //set to invalid value if getVariable fails to prevent overwriting of coins in DB
_key = _key + str _coins + ":"; _key = _key + str _coins + ":";
}; };

@ -7,11 +7,9 @@
"PVDZ_plr_Login2" addPublicVariableEventHandler {(_this select 1) call server_playerSetup}; "PVDZ_plr_Login2" addPublicVariableEventHandler {(_this select 1) call server_playerSetup};
"PVDZ_plr_LoginRecord" addPublicVariableEventHandler {_id = (_this select 1) spawn dayz_recordLogin}; "PVDZ_plr_LoginRecord" addPublicVariableEventHandler {_id = (_this select 1) spawn dayz_recordLogin};
"PVDZ_obj_Destroy" addPublicVariableEventHandler {(_this select 1) call server_deleteObj}; "PVDZ_obj_Destroy" addPublicVariableEventHandler {(_this select 1) call server_deleteObj};
"PVDZ_plr_Delete" addPublicVariableEventHandler {(_this select 1) spawn sched_co_deleteVehicle}; // Delete hided players "PVDZ_plr_Delete" addPublicVariableEventHandler {(_this select 1) setVariable ["sched_co_fliesDeleted", true];(_this select 1) spawn sched_co_deleteVehicle}; // Delete hided players
"PVDZ_send" addPublicVariableEventHandler {(_this select 1) call server_sendToClient}; "PVDZ_send" addPublicVariableEventHandler {(_this select 1) call server_sendToClient};
//"PVDZ_dayzCarBomb" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\actions\detonate_bomb.sqf";}; //"PVDZ_dayzCarBomb" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\actions\detonate_bomb.sqf";};
//[player,[medical Array]];
"PVDZ_playerMedicalSync" addPublicVariableEventHandler { (_this select 1) call server_medicalSync; ((_this select 1) select 0) setVariable["Medical",((_this select 1) select 1),false]; }; //diag_log format["%1 - %2",((_this select 1) select 0),((_this select 1) select 1)]; };
// EPOCH ADDITIONS // EPOCH ADDITIONS
"PVDZE_maintainArea" addPublicVariableEventHandler {(_this select 1) spawn server_maintainArea}; "PVDZE_maintainArea" addPublicVariableEventHandler {(_this select 1) spawn server_maintainArea};

@ -5,7 +5,7 @@
//List of files in your mission to check. For example, you may want to add 'custom\variables.sqf' etc. //List of files in your mission to check. For example, you may want to add 'custom\variables.sqf' etc.
//Remove any you aren't using //Remove any you aren't using
_files = [ _files = [
'description.ext','init.sqf','mission.sqm','rules.sqf' 'description.ext','init.sqf','mission.sqm','rules.sqf','configVariables.sqf','dayz_code\init\compiles.sqf','dayz_code\init\variables.sqf'
]; ];
_list = []; _list = [];

@ -1,4 +1,3 @@
#include "\z\addons\dayz_server\adminTools\init.sqf"
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp" #include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
waitUntil {!isNil "bis_fnc_init"}; waitUntil {!isNil "bis_fnc_init"};
@ -24,6 +23,7 @@ server_playerSetup = compile preprocessFileLineNumbers "\z\addons\dayz_server\co
server_onPlayerDisconnect = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.sqf"; server_onPlayerDisconnect = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\updateObject_functions.sqf"; call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\updateObject_functions.sqf";
server_updateObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateObject.sqf"; server_updateObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateObject.sqf";
server_setHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_setHitpoints.sqf";
server_playerDied = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDied.sqf"; server_playerDied = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDied.sqf";
server_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf"; //Creates the object in DB server_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf"; //Creates the object in DB
server_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_deleteObj.sqf"; //Removes the object from the DB server_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_deleteObj.sqf"; //Removes the object from the DB
@ -40,7 +40,11 @@ server_verifySender = compile preprocessFileLineNumbers "\z\addons\dayz_server\c
server_swapObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_swapObject.sqf"; //Used to downgrade and upgrade Epoch buildables server_swapObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_swapObject.sqf"; //Used to downgrade and upgrade Epoch buildables
server_publishVeh = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle.sqf"; //Used to spawn random vehicles by server server_publishVeh = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle.sqf"; //Used to spawn random vehicles by server
server_publishVeh2 = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle2.sqf"; //Used to purchase vehicles at traders server_publishVeh2 = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle2.sqf"; //Used to purchase vehicles at traders
if (DZE_VehicleKey_Changer) then {
server_publishVeh3 = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle3_vkc.sqf"; //Used for car upgrades
} else {
server_publishVeh3 = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle3.sqf"; //Used for car upgrades server_publishVeh3 = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle3.sqf"; //Used for car upgrades
};
server_tradeObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.sqf"; server_tradeObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.sqf";
server_deaths = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDeaths.sqf"; server_deaths = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDeaths.sqf";
server_maintainArea = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_maintainArea.sqf"; server_maintainArea = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_maintainArea.sqf";
@ -54,29 +58,9 @@ spawn_ammosupply = compile preprocessFileLineNumbers "\z\addons\dayz_server\comp
spawn_mineveins = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_mineveins.sqf"; spawn_mineveins = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_mineveins.sqf";
spawn_roadblocks = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_roadblocks.sqf"; spawn_roadblocks = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_roadblocks.sqf";
spawn_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.sqf"; spawn_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.sqf";
if (DZE_Virtual_Garage) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\garage\init.sqf"; call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\garage\init.sqf";
fnc_veh_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
server_medicalSync = {
local _player = _this select 0;
local _array = _this select 1;
_player setVariable ["USEC_isDead",(_array select 0)]; //0
_player setVariable ["NORRN_unconscious",(_array select 1)]; //1
_player setVariable ["USEC_infected",(_array select 2)]; //2
_player setVariable ["USEC_injured",(_array select 3)]; //3
_player setVariable ["USEC_inPain",(_array select 4)]; //4
_player setVariable ["USEC_isCardiac",(_array select 5)]; //5
_player setVariable ["USEC_lowBlood",(_array select 6)]; //6
_player setVariable ["USEC_BloodQty",(_array select 7)]; //7
// _wounds; //8
// [_legs,_arms]; //9
_player setVariable ["unconsciousTime",(_array select 10)]; //10
_player setVariable ["blood_type",(_array select 11)]; //11
_player setVariable ["rh_factor",(_array select 12)]; //12
_player setVariable ["messing",(_array select 13)]; //13
_player setVariable ["blood_testdone",(_array select 14)]; //14
}; };
vehicle_handleServerKilled = { vehicle_handleServerKilled = {
@ -99,8 +83,7 @@ check_publishobject = {
diag_log format["DEBUG: Checking if Object: %1 is allowed, published by %2",_object,_playername]; diag_log format["DEBUG: Checking if Object: %1 is allowed, published by %2",_object,_playername];
#endif #endif
if ((typeOf _object) in DayZ_SafeObjects || (_object getVariable ["EAT_Building",0] == 1)) then { if ((typeOf _object) in DayZ_SafeObjects) then {
//if ((typeOf _object) in DayZ_SafeObjects) then {
_allowed = true; _allowed = true;
}; };

@ -4,6 +4,7 @@
For detailed information about these variables see: For detailed information about these variables see:
https://github.com/ebayShopper/ESSV3/blob/master/DOCUMENTATION.md https://github.com/ebayShopper/ESSV3/blob/master/DOCUMENTATION.md
*/ */
class_epoch = isClass (configFile >> "CfgWeapons" >> "Chainsaw");
class_level1 = ["0","0","0"]; class_level1 = ["0","0","0"];
class_level2 = ["0","0","0"]; class_level2 = ["0","0","0"];
class_level3 = ["0","0","0"]; class_level3 = ["0","0","0"];
@ -13,11 +14,11 @@ class_levelCount = 3; //If you add more class levels then increase this number.
// class_level2 = class_level2 + class_level3; // class_level2 = class_level2 + class_level3;
#define VIP_ITEMS "HandRoadFlare","ItemBandage",2,"ItemPainkiller","ItemWaterbottle","FoodPistachio","ItemAntibiotic","ItemBloodbag","ItemEpinephrine","ItemMorphine" // constant example, these can be removed if they are not used below #define VIP_ITEMS "HandRoadFlare","ItemBandage",2,"ItemPainkiller","ItemWaterbottle","FoodPistachio","ItemAntibiotic","ItemBloodbag","ItemEpinephrine","ItemMorphine" // constant example, these can be removed if they are not used below
#define VIP_TOOLS "Binocular_Vector","NVGoggles","ItemCompass","ItemKnife","Itemmatchbox","Itemetool","ItemFlashlightRed","ItemWatch","ItemGPS" #define VIP_TOOLS "Binocular_Vector","NVGoggles","ItemCompass","ItemKnife","ItemMatchbox","Itemetool","ItemFlashlightRed","ItemWatch","ItemGPS"
class_private = [ // These are only visible to players in their respective class levels class_private = [ // These are only visible to players in their respective class levels
["VIP Scout","Camo1_DZ","SurvivorW2_DZ",["30Rnd_556x45_Stanag",2,"15Rnd_9x19_M9SD",3,VIP_ITEMS],["M16A4_ACOG_DZ","M9_SD_DZ","Binocular_Vector"],"DZ_ALICE_Pack_EP1",[],[],1,0,0,"MeleeHatchet"], ["VIP Scout","Camo1_DZ","SurvivorW2_DZ",["30Rnd_556x45_Stanag",2,"15Rnd_9x19_M9SD",3,VIP_ITEMS],["M16A4_ACOG_DZ","M9_SD_DZ","Binocular_Vector"],if (class_epoch) then {"ALICE_Pack_DZE1"} else {"DZ_ALICE_Pack_EP1"},[],[],1,0,0,"MeleeHatchet"],
["VIP Specialist","Rocket_DZ","SurvivorW2_DZ",["100Rnd_762x51_M240",2,"15Rnd_9x19_M9SD",3,VIP_ITEMS],["Mk48_CCO_DZ","M9_SD_DZ","Binocular_Vector"],"DZ_British_ACU",[],[],2,0,0,"MeleeHatchet"], ["VIP Specialist","Rocket_DZ","SurvivorW2_DZ",["100Rnd_762x51_M240",2,"15Rnd_9x19_M9SD",3,VIP_ITEMS],["Mk48_CCO_DZ","M9_SD_DZ","Binocular_Vector"],if (class_epoch) then {"British_ACU_DZE1"} else {"DZ_British_ACU"},[],[],2,0,0,"MeleeHatchet"],
["VIP Sniper","Sniper1_DZ","SurvivorW2_DZ",["20Rnd_762x51_DMR",2,"15Rnd_9x19_M9SD",3,VIP_ITEMS],["DMR_DZ","M9_SD_DZ","Binocular_Vector"],"DZ_Backpack_EP1",[],[],3,0,0,"MeleeHatchet"] ["VIP Sniper","Sniper1_DZ","SurvivorW2_DZ",["20Rnd_762x51_DMR",2,"15Rnd_9x19_M9SD",3,VIP_ITEMS],["DMR_DZ","M9_SD_DZ","Binocular_Vector"],if (class_epoch) then {"CoyoteBackpack_DZE1"} else {"DZ_Backpack_EP1"},[],[],3,0,0,"MeleeHatchet"]
]; ];
class_customLoadout = [ class_customLoadout = [
"12345678900000000", // ebay "12345678900000000", // ebay

@ -42,8 +42,6 @@ for "_i" from 1 to (SPAWN_NUM) do
//_vehicle = createVehicle [_class, _position, [], 0, "CAN_COLLIDE"]; //_vehicle = createVehicle [_class, _position, [], 0, "CAN_COLLIDE"];
_vehicle = _class createVehicle _position; _vehicle = _class createVehicle _position;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _vehicle]; dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _vehicle];
_vehicle setVariable ["ObjectID", 1, true];
_size = sizeOf _class; _size = sizeOf _class;
{ {

@ -46,7 +46,6 @@ _spawnCrashSite =
_vehicle = "ClutterCutter_small_2_EP1" createVehicle _position; _vehicle = "ClutterCutter_small_2_EP1" createVehicle _position;
_vehicle = _class createVehicle [0,0,0]; _vehicle = _class createVehicle [0,0,0];
_vehicle setVariable ["ObjectID", 1, true];
_vehicle setDir random 360; _vehicle setDir random 360;
_vehicle setPos _position; _vehicle setPos _position;

@ -90,6 +90,7 @@ AllowedVehiclesList = [
["SUV_TK_CIV_EP1_DZE",_Ratio1], ["SUV_TK_CIV_EP1_DZE",_Ratio1],
["SUV_White",_Ratio1], ["SUV_White",_Ratio1],
["SUV_Yellow",_Ratio1], ["SUV_Yellow",_Ratio1],
["SUV_Blue_White",_Ratio1],
["Tractor_DZE",_Ratio3], ["Tractor_DZE",_Ratio3],
["TT650_Civ_DZE",_Ratio3], ["TT650_Civ_DZE",_Ratio3],
["TT650_Ins_DZE",_Ratio3], ["TT650_Ins_DZE",_Ratio3],

@ -0,0 +1,39 @@
/*
Safe Zone Relocate by salival (https://github.com/oiad)
*/
private ["_customPosition","_minDist","_maxDist","_maxDamage","_message","_nearVehicles","_objDist","_position","_safeZonePos","_safeZoneRadius","_useCustomPosition","_unlock"];
_useCustomPosition = false; // Enable a custom position to move vehicles to (i.e a junk yard)
_customPosition = [6942.64,15121.6,0]; // Position for vehicles to be moved to if _useCustomPosition = true;
_minDist = 5; // Minimum distance from the custom position to move vehicles to
_maxDist = 1000; // Maximum distance from the safe zone position to find a safe position or custom position for relocation, setting this too low can make vehicles spawn very close to other vehicles.
_objDist = 15; // Minimum distance from the safe position for relocation to the center of the nearest object. Specifying quite a large distance here will slow the function and might often fail to find a suitable position.
_unlock = false; // Unlock vehicle when moved from the safe zone?
_maxDamage = 0.75; // Vehicles above or equal to this amount of damage will be deleted
{
_safeZonePos = _x select 0;
_safeZoneRadius = _x select 1;
_nearVehicles = _safeZonePos nearEntities [["Air","LandVehicle","Ship"],_safeZoneRadius];
{
if (damage _x >= _maxDamage) then {
_message = format ["[SAFEZONE] %1 was deleted from the server for being too damaged before relocate: @%2 %3",typeOf _x,mapGridPosition _x,getPosATL _x];
diag_log _message;
[_x getVariable["ObjectID","0"],_x getVariable["ObjectUID","0"],_x] call server_deleteObjDirect;
deleteVehicle _x;
} else {
if (_useCustomPosition) then {
_position = [_customPosition,_minDist,_maxDist,_objDist,1,0,0,[]] call BIS_fnc_findSafePos;
} else {
_position = [_safeZonePos,(_safeZoneRadius + 50),_maxDist,_objDist,if (_x isKindOf "Ship") then {2} else {0},0,0,[],[_safeZonePos,_safeZonePos]] call BIS_fnc_findSafePos;
};
_x setPos _position;
[_x,"position"] call server_updateObject;
if (_unlock && {locked _x}) then {_x setVehicleLock "UNLOCKED"};
_message = format ["[SAFEZONE] %1 was moved out of a safe zone to: @%2 %3",typeOf _x,mapGridPosition _position,_position];
diag_log _message;
};
} forEach _nearVehicles;
} forEach DZE_safeZonePosArray;

@ -1,7 +1,5 @@
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp" #include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
if (isNil "DZE_NPC_CleanUp_Time") then {DZE_NPC_CleanUp_Time = -1;};
sched_co_deleteVehicle = { sched_co_deleteVehicle = {
private "_group"; private "_group";
_this removeAllMPEventHandlers "mpkilled"; _this removeAllMPEventHandlers "mpkilled";
@ -28,7 +26,7 @@ sched_co_deleteVehicle = {
sched_corpses = { sched_corpses = {
private ["_delQtyG","_delQtyZ","_delQtyP","_addFlies","_x","_deathTime","_onoff","_delQtyAnimal","_sound","_deathPos","_cpos","_animal","_nearPlayer","_delQtyV","_delQtyAI"]; private ["_delQtyG","_delQtyZ","_delQtyP","_addFlies","_x","_deathTime","_onoff","_delQtyAnimal","_sound","_deathPos","_cpos","_animal","_nearPlayer","_delQtyV"];
// EVERY 2 MINUTE // EVERY 2 MINUTE
// DELETE UNCONTROLLED ZOMBIES --- PUT FLIES ON FRESH PLAYER CORPSES --- REMOVE OLD FLIES & CORPSES // DELETE UNCONTROLLED ZOMBIES --- PUT FLIES ON FRESH PLAYER CORPSES --- REMOVE OLD FLIES & CORPSES
_delQtyZ = 0; _delQtyZ = 0;
@ -36,10 +34,9 @@ sched_corpses = {
_delQtyG = 0; _delQtyG = 0;
_delQtyV = 0; _delQtyV = 0;
_addFlies = 0; _addFlies = 0;
_delQtyAI = 0;
{ {
if (local _x && {_x isKindOf "CAManBase"}) then { if (local _x && {_x isKindOf "CAManBase"}) then {
if (_x isKindOf "zZombie_Base") then { if (_x isKindOf "zZombie_Base" || {typeOf _x == "z_bloodsucker"}) then {
_x call sched_co_deleteVehicle; _x call sched_co_deleteVehicle;
_delQtyZ = _delQtyZ + 1; _delQtyZ = _delQtyZ + 1;
} else { } else {
@ -62,28 +59,8 @@ sched_corpses = {
_addFlies = _addFlies + 1; _addFlies = _addFlies + 1;
}; };
}; };
// 60 * DZE_NPC_CleanUp_Time = how long an NPC corpse stays on the map
if (DZE_NPC_CleanUp_Time != -1 && {diag_tickTime - _deathTime > (60 * DZE_NPC_CleanUp_Time)} && {_x getVariable["bodyName",""] == "NPC"}) then {
if (_x getVariable["sched_co_fliesDeleted",false] or !dayz_enableFlies) then {
// flies have been switched off, we can delete body
_sound = _x getVariable ["sched_co_fliesSource", nil];
if !(isNil "_sound") then {
detach _sound;
deleteVehicle _sound;
};
_x call sched_co_deleteVehicle;
_delQtyAI = _delQtyAI + 1;
} else {
PVCDZ_flies = [ 0, _x ];
publicVariable "PVCDZ_flies";
_x setVariable ["sched_co_fliesDeleted", true];
// body will be deleted at next round
};
};
// 40 minutes = how long a player corpse stays on the map // 40 minutes = how long a player corpse stays on the map
if ((diag_tickTime - _deathTime > 40*60) && {_x getVariable["bodyName",""] != "NPC"}) then { if (diag_tickTime - _deathTime > 40*60) then {
if (_x getVariable["sched_co_fliesDeleted",false] or !dayz_enableFlies) then { if (_x getVariable["sched_co_fliesDeleted",false] or !dayz_enableFlies) then {
// flies have been switched off, we can delete body // flies have been switched off, we can delete body
_sound = _x getVariable ["sched_co_fliesSource", nil]; _sound = _x getVariable ["sched_co_fliesSource", nil];
@ -120,7 +97,7 @@ sched_corpses = {
if (_onoff == 1) then { if (_onoff == 1) then {
_sound = createSoundSource["Sound_Flies",getPosATL _x,[],0]; _sound = createSoundSource["Sound_Flies",getPosATL _x,[],0];
_sound attachTo [_x]; _sound attachTo [_x];
_x setVariable ["sched_co_fliesSource", _sound]; _x setVariable ["sched_co_fliesSource", _sound,[false,true] select (DZE_Bury_Body || DZE_Butcher_Body)];
//diag_log "create sound"; //diag_log "create sound";
}; };
// broadcast flies status for everyone periodically, to update visible swarm // broadcast flies status for everyone periodically, to update visible swarm
@ -181,8 +158,8 @@ sched_corpses = {
#ifdef SERVER_DEBUG #ifdef SERVER_DEBUG
if (_delQtyZ+_delQtyP+_addFlies+_delQtyGrp+_delQtyG+_delQtyV > 0) then { if (_delQtyZ+_delQtyP+_addFlies+_delQtyGrp+_delQtyG+_delQtyV > 0) then {
diag_log format ["%1: Deleted %2 uncontrolled zombies, %3 uncontrolled animals, %4 dead character bodies, %7 ghosts, %8 destroyed vehicles, %9 dead mission ai and %5 empty groups. Added %6 flies.",__FILE__, diag_log format ["%1: Deleted %2 uncontrolled zombies, %3 uncontrolled animals, %4 dead character bodies, %7 ghosts, %8 destroyed vehicles and %5 empty groups. Added %6 flies.",__FILE__,
_delQtyZ,_delQtyAnimal,_delQtyP,_delQtyGrp,_addFlies,_delQtyG,_delQtyV,_delQtyAI]; _delQtyZ,_delQtyAnimal,_delQtyP,_delQtyGrp,_addFlies,_delQtyG,_delQtyV];
}; };
#endif #endif

@ -4,15 +4,11 @@
*/ */
epoch_eventIsAny = { epoch_eventIsAny = {
private ["_boolReturn","_event","_date","_bool","_index"]; local _event = _this select 0;
_event = _this select 0; local _date = _this select 1;
_date = _this select 1; local _boolReturn = false;
local _index = 0;
_boolReturn = false;
_index = 0;
{ {
_bool = false;
if (typeName _x == "STRING") then { if (typeName _x == "STRING") then {
_boolReturn = true; _boolReturn = true;
} else { } else {
@ -21,50 +17,41 @@ epoch_eventIsAny = {
if (!_boolReturn) exitWith {}; if (!_boolReturn) exitWith {};
_index = _index + 1; _index = _index + 1;
} count _event; } count _event;
_boolReturn _boolReturn
}; };
sched_event_init = { sched_event_init = {
diag_log("EPOCH EVENTS INIT"); diag_log formatText ["EPOCH EVENTS: %1 Events Scheduled",(count EpochEvents)];
"" ""
}; };
sched_event = { sched_event = {
private ["_date","_key","_result","_outcome","_handle","_datestr","_lastTime"];
// Find current time from server // Find current time from server
_lastTime = _this; local _lastTime = _this;
_key = "CHILD:307:"; local _key = "CHILD:307:";
_result = _key call server_hiveReadWrite; local _result = _key call server_hiveReadWrite;
_outcome = _result select 0; local _outcome = _result select 0;
if (_outcome == "PASS") then { if (_outcome == "PASS") then {
_date = _result select 1; local _date = _result select 1;
_datestr = str(_date); local _datestr = str(_date);
if (_lastTime != _datestr) then { if (_lastTime != _datestr) then {
// internal timestamp // internal timestamp
ServerCurrentTime = _date; ServerCurrentTime = _date;
// Once a minute.
_lastTime = _datestr; _lastTime = _datestr;
//diag_log ("EVENTS: Local Time is: " + _datestr);
if (count EpochEvents == 0) exitWith {};
{ {
// Run event at server start when minutes are set to -1 // Run event at server start when minutes are set to -1
if ((_x select 4) == -1) then { if ((_x select 4) == -1) then {
diag_log ("RUNNING EVENT: " + (_x select 5) + " on " + _datestr); diag_log ("RUNNING EVENT: " + (_x select 5) + " on " + _datestr);
_handle = [] execVM "\z\addons\dayz_server\modules\" + (_x select 5) + ".sqf"; local _handle = [] execVM "\z\addons\dayz_server\modules\" + (_x select 5) + ".sqf";
// Remove event from array so it doesn't run again. // Remove event from array so it doesn't run again.
_lastIndex = (count EpochEvents) - 1; EpochEvents = [EpochEvents,_forEachIndex] call fnc_deleteAt;
if (_lastIndex != _forEachIndex) then {EpochEvents set [_forEachIndex, EpochEvents select _lastIndex];};
EpochEvents resize _lastIndex;
} else { } else {
if([[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4)],_date] call epoch_eventIsAny) then { if([[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4)],_date] call epoch_eventIsAny) then {
diag_log ("RUNNING EVENT: " + (_x select 5) + " on " + _datestr); diag_log ("RUNNING EVENT: " + (_x select 5) + " on " + _datestr);
_handle = [] execVM "\z\addons\dayz_server\modules\" + (_x select 5) + ".sqf"; local _handle = [] execVM "\z\addons\dayz_server\modules\" + (_x select 5) + ".sqf";
}; };
}; };
} forEach EpochEvents; } forEach EpochEvents;

@ -0,0 +1,57 @@
/*
EVR Storms AKA "Blowouts" Server Scheduler Functions by JasonTM.
The EVR storms are rolled out in stages for JIP players.
The server controls the EVR timing to keep the clients in sync so players have the same experience.
*/
evr_storm = {
PVDZE_EVR = "Stage1";
publicVariable "PVDZE_EVR";
uiSleep 60;
PVDZE_EVR = "Stage2";
publicVariable "PVDZE_EVR";
uiSleep 50;
PVDZE_EVR = "Stage3";
publicVariable "PVDZE_EVR";
uiSleep 40;
PVDZE_EVR = "Stage4";
publicVariable "PVDZE_EVR";
uiSleep 30;
PVDZE_EVR = "Stage5";
publicVariable "PVDZE_EVR";
uiSleep 20;
PVDZE_EVR = "Stage6";
publicVariable "PVDZE_EVR";
uiSleep 10;
PVDZE_EVR = "Stage7";
publicVariable "PVDZE_EVR";
uiSleep 180;
EVR_Lockout = false;
};
sched_evr_init = {
diag_log "EVR STORMS ENABLED";
EVR_Lockout = false; // Prevents the server from starting an EVR storm while one is running.
[diag_tickTime, (((DZE_EVRFirstTime select 0) max (random (DZE_EVRFirstTime select 1))) * 60)]
};
sched_evr = {
local _time = _this select 0;
local _timer = _this select 1;
if (!EVR_Lockout && {diag_tickTime - _time >= _timer}) then {
[] spawn evr_storm;
EVR_Lockout = true;
_time = diag_tickTime;
_timer = ((DZE_EVRTimer select 0) max (random (DZE_EVRTimer select 1))) * 60;
diag_log format ["EVR Storm Started: Next storm in %1 minutes", round(_timer / 60)];
};
[_time, _timer]
};

@ -1,37 +1,41 @@
#define PATH "z\addons\dayz_server\system\scheduler\" #define PATH "\z\addons\dayz_server\system\scheduler\"
call compile preprocessFileLineNumbers (PATH+"sched_corpses.sqf"); call compile preprocessFileLineNumbers (PATH+"sched_corpses.sqf");
call compile preprocessFileLineNumbers (PATH+"sched_lootpiles.sqf"); call compile preprocessFileLineNumbers (PATH+"sched_lootpiles.sqf");
call compile preprocessFileLineNumbers (PATH+"sched_sync.sqf"); call compile preprocessFileLineNumbers (PATH+"sched_sync.sqf");
call compile preprocessFileLineNumbers (PATH+"sched_safetyVehicle.sqf"); call compile preprocessFileLineNumbers (PATH+"sched_safetyVehicle.sqf");
call compile preprocessFileLineNumbers (PATH+"sched_dzms.sqf");
call compile preprocessFileLineNumbers (PATH+"sched_wai.sqf"); call compile preprocessFileLineNumbers (PATH+"sched_wai.sqf");
call compile preprocessFileLineNumbers (PATH+"sched_dzms.sqf");
call compile preprocessFileLineNumbers (PATH+"sched_event.sqf"); call compile preprocessFileLineNumbers (PATH+"sched_event.sqf");
call compile preprocessFileLineNumbers (PATH+"sched_traps.sqf"); call compile preprocessFileLineNumbers (PATH+"sched_traps.sqf");
if (DZE_Bury_Body || DZE_Butcher_Body) then {
call compile preprocessFileLineNumbers (PATH+"sched_lootCrates.sqf");
};
if (DZE_EVR) then {
call compile preprocessFileLineNumbers (PATH+"sched_evr.sqf");
};
[ local _list = [
// period offset code <-> ctx init code ->ctx // period offset code <-> ctx init code ->ctx
[ 60, 0, sched_event, sched_event_init ], [ 60, 0, sched_event, sched_event_init ],
[ 60, 224, sched_corpses ], [ 60, 224, sched_corpses ],
[ 300, 336, sched_lootpiles_5m, sched_lootpiles_5m_init ], [ 300, 336, sched_lootpiles_5m, sched_lootpiles_5m_init ],
[ 90, 60, sched_dzms, sched_dzms_init ],
[ 90, 60, sched_wai, sched_wai_init ], [ 90, 60, sched_wai, sched_wai_init ],
[ 90, 60, sched_dzms, sched_dzms_init ],
[ 6, 340, sched_lootpiles ], [ 6, 340, sched_lootpiles ],
[ 900, 0, sched_sync ], [ 900, 0, sched_sync ],
[ 120, 48, sched_safetyVehicle ], [ 120, 48, sched_safetyVehicle ],
[ 360, 480, sched_fps ], [ 360, 480, sched_fps ],
[ 30, 60, sched_traps, sched_traps_init ] [ 30, 60, sched_traps, sched_traps_init ]
] execFSM ("z\addons\dayz_code\system\scheduler\scheduler.fsm"); ];
if (DZE_Bury_Body || DZE_Butcher_Body) then {
_list set [count _list, [ 60, 240, sched_lootCrates ]];
};
if (DZE_EVR) then {
_list set [count _list, [ 60, 180, sched_evr, sched_evr_init ]];
};
_list execFSM ("\z\addons\dayz_code\system\scheduler\scheduler.fsm");
//diag_log [ __FILE__, "Scheduler started"]; //diag_log [ __FILE__, "Scheduler started"];
/*
// (see ViralZeds.hpp -> zombie_agent.fsm -> zombie_findOwner.sqf), called when a zombie becomes "local" to the server after the player disconnected
zombie_findOwner = {
(_this select 0) call fa_deleteVehicle;
};
*/

@ -0,0 +1,38 @@
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
// Delete loot crates, graves and crosses after 25 minutes
sched_lootCrates = {
private ["_delQtyCrate","_crateTime","_objects","_crates","_graves","_cross"];
_delQtyCrate = 0;
#define CENTER getMarkerPos "center"
#define RADIUS ((getMarkerSize "center") select 1)*2
_crates = CENTER nearObjects ["DZ_AmmoBoxSmallUS",RADIUS];
_graves = CENTER nearObjects ["Grave",RADIUS];
_cross = CENTER nearObjects ["GraveCross1",RADIUS];
_objects = _crates + _graves + _cross;
{
if (_x getVariable ["bury",false]) then {
_crateTime = _x getVariable ["sched_co_crateTime", -1];
if (_crateTime == -1) exitWith {
_crateTime = diag_tickTime;
_x setVariable ["sched_co_crateTime", _crateTime];
};
if (diag_tickTime - _crateTime > 25*60) then {
_x call sched_co_deleteVehicle;
_delQtyCrate = _delQtyCrate + 1;
};
};
} forEach _objects;
#ifdef SERVER_DEBUG
if (_delQtyCrate> 0) then {
diag_log format ["%1: Deleted %2 bury/butcher objects.",__FILE__,_delQtyCrate];
};
#endif
objNull
};

@ -102,7 +102,7 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
_damage = _x select 8; _damage = _x select 8;
_storageMoney = _x select 9; _storageMoney = _x select 9;
if ((_type isKindOf "AllVehicles")) then { if ((_type isKindOf "AllVehicles") && {!(_type isKindOf "StaticWeapon") && {!(_type in DZE_StaticWeapons)}}) then {
_VehicleQueue set [_vQty,_x]; _VehicleQueue set [_vQty,_x];
_vQty = _vQty + 1; _vQty = _vQty + 1;
} else { } else {
@ -184,20 +184,22 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
}; };
_object = _type createVehicle [0,0,0]; //more than 2x faster than createvehicle array _object = _type createVehicle [0,0,0]; //more than 2x faster than createvehicle array
_object setDir _dir;
_object setPosATL _pos;
_object setDamage _damage; _object setDamage _damage;
if (_vecExists) then { if (_vecExists) then {
_object setVectorDirAndUp _vector; _object setVectorDirAndUp _vector;
} else {
_object setDir _dir; // setdir is incompatible with setVectorDirAndUp and should not be used together on the same object https://community.bistudio.com/wiki/setVectorDirAndUp
}; };
_object enableSimulation false; _object enableSimulation false;
_object setPosATL _pos;
_doorLocked = _type in DZE_DoorsLocked; _doorLocked = _type in DZE_DoorsLocked;
_isPlot = _type == "Plastic_Pole_EP1_DZ"; _isPlot = _type == "Plastic_Pole_EP1_DZ";
// prevent immediate hive write when vehicle parts are set up // prevent immediate hive write when vehicle parts are set up
_object setVariable ["lastUpdate",diag_ticktime]; _object setVariable ["lastUpdate",diag_ticktime];
_object setVariable ["ObjectID", _idKey, true]; _object setVariable ["ObjectID", _idKey];
_object setVariable ["OwnerPUID", _ownerPUID, true]; _object setVariable ["OwnerPUID", _ownerPUID, true];
if (Z_SingleCurrency && {_type in DZE_MoneyStorageClasses}) then { if (Z_SingleCurrency && {_type in DZE_MoneyStorageClasses}) then {
_object setVariable ["cashMoney", _storageMoney, true]; _object setVariable ["cashMoney", _storageMoney, true];
@ -234,7 +236,7 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
{_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo; {_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo;
}; };
} else { } else {
if (DZE_permanentPlot && _isPlot) then { if (_isPlot) then {
_object setVariable ["plotfriends", _inventory, true]; _object setVariable ["plotfriends", _inventory, true];
}; };
if (DZE_doorManagement && _doorLocked) then { if (DZE_doorManagement && _doorLocked) then {
@ -261,15 +263,20 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
}; };
}; };
}; };
_object setVariable ["CharacterID", _ownerID, true];
if (_type isKindOf "StaticWeapon" || {_type in DZE_StaticWeapons}) then {
[_object,DZE_clearStaticAmmo,false] call fn_vehicleAddons;
};
_setGlobal = [false,true] select ((_type in DZE_LockedStorage) || (_type in DZE_DoorsLocked));
_object setVariable ["CharacterID", _ownerID, _setGlobal];
if (_isSafeObject && !_isTrapItem) then { if (_isSafeObject && !_isTrapItem) then {
_object setVariable["memDir",_dir,true]; _object setVariable["memDir",_dir,true];
if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then { if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then {
_object addEventHandler ["HandleDamage",{false}]; _object addEventHandler ["HandleDamage",{0}];
} else { } else {
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}]; _object addMPEventHandler ["MPKilled",{if !(isServer) exitWith {};_this call vehicle_handleServerKilled;}];
}; };
_object setVariable ["OEMPos",_pos,true]; // used for inplace upgrades and lock/unlock of safe
} else { } else {
_object enableSimulation true; _object enableSimulation true;
}; };
@ -338,8 +345,8 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
// prevent immediate hive write when vehicle parts are set up // prevent immediate hive write when vehicle parts are set up
_object setVariable ["lastUpdate",diag_ticktime]; _object setVariable ["lastUpdate",diag_ticktime];
_object setVariable ["ObjectID", _idKey, true]; _object setVariable ["ObjectID", _idKey];
if (Z_SingleCurrency && ZSC_VehicleMoneyStorage) then { if (Z_SingleCurrency && {ZSC_VehicleMoneyStorage}) then {
_object setVariable ["cashMoney", _storageMoney, true]; _object setVariable ["cashMoney", _storageMoney, true];
}; };
@ -362,22 +369,19 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
{_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo; {_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo;
}; };
_object setVariable ["CharacterID", _ownerID, true]; _setGlobal = [false,true] select (_ownerID != "0");
_isAir = _object isKindOf "Air"; _object setVariable ["CharacterID", _ownerID, _setGlobal];
{ [_object,_hitpoints] call server_setHitpoints;
_selection = _x select 0;
_dam = [_x select 1,(_x select 1) min 0.8] select (!_isAir && {_selection in dayZ_explosiveParts});
_object setHit [_selection,_dam];
} count _hitpoints;
[_object,"damage"] call server_updateObject;
_object setFuel _fuel; _object setFuel _fuel;
[_object,"all",true] call server_updateObject;
[_object,DZE_clearVehicleAmmo,DZE_addVehicleAmmo] call fn_vehicleAddons;
_object call fnc_veh_ResetEH; _object call fnc_veh_ResetEH;
if (_ownerID != "0" && {!(_object isKindOf "Bicycle")}) then { if (_ownerID != "0" && {!(_object isKindOf "Bicycle")}) then {_object setVehicleLock "locked";};
_object setVehicleLock "locked";
//_object setVariable ["MF_Tow_Cannot_Tow",true,true];
};
_serverVehicleCounter set [count _serverVehicleCounter,_type]; // total each vehicle _serverVehicleCounter set [count _serverVehicleCounter,_type]; // total each vehicle
_object enableSimulation true; _object enableSimulation true;
_object setVelocity [0,0,1]; _object setVelocity [0,0,1];
@ -415,7 +419,9 @@ for "_i" from 0 to 10 do {
diag_log format["Total Number of spawn locations %1", actualSpawnMarkerCount]; diag_log format["Total Number of spawn locations %1", actualSpawnMarkerCount];
if (isDedicated) then {endLoadingScreen;}; if (isDedicated) then {endLoadingScreen;};
[] call compile preprocessFileLineNumbers "\z\addons\dayz_server\DZAI\init\dzai_initserver.sqf";
allowConnection = true; allowConnection = true;
[] ExecVM "\z\addons\dayz_server\DZMS\DZMSInit.sqf";
sm_done = true; sm_done = true;
publicVariable "sm_done"; publicVariable "sm_done";
@ -467,4 +473,7 @@ if (_hiveLoaded) then {
//Update gear last after all dynamic vehicles are created to save random loot to database (low priority) //Update gear last after all dynamic vehicles are created to save random loot to database (low priority)
{[_x,"gear"] call server_updateObject} count _vehiclesToUpdate; {[_x,"gear"] call server_updateObject} count _vehiclesToUpdate;
}; };
if (DZE_SafeZone_Relocate) then {
execVM "\z\addons\dayz_server\system\safeZoneRelocate.sqf";
};
}; };

@ -60,7 +60,7 @@
] call server_spawnTraders; ] call server_spawnTraders;
// Bankers // Bankers
if (Z_singleCurrency && Z_globalBanking && Z_globalBankingTraders) then { if (Z_singleCurrency && {Z_globalBanking && Z_globalBankingTraders}) then {
[ [
["Functionary1_EP1",[12399.83,5054.3413,0.2],52], ["Functionary1_EP1",[12399.83,5054.3413,0.2],52],
["Functionary1_EP1",[15529.827,13236.555,2.38],164], ["Functionary1_EP1",[15529.827,13236.555,2.38],164],

@ -31,10 +31,10 @@ DZE_DeathMsgDynamicText = false; // Display death messages as dynamicText in the
DZE_DeathMsgRolling = false; // Display death messages as rolling messages in bottom center of screen. DZE_DeathMsgRolling = false; // Display death messages as rolling messages in bottom center of screen.
// ZSC // ZSC
Z_SingleCurrency = false; // Enable single currency system. Z_SingleCurrency = true; // Enable single currency system.
Z_globalBanking = true; // Enable global banking system.
if (Z_SingleCurrency) then { if (Z_SingleCurrency) then {
Z_globalBanking = false; // Enable global banking system.
Z_persistentMoney = false; // Enabling this stores currency to player_data instead of character_data. Currency transfers to a new character after death. For PVE servers only. Formerly called "GlobalMoney". Z_persistentMoney = false; // Enabling this stores currency to player_data instead of character_data. Currency transfers to a new character after death. For PVE servers only. Formerly called "GlobalMoney".
CurrencyName = "Coins"; // If using single currency this is the currency display name. CurrencyName = "Coins"; // If using single currency this is the currency display name.
DZE_MoneyStorageClasses = ["VaultStorage","VaultStorage2","VaultStorageLocked","VaultStorage2Locked","LockboxStorageLocked","LockboxStorage2Locked","LockboxStorage","LockboxStorage2","LockboxStorageWinterLocked","LockboxStorageWinter2Locked","LockboxStorageWinter","LockboxStorageWinter2","TallSafe","TallSafeLocked"]; // If using single currency this is an array of object classes players can store coins in. E.g.: ["GunRack_DZ","WoodCrate_DZ"] DZE_MoneyStorageClasses = ["VaultStorage","VaultStorage2","VaultStorageLocked","VaultStorage2Locked","LockboxStorageLocked","LockboxStorage2Locked","LockboxStorage","LockboxStorage2","LockboxStorageWinterLocked","LockboxStorageWinter2Locked","LockboxStorageWinter","LockboxStorageWinter2","TallSafe","TallSafeLocked"]; // If using single currency this is an array of object classes players can store coins in. E.g.: ["GunRack_DZ","WoodCrate_DZ"]
@ -132,7 +132,7 @@ if (isServer) then {
dayz_ghostTimer = 120; dayz_ghostTimer = 120;
// ZSC // ZSC
Z_globalBankingTraders = false; // Enable banking NPCs at trader cities. Z_globalBankingTraders = true; // Enable banking NPCs at trader cities.
// Safe Zone Relocating // Safe Zone Relocating
DZE_SafeZone_Relocate = false; //Enables relocating of vehicles left in Safe Zones over a server restart. DZE_SafeZone_Relocate = false; //Enables relocating of vehicles left in Safe Zones over a server restart.

@ -0,0 +1,379 @@
scriptName "modules_e\Functions\objects\fn_HALO.sqf";
uiSleep 0.01;
//--- HALO -------------------------------------------------------------------------------------------------------------------------------------
if (typename _this == typename objnull) then {
_unit = _this;
//--- Eject!
waituntil {(vehicle _unit) iskindof "ParachuteBase" || !isnil {_unit getvariable "bis_fnc_halo_now"}};
if (!local _unit) exitwith {};
//--- Delete parachute
_parachute = vehicle _unit;
if (_parachute != _unit) then {
deletevehicle _parachute;
};
//--- Init
_dir = ([[0,0,0],velocity _unit] call bis_fnc_dirto);
_unit setdir _dir;
[objNull, player, rSwitchMove,"HaloFreeFall_non"] call RE;
player switchmove "HaloFreeFall_non";
//--- Key controls
if (_unit == player) then {
//--- PLAYER ------------------------------------------------
_brightness = 0.99;
_pos = [player] call FNC_GetPos;
_parray = [
/* 00 */ ["\Ca\Data\ParticleEffects\Universal\Universal", 16, 12, 13, 0],
/* 01 */ "",
/* 02 */ "Billboard",
/* 03 */ 1,
/* 04 */ 3,
/* 05 */ [0,0,-200],
/* 06 */ wind,
/* 07 */ 0,
/* 08 */ 1.275,
/* 09 */ 1,
/* 10 */ 0,
/* 11 */ [100],
/* 12 */ [
[_brightness,_brightness,_brightness,0],
[_brightness,_brightness,_brightness,0.01],
[_brightness,_brightness,_brightness,0.10],
[_brightness,_brightness,_brightness,0]
],
/* 13 */ [1000],
/* 14 */ 0,
/* 15 */ 0,
/* 16 */ "",
/* 17 */ "",
/* 18 */ player
];
bis_fnc_halo_clouds = "#particlesource" createVehicleLocal _pos;
bis_fnc_halo_clouds setParticleParams _parray;
bis_fnc_halo_clouds setParticleRandom [0, [100, 100, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 1];
bis_fnc_halo_clouds setParticleCircle [00, [00, 00, 00]];
bis_fnc_halo_clouds setDropInterval (0.4 - (0.3 * overcast));
//--- Effects
bis_fnc_halo_ppRadialBlur = ppeffectcreate ["RadialBlur",464];
bis_fnc_halo_ppRadialBlur ppEffectAdjust [0.01,0.01,0.3,0.3];
bis_fnc_halo_ppRadialBlur ppEffectCommit 0.01;
bis_fnc_halo_ppRadialBlur ppEffectEnable true ;
bis_fnc_halo_soundLoop = time;
playsound "BIS_HALO_Flapping";
bis_fnc_halo_action = _unit addaction [localize "STR_HALO_OPEN_CHUTE", "custom\fn_halo.sqf",[],1,true,true,"Eject"];
bis_fnc_halo_keydown = {
_key = _this select 1;
//--- Forward
//if (_key in (actionkeys 'HeliForward')) then {
if (_key in (actionkeys 'MoveForward')) then {
if (bis_fnc_halo_vel < +bis_fnc_halo_velLimit) then {bis_fnc_halo_vel = bis_fnc_halo_vel + bis_fnc_halo_velAdd};
};
//--- Backward
//if (_key in (actionkeys 'HeliBack')) then {
if (_key in (actionkeys 'MoveBack')) then {
if (bis_fnc_halo_vel > -bis_fnc_halo_velLimit) then {bis_fnc_halo_vel = bis_fnc_halo_vel - bis_fnc_halo_velAdd};
};
//--- Left
//if (_key in (actionkeys 'HeliCyclicLeft')) then {
if (_key in (actionkeys 'TurnLeft')) then {
if (bis_fnc_halo_dir > -bis_fnc_halo_dirLimit) then {bis_fnc_halo_dir = bis_fnc_halo_dir - bis_fnc_halo_dirAdd};
};
//--- Right
//if (_key in (actionkeys 'HeliCyclicRight')) then {
if (_key in (actionkeys 'TurnRight')) then {
if (bis_fnc_halo_dir < +bis_fnc_halo_dirLimit) then {bis_fnc_halo_dir = bis_fnc_halo_dir + bis_fnc_halo_dirAdd};
};
};
bis_fnc_halo_keydown_eh = (finddisplay 46) displayaddeventhandler ["keydown","_this call bis_fnc_halo_keydown;"];
//--- Loop
bis_fnc_halo_vel = 0;
bis_fnc_halo_velLimit = 0.2;
bis_fnc_halo_velAdd = 0.03;
bis_fnc_halo_dir = 0;
bis_fnc_halo_dirLimit = 1;
bis_fnc_halo_dirAdd = 0.06;
[] spawn {
_time = time - 0.1;
while {alive player && vehicle player == player && isnil {player getvariable "bis_fnc_halo_terminate"} && (([player] call FNC_GetPos) select 2) > DZE_HaloOpenChuteHeight} do {
//--- FPS counter
_fpsCoef = ((time - _time) * 60) / acctime; //Script is optimized for 60 FPS
_time = time;
bis_fnc_halo_velLimit = 0.2 * _fpsCoef;
bis_fnc_halo_velAdd = 0.03 * _fpsCoef;
bis_fnc_halo_dirLimit = 1 * _fpsCoef;
bis_fnc_halo_dirAdd = 0.06 * _fpsCoef;
//--- Dir
bis_fnc_halo_dir = bis_fnc_halo_dir * 0.98;
_dir = direction player + bis_fnc_halo_dir;
player setdir _dir;
//--- Velocity
_vel = velocity player;
bis_fnc_halo_vel = bis_fnc_halo_vel * 0.96;
player setvelocity [
(_vel select 0) + (sin _dir * bis_fnc_halo_vel),
(_vel select 1) + (cos _dir * bis_fnc_halo_vel),
(_vel select 2)
];
//--- Animation system
_anim = "HaloFreeFall_non";
_v = bis_fnc_halo_vel;
_h = bis_fnc_halo_dir;
_vLimit = 0.1;
_hLimit = 0.3;
if ((abs _v) > _vLimit || (abs _h) > _hLimit) then {
_vAnim = "";
if (_v > +_vLimit) then {_vAnim = "F"};
if (_v < -_vLimit) then {_vAnim = "B"};
_hAnim = "";
if (_h > +_hLimit) then {_hAnim = "R"};
if (_h < -_hLimit) then {_hAnim = "L"};
_anim = "HaloFreeFall_" + _vAnim + _hAnim;
};
player playmovenow _anim;
//--- Sound
if ((time - bis_fnc_halo_soundLoop) > 4.5) then {
playsound "BIS_HALO_Flapping";
bis_fnc_halo_soundLoop = time;
};
//--- Effects
/*
bis_fnc_halo_ppRadialBlur ppEffectAdjust [0.02,0.02,0.3 - (bis_fnc_halo_vel/7)/_fpsCoef,0.3 - (bis_fnc_halo_vel/7)/_fpsCoef];
bis_fnc_halo_ppRadialBlur ppEffectCommit 0.01;
*/
if (DZE_HaloAltitudeMeter && !isNil "Dayz_loginCompleted") then {
titleText [
format [
localize "str_halo_altitude_speed",
str(round(([player] call FNC_GetPos) select 2)) + " m",
str(abs(round(speed(vehicle player)))) + " " + localize "str_lib_info_unit_kilometers_per_hour"
],"PLAIN DOWN",0.01
];
};
uiSleep 0.01;
};
//--- End
player removeaction bis_fnc_halo_action;
(finddisplay 46) displayremoveeventhandler ["keydown",bis_fnc_halo_keydown_eh];
ppeffectdestroy bis_fnc_halo_ppRadialBlur;
deletevehicle bis_fnc_halo_clouds;
bis_fnc_halo_clouds = nil;
bis_fnc_halo_vel = nil;
bis_fnc_halo_velLimit = nil;
bis_fnc_halo_velAdd = nil;
bis_fnc_halo_dir = nil;
bis_fnc_halo_dirLimit = nil;
bis_fnc_halo_dirAdd = nil;
bis_fnc_halo_action = nil;
bis_fnc_halo_keydown = nil;
bis_fnc_halo_keydown_eh = nil;
if (!alive player) then {
[objNull, player, rSwitchMove,"adthppnemstpsraswrfldnon_1"] call RE;
player switchmove "adthppnemstpsraswrfldnon_1";
player setvelocity [0,0,0];
} else {
if (DZE_HaloOpenChuteHeight > -1 && isNil "bis_fnc_halo_para_dirAbs") then {
//Auto open chute
[player] spawn BIS_fnc_Halo;
};
};
};
} else {
//--- AI ------------------------------------------------
while {(([_unit] call FNC_GetPos) select 2) > 100} do {
_destination = expecteddestination _unit select 0;
_unitPosition = [_unit] call FNC_GetPos;
if ((_destination distance [(_unitPosition select 0),(_unitPosition select 1),0]) > 10) then {
_vel = velocity _unit;
_dirTo = [_unit,_destination] call bis_fnc_dirto;
if (player distance _unit > 500) then {
_unit setdir _dirTo;
};
_unit setvelocity [
(_vel select 0) + (sin _dirTo * 0.2),
(_vel select 1) + (cos _dirTo * 0.2),
(_vel select 2)
];
};
uiSleep 0.01;
};
//--- Open
[_unit] spawn bis_fnc_halo;
};
};
//--- PARA -------------------------------------------------------------------------------------------------------------------------------------
if (typename _this == typename []) then {
_unit = _this select 0;
if (!local _unit) exitwith {};
//--- Free fall
if (count _this == 2) exitwith { //Fresh spawn calling from player_monitor.fsm
_alt = _this select 1;
_unit call fn_exitSwim;
_unit setvariable ["bis_fnc_halo_now",true];
_unit spawn bis_fnc_halo;
};
//-------------
_para = objnull;
_vel = [];
_unit allowDamage false; //Prevent glitch death when opening chute
_paraPosition1 = [_unit] call FNC_GetPos;
_para = createVehicle ["ParachuteWest", _paraPosition1, [], 0, "CAN_COLLIDE"];
//_para = "BIS_Steerable_Parachute" createVehicle position _unit;
_para setpos _paraPosition1;
_para setdir direction _unit;
_vel = velocity _unit;
_unit moveindriver _para;
//_unit moveingunner _para;
_para lock false;
bis_fnc_halo_para_dirAbs = direction _para;
_unit allowDamage true;
//--- Key controls
if (_unit == player) then {
_para setvelocity [(_vel select 0),(_vel select 1),(_vel select 2)*1];
/*
bis_fnc_halo_DynamicBlur = ppeffectcreate ["DynamicBlur",464];
bis_fnc_halo_DynamicBlur ppEffectEnable true;
bis_fnc_halo_DynamicBlur ppEffectAdjust [8.0];
bis_fnc_halo_DynamicBlur ppEffectCommit 0;
bis_fnc_halo_DynamicBlur ppEffectAdjust [0.0];
bis_fnc_halo_DynamicBlur ppEffectCommit 1;
*/
bis_fnc_halo_para_vel = 0;
bis_fnc_halo_para_velLimit = 0.5;
bis_fnc_halo_para_velAdd = 0.01;
bis_fnc_halo_para_dir = 0;
bis_fnc_halo_para_dirLimit = 1.5;
bis_fnc_halo_para_dirAdd = 0.03;
bis_fnc_halo_para_keydown = {
_key = _this select 1;
//--- Forward
if (_key in (actionkeys 'MoveForward')) then {
if (bis_fnc_halo_para_vel < +bis_fnc_halo_para_velLimit) then {bis_fnc_halo_para_vel = bis_fnc_halo_para_vel + bis_fnc_halo_para_velAdd};
};
//--- Backward
if (_key in (actionkeys 'MoveBack')) then {
if (bis_fnc_halo_para_vel > -bis_fnc_halo_para_velLimit*0) then {bis_fnc_halo_para_vel = bis_fnc_halo_para_vel - bis_fnc_halo_para_velAdd};
};
//--- Left
if (_key in (actionkeys 'TurnLeft')) then {
if (bis_fnc_halo_para_dir > -bis_fnc_halo_para_dirLimit) then {bis_fnc_halo_para_dir = bis_fnc_halo_para_dir - bis_fnc_halo_para_dirAdd};
};
//--- Right
if (_key in (actionkeys 'TurnRight')) then {
if (bis_fnc_halo_para_dir < +bis_fnc_halo_para_dirLimit) then {bis_fnc_halo_para_dir = bis_fnc_halo_para_dir + bis_fnc_halo_para_dirAdd};
};
};
bis_fnc_halo_para_loop_time = time - 0.1;
bis_fnc_halo_para_velZ = velocity _para select 2;
bis_fnc_halo_para_loop = {
if (!isnil {player getvariable "bis_fnc_halo_terminate"}) exitwith {};
if (time == bis_fnc_halo_para_loop_time) exitwith {}; //--- FPS too high
_para = vehicle player;
//--- FPS counter
_fpsCoef = ((time - bis_fnc_halo_para_loop_time) * 20) / acctime; //Script is optimized for 20 FPS
bis_fnc_halo_para_loop_time = time;
//_fpsCoef = _fpsCoef / 3;
bis_fnc_halo_para_velLimit = 0.3 * _fpsCoef;
bis_fnc_halo_para_velAdd = 0.002 * _fpsCoef;
bis_fnc_halo_para_dirLimit = 1.5 * _fpsCoef;
bis_fnc_halo_para_dirAdd = 0.03 * _fpsCoef;
//--- Dir
bis_fnc_halo_para_dir = bis_fnc_halo_para_dir * 0.98;
bis_fnc_halo_para_dirAbs = bis_fnc_halo_para_dirAbs + bis_fnc_halo_para_dir;
_para setdir bis_fnc_halo_para_dirAbs;
_dir = direction _para;
//--- Crash
_velZ = velocity _para select 2;
//if ((_velZ - bis_fnc_halo_para_velZ) > 7 && (getposatl _para select 2) < 100) then {player setdamage 1;debuglog ["Log::::::::::::::",(_velZ - bis_fnc_halo_para_velZ)];};
bis_fnc_halo_para_velZ = _velZ;
//--- Pos
_para setposasl [
(getposasl _para select 0) + (sin _dir * (0.1 + bis_fnc_halo_para_vel)),
(getposasl _para select 1) + (cos _dir * (0.1 + bis_fnc_halo_para_vel)),
(getposasl _para select 2) - 0.01 - 0.1 * abs bis_fnc_halo_para_vel
];
[
_para,
(-bis_fnc_halo_para_vel * 75) + 0.5*(sin (time * 180)),
(+bis_fnc_halo_para_dir * 25) + 0.5*(cos (time * 180))
] call bis_fnc_setpitchbank;
};
bis_fnc_halo_para_mousemoving_eh = (finddisplay 46) displayaddeventhandler ["mousemoving","_this call bis_fnc_halo_para_loop;"];
bis_fnc_halo_para_mouseholding_eh = (finddisplay 46) displayaddeventhandler ["mouseholding","_this call bis_fnc_halo_para_loop;"];
uiSleep 4;
// ppeffectdestroy bis_fnc_halo_DynamicBlur;
bis_fnc_halo_para_keydown_eh = (finddisplay 46) displayaddeventhandler ["keydown","_this call bis_fnc_halo_para_keydown;"];
//--- End
//waituntil {vehicle player == player};
player setvariable ["bis_fnc_halo_terminate",nil];
waituntil {(([(vehicle player)] call FNC_GetPos) select 2) < 2 || !isnil {player getvariable "bis_fnc_halo_terminate"}};
(finddisplay 46) displayremoveeventhandler ["keydown",bis_fnc_halo_para_keydown_eh];
(finddisplay 46) displayremoveeventhandler ["mousemoving",bis_fnc_halo_para_mousemoving_eh];
(finddisplay 46) displayremoveeventhandler ["mouseholding",bis_fnc_halo_para_mouseholding_eh];
bis_fnc_halo_para_vel = nil;
bis_fnc_halo_para_velLimit = nil;
bis_fnc_halo_para_velAdd = nil;
bis_fnc_halo_para_dir = nil;
bis_fnc_halo_para_dirLimit = nil;
bis_fnc_halo_para_dirAdd = nil;
bis_fnc_halo_para_keydown = nil;
bis_fnc_halo_para_loop = nil;
bis_fnc_halo_para_keydown_eh = nil;
bis_fnc_halo_para_mousemoving_eh = nil;
bis_fnc_halo_para_mouseholding_eh = nil;
bis_fnc_halo_para_dirAbs = nil;
};
};

@ -0,0 +1,6 @@
/*
DZAI Version Identifier File
*/
#define DZAI_CLIENT_TYPE "DZAI Client Addon"
#define DZAI_CLIENT_VERSION "1.0.0"

@ -0,0 +1,15 @@
if (isServer) exitWith {};
/*
DZAI Client-side Addon Configuration File
*/
//Enables use of client-side radio functions. DZAI_clientRadio must be set 'true' in dzai_config.sqf.
DZAIC_radio = false;
//Enables AI hostility to zombies. DZAI_zombieEnemy must be set 'true' in dzai_config.sqf.
DZAIC_zombieEnemy = false;
//Enables death messages to be displayed to players who kill AI units. DZAI_deathMessages must be set 'true' in dzai_config.sqf
DZAIC_deathMessages = false;

@ -0,0 +1,37 @@
if (isServer) exitWith {};
#include "DZAI_client_version.hpp"
diag_log format ["[DZAI] Initializing %1 version %2.",DZAI_CLIENT_TYPE,DZAI_CLIENT_VERSION];
call compile preprocessFileLineNumbers "dayz_code\DZAI_Client\dzai_client_config.sqf";
if (DZAIC_radio) then {
"DZAI_SMS" addPublicVariableEventHandler {
if (isNil "DZAI_noRadio") then {
systemChat (_this select 1);
DZAI_noRadio = true;
_nul = (_this select 1) spawn {
for "_i" from 1 to 2 do {cutText [_this, "PLAIN DOWN"];sleep 0.5;};
DZAI_noRadio = nil;
};
};
};
};
if (DZAIC_zombieEnemy) then {
"DZAI_ratingModify" addPublicVariableEventHandler {
_targets = (_this select 1) select 0;
_rating = (_this select 1) select 1;
{
if (local _x) then {_x addRating _rating};
} forEach _targets;
};
};
if (DZAIC_deathMessages) then {
"DZAI_killMSG" addPublicVariableEventHandler {
systemChat format ["%1 was killed",(_this select 1)];
//diag_log format ["DZAI Debug: %1 was killed.",(_this select 1)];
};
};

@ -50,7 +50,3 @@ if (!isDedicated) then {
vg_limit = 5; vg_limit = 5;
*/ */
}; };
Z_singleCurrency = true;
Z_globalBanking = true;
Z_globalBankingTraders = true;

@ -94,7 +94,7 @@ if (!isDedicated) then {
ZSC_bankTraders = ["Functionary1_EP1"]; // Array of trader classnames that are available for banking (i.e Functionary1_EP1), do not use _DZ classes - they are used as player skins ZSC_bankTraders = ["Functionary1_EP1"]; // Array of trader classnames that are available for banking (i.e Functionary1_EP1), do not use _DZ classes - they are used as player skins
ZSC_limitOnBank = true; // Have a limit on the bank? (i.e true or false) limits the global banking to the number below. ZSC_limitOnBank = true; // Have a limit on the bank? (i.e true or false) limits the global banking to the number below.
ZSC_bankObjects = ["SignM_FARP_Winchester_EP1","ATM_DZ"]; // Array of objects that are available for banking i.e: ["Suitcase","Info_Board_EP1","Laptop_EP1","SatPhone"] ZSC_bankObjects = ["SignM_FARP_Winchester_EP1","ATM_DZ"]; // Array of objects that are available for banking i.e: ["Suitcase","Info_Board_EP1","Laptop_EP1","SatPhone"]
ZSC_maxBankMoney = 5000000; // Default limit for bank objects. ZSC_maxBankMoney = 15000000; // Default limit for bank objects.
ZSC_defaultStorageMultiplier = 50; // Default magazine count for bank objects that don't have storage slots i.e: ["Suitcase","Info_Board_EP1","Laptop_EP1","SatPhone"] ZSC_defaultStorageMultiplier = 50; // Default magazine count for bank objects that don't have storage slots i.e: ["Suitcase","Info_Board_EP1","Laptop_EP1","SatPhone"]
ZSC_MaxMoneyInStorageMultiplier = 1000; // Multiplier for how much money a bank object can hold, example: 200 magazine slots in the object (or the default value above ^^) multiplied by the 5000 multiplier is 1 million coin storage. (200 * 5000 = 1,000,000 coins) ZSC_MaxMoneyInStorageMultiplier = 1000; // Multiplier for how much money a bank object can hold, example: 200 magazine slots in the object (or the default value above ^^) multiplied by the 5000 multiplier is 1 million coin storage. (200 * 5000 = 1,000,000 coins)
ZSC_ZombieCoins = [true,[10,500]]; // First value activate coins on zombies, second value from 0 - 1000 coins on each zombie. Coin for zombies are handled directly in check wallet. ZSC_ZombieCoins = [true,[10,500]]; // First value activate coins on zombies, second value from 0 - 1000 coins on each zombie. Coin for zombies are handled directly in check wallet.
@ -207,14 +207,15 @@ call compile preprocessFileLineNumbers "logistic\init.sqf";
execVM "\z\addons\dayz_code\system\antihack.sqf"; execVM "\z\addons\dayz_code\system\antihack.sqf";
if (dayz_townGenerator) then {execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf";}; if (dayz_townGenerator) then {execVM "\z\addons\dayz_code\compile\client_plantSpawner.sqf";};
call compile preprocessFileLineNumbers "spawn\init.sqf";
"EAT_login" addPublicVariableEventHandler {call (_this select 1)}; "EAT_login" addPublicVariableEventHandler {call (_this select 1)};
EAT_clientToServer = ["login", player]; EAT_clientToServer = ["login", player];
publicVariableServer "EAT_clientToServer"; publicVariableServer "EAT_clientToServer";
call compile preprocessFileLineNumbers "scripts\marker_manager.sqf"; call compile preprocessFileLineNumbers "scripts\marker_manager.sqf";
call compile preprocessFileLineNumbers "spawn\init.sqf";
execFSM "\z\addons\dayz_code\system\player_monitor.fsm"; execFSM "\z\addons\dayz_code\system\player_monitor.fsm";
call compile preprocessFileLineNumbers "dayz_code\DZAI_Client\dzai_initclient.sqf";
execVM "scripts\servicePoints\init.sqf"; execVM "scripts\servicePoints\init.sqf";
//[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf"; //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
//[600,.15,30] execVM "\z\addons\dayz_code\compile\fn_chimney.sqf"; // Smoking chimney effects. //[600,.15,30] execVM "\z\addons\dayz_code\compile\fn_chimney.sqf"; // Smoking chimney effects.

@ -6,29 +6,79 @@
*/ */
class_selection = true; //Enable class selection dialog class_selection = true; //Enable class selection dialog
#define START_ITEMS "HandRoadFlare","ItemBandage",2,"ItemPainkiller","ItemWaterbottle","FoodPistachio","PartGeneric" #define START_ITEMS "HandRoadFlare","ItemBandage",2,"ItemPainkiller","ItemWaterbottle","FoodPistachio"
class_public = [ // These are visible to anyone on the server class_public = [ // These are visible to anyone on the server
[(localize "str_playerstats_bandit")+" Lvl1","Bandit1_DZ","BanditW1_DZ",[START_ITEMS,"17Rnd_9x19_glock17",2],["G17_DZ"],"",[],[],0,-5000,0,""], [(localize "str_playerstats_bandit")+" Lvl1","Bandit1_DZ","BanditW1_DZ",[START_ITEMS,"17Rnd_9x19_glock17",2],["G17_DZ"],"",[],[],0,-5000,0,""],
[(localize "str_playerstats_bandit")+" Lvl2","Bandit1_DZ","BanditW1_DZ",[START_ITEMS,"30Rnd_9x19_UZI",3,"ItemMorphine"],["PDW_DZ"],if (class_epoch) then {"Assault_Pack_DZE1"} else {"DZ_Assault_Pack_EP1"},[],[],0,-15000,0,""], [(localize "str_playerstats_bandit")+" Lvl2","Bandit1_DZ","BanditW1_DZ",[START_ITEMS,"17Rnd_9x19_glock17",3,"ItemMorphine"],["G17_DZ"],if (class_epoch) then {"Assault_Pack_DZE1"} else {"DZ_Assault_Pack_EP1"},[],[],0,-10000,0,""],
[(localize "str_playerstats_bandit")+" Lvl3","Bandit1_DZ","BanditW1_DZ",[START_ITEMS,"30Rnd_9x19_UZI_SD",4,"ItemMorphine"],["PDW_SD_DZ"],if (class_epoch) then {"TK_Assault_Pack_DZE1"} else {"DZ_TK_Assault_Pack_EP1"},[],[],0,-25000,0,"MeleeHatchet"], [(localize "str_playerstats_bandit")+" Lvl3","Bandit1_DZ","BanditW1_DZ",[START_ITEMS,"17Rnd_9x19_glock17",4,"ItemMorphine"],["G17_DZ"],if (class_epoch) then {"TK_Assault_Pack_DZE1"} else {"DZ_TK_Assault_Pack_EP1"},[],[],0,-15000,0,"MeleeHatchet"],
[(localize "str_playerstats_hero")+" Lvl1",if (class_epoch) then {"Soldier_Sniper_PMC_DZ"} else {"Survivor3_DZ"},"SurvivorW2_DZ",[START_ITEMS,"6Rnd_45ACP",2],["Revolver_DZ"],"",[],[],0,10000,0,""], [(localize "str_playerstats_hero")+" Lvl1",if (class_epoch) then {"Soldier_Sniper_PMC_DZ"} else {"Survivor3_DZ"},"SurvivorW2_DZ",[START_ITEMS,"6Rnd_45ACP",2],["Revolver_DZ"],"",[],[],0,5000,0,""],
[(localize "str_playerstats_hero")+" Lvl2",if (class_epoch) then {"Soldier_Sniper_PMC_DZ"} else {"Survivor3_DZ"},"SurvivorW2_DZ",[START_ITEMS,"30Rnd_9x19_UZI",3,"ItemMorphine"],["PDW_DZ"],if (class_epoch) then {"Assault_Pack_DZE1"} else {"DZ_Assault_Pack_EP1"},[],[],0,20000,0,""], [(localize "str_playerstats_hero")+" Lvl2",if (class_epoch) then {"Soldier_Sniper_PMC_DZ"} else {"Survivor3_DZ"},"SurvivorW2_DZ",[START_ITEMS,"6Rnd_45ACP",3,"ItemMorphine"],["Revolver_DZ"],if (class_epoch) then {"Assault_Pack_DZE1"} else {"DZ_Assault_Pack_EP1"},[],[],0,10000,0,""],
[(localize "str_playerstats_hero")+" Lvl3",if (class_epoch) then {"Soldier_Sniper_PMC_DZ"} else {"Survivor3_DZ"},"SurvivorW2_DZ",[START_ITEMS,"30Rnd_9x19_UZI_SD",4,"ItemMorphine"],["PDW_SD_DZ"],if (class_epoch) then {"TK_Assault_Pack_DZE1"} else {"DZ_TK_Assault_Pack_EP1"},[],[],0,30000,0,"MeleeHatchet"], [(localize "str_playerstats_hero")+" Lvl3",if (class_epoch) then {"Soldier_Sniper_PMC_DZ"} else {"Survivor3_DZ"},"SurvivorW2_DZ",[START_ITEMS,"6Rnd_45ACP",4,"ItemMorphine"],["Revolver_DZ"],if (class_epoch) then {"TK_Assault_Pack_DZE1"} else {"DZ_TK_Assault_Pack_EP1"},[],[],0,15000,0,"MeleeHatchet"],
[localize "str_playerstats_survivor","Survivor2_DZ","SurvivorW2_DZ",[START_ITEMS,"8Rnd_9x18_Makarov",2],["Makarov_DZ"],"",[],[],0,0,0] [localize "str_playerstats_survivor","Survivor2_DZ","SurvivorW2_DZ",[START_ITEMS,"8Rnd_9x18_Makarov",2],["Makarov_DZ"],"",[],[],0,0,0]
]; ];
halo_selection = true; // Enable HALO selection dialog halo_selection = true; // Enable HALO selection dialog
halo_force = false; // Skip HALO selection dialog and force HALO spawn. halo_force = false; // Skip HALO selection dialog and force HALO spawn.
halo_type = "C130J_US_EP1_DZ"; // Type of plane. Tested with C130J_US_EP1_DZ, AN2_DZ, MV22_DZ. Use "" to disable the plane and use regular HALO. halo_type = "AN2_DZ"; // Type of plane. Tested with C130J_US_EP1_DZ, AN2_DZ, MV22_DZ. Use "" to disable the plane and use regular HALO.
spawn_selection = true; // Enable spawn selection dialog spawn_selection = true; // Enable spawn selection dialog
spawn_bodyCheck = 1500; // If a player has a body within this distance of a spawn that spawn will be blocked. Set to -1 to disable. spawn_bodyCheck = 4000; // If a player has a body within this distance of a spawn that spawn will be blocked. Set to -1 to disable.
spawn_nearGroup = false; // Allow players to spawn near their group. BodyCheck can override. spawn_nearGroup = false; // Allow players to spawn near their group. BodyCheck can override.
spawn_nearPlot = true; // Allow players to spawn near their plot. BodyCheck can override. spawn_nearPlot = false; // Allow players to spawn near their plot. BodyCheck can override.
spawn_radius = 1200; // Distance around spawn to find a safe pos. Lower is closer to exact coordinates. Do not set too low or BIS_fnc_findSafePos may fail. spawn_radius = 800; // Distance around spawn to find a safe pos. Lower is closer to exact coordinates. Do not set too low or BIS_fnc_findSafePos may fail.
spawn_public = switch (toLower worldName) do { spawn_public = call {
case "napf": { if ((toLower worldName) in ["chernarus","chernarus_winter"]) exitwith {
[
[localize "str_disp_srvsetup_random",[[4523,2444,0],[12037,9100,0],[6723,2562,0],[10417,2120,0],[1896,2242,0],[13470,6306,0]],0,0,1], // Random will never be blocked, so always keep it if using body check.
[localize "str_location_balota",[4523,2444,0],0,0],
[localize "str_location_berezino",[12037,9100,0],0,0],
[localize "str_location_chernogorsk",[6723,2562,0],0,0],
[localize "str_location_elektrozavodsk",[10417,2120,0],0,0],
[localize "str_location_kamenka",[1896,2242,0],0,0],
[localize "str_location_solnichniy",[13470,6306,0],0,0],
// Above are defaults
[localize "str_location_loc_devilscastle",[6900,11419,0],0,0],
[localize "str_location_gorka",[9659,8839,0],0,0],
[localize "str_location_grishino",[5967,10323,0],0,0],
[localize "str_location_guglovo",[8472,6754,0],0,0],
[localize "str_location_gvozdno",[8654,11832,0],0,0],
[localize "str_location_kabanino",[5346,8630,0],0,0],
[localize "str_location_kamyshovo",[12073,3490,0],0,0],
[localize "str_location_komarovo",[3643,2473,0],0,0],
[localize "str_location_krasnostav",[11342,12232,0],0,0],
[localize "str_location_loc_capkrutoy",[13395,4159,0],0,0],
[localize "str_location_lopatino",[2731,10000,0],0,0],
[localize "str_location_petrovka",[5035,12459,0],0,0],
[localize "str_location_pogorevka",[4461,6424,0],0,0],
[localize "str_location_prigorodki",[8059,3381,0],0,0],
[localize "str_location_pusta",[9178,3928,0],0,0],
[localize "str_location_vybor",[3893,8883,0],0,0],
[localize "str_location_vyshnoe",[6612,6065,0],0,0],
[localize "str_location_zelenogorsk",[2858,5313,0],0,0]
]
};
if ((toLower worldName) in ["tavi","taviana"]) exitwith {
[
[localize "str_disp_srvsetup_random",[[9093,2614,0],[17588,4952,0],[15954,15847,0],[16674,13930,0],[11361,6685,0],[17744,10299,0],[18292,7537,0],[13561,19300,0],[15246,17425,0],[12268,9763,0]],0,0,1],
["Topolka",[9093,2614,0],0,0],
["Stari Sad",[17588,4952,0],0,0],
["Sevastopol",[15954,15847,0],0,0],
["Martin",[16674,13930,0],0,0],
["Komarovo",[11361,6685,0],0,0],
["Dubovo",[17744,10299,0],0,0],
["Byelov",[18292,7537,0],0,0],
["Khotanovsk",[13561,19300,0],0,0],
["Dalnogorsk",[15246,17425,0],0,0],
// Above are defaults
["Kameni",[8350,18937,0],0,0],
["Lyepestok",[11238,14413,0],0,0],
["Marina",[10184,1542,0],0,0],
["Race Track",[1529,7271,0],0,0],
["Chernovar",[5904,10519,0],0,0]
]
};
if ((toLower worldName) == "napf") exitwith {
[ [
[localize "str_disp_srvsetup_random",[[5411,16676,0],[1511,11479,0],[12231,16319,0],[6946,17385,0],[12862,14850,0],[4672,14940,0],[2720,12226,0],[4104,13026,0],[1461,10584,0],[10283,18449,0],[10709,17085,0]],0,0,1], [localize "str_disp_srvsetup_random",[[5411,16676,0],[1511,11479,0],[12231,16319,0],[6946,17385,0],[12862,14850,0],[4672,14940,0],[2720,12226,0],[4104,13026,0],[1461,10584,0],[10283,18449,0],[10709,17085,0]],0,0,1],
["Seltishafen",[5411,16676,0],0,0], ["Seltishafen",[5411,16676,0],0,0],
@ -54,4 +104,114 @@ spawn_public = switch (toLower worldName) do {
["Waldegg",[8538,852,0],0,0] ["Waldegg",[8538,852,0],0,0]
] ]
}; };
if ((toLower worldName) == "lingor") exitwith {
[
[localize "str_disp_srvsetup_random",[[2085,5501,0],[1355,315,0],[4550,913,0],[8880,1703,0],[580,5547,0],[3250,2556,0],[6143,2753,0],[1269,2858,0],[8295,8667,0],[9072,7323,0],[6899,3971,0]],0,0,1],
["Vidora",[2085,5501,0],0,0],
["Alma",[1355,315,0],0,0],
["Calamar",[4550,913,0],0,0],
["Pikawas",[8880,1703,0],0,0],
["Benio",[580,5547,0],0,0],
["Aguado",[3250,2556,0],0,0],
["Prospero",[6143,2753,0],0,0],
["Rago",[1269,2858,0],0,0],
["Cemarin",[8295,8667,0],0,0],
["Conoteta",[9072,7323,0],0,0],
["Sanvigado",[6899,3971,0],0,0]
// Above are defaults
]
};
if ((toLower worldName) == "namalsk") exitwith {
[
[localize "str_disp_srvsetup_random",[[4620,10916,0],[7600,6020,0],[6498,11851,0],[7668,11707,0],[4340,4960,0],[7885,7206,0],[3013,7506,0],[4673,10004,0],[7859,9096,0],[8756,10119,0],[5823,5641,0]],0,0,1],
["Lubjansk",[4620,10916,0],0,0],
["Old Sawmill",[7600,6020,0],0,0],
["West Vorkuta",[6498,11851,0],0,0],
["East Vorkuta",[7668,11707,0],0,0],
["Brensk",[4340,4960,0],0,0],
["Tara Harbor",[7885,7206,0],0,0],
["Norinsk Tunnel",[3013,7506,0],0,0],
["Lubjansk Bay",[4673,10004,0],0,0],
["Nemsk Factory",[7859,9096,0],0,0],
["Jalovisko",[8756,10119,0],0,0],
["Brensk Bay",[5823,5641,0],0,0]
// Above are defaults
]
};
if ((toLower worldName) == "sauerland") exitwith {
[
[localize "str_disp_srvsetup_random",[[15448,8466,0],[19488,7462,0],[19478,12440,0],[20210,14501,0],[16453,6895,0],[19666,10377,0],[11000,10157,0],[10669,13320,0],[11349,12225,0],[12104,8936,0],[12879,14983,0]],0,0,1],
["Buersfeld",[15448,8466,0],0,0],
["Hoeinghausen",[19488,7462,0],0,0],
["Berghausen",[19478,12440,0],0,0],
["Heggen",[20210,14501,0],0,0],
["Heidermuehle",[16453,6895,0],0,0],
["Remblinghausen",[19666,10377,0],0,0],
["Schueren",[11000,10157,0],0,0],
["Schmallenberg",[10669,13320,0],0,0],
["Calle",[11349,12225,0],0,0],
["Oberdorf",[12104,8936,0],0,0],
["Burg Calle",[12879,14983,0],0,0],
// Above are defaults
["Strelingen",[3437,18843,0],0,0],
["Berghoven",[18734,21955,0],0,0],
["Oeventrop",[8668,22650,0],0,0],
["Arnsberg",[1134,24264,0],0,0],
["Suederbarup",[13260,543,0],0,0],
["Osterholz",[2580,8344,0],0,0],
["Uhlenbusch",[4092,12942,0],0,0],
["Ihrhofen",[9640,19193,0],0,0],
["Old Airfield",[17253,2167,0],0,0]
]
};
if ((toLower worldName) == "panthera2") exitwith {
[
[localize "str_disp_srvsetup_random",[[2354,5213,0],[3281,3348,0],[4793,1862,0],[5969,944,0],[7873,1403,0],[8425,3152,0],[8679,5043,0],[7961,4949,0],[6420,6127,0],[4823,6512,0],[3354,6649,0],[5549,7227,0],[4624,8042,0],[2267,9042,0],[1062,9359,0],[1646,8814,0],[5406,3876,0],[7883,1936,0],[7022,1134,0],[5840,2363,0],[2688,3400,0]],0,0,1],
["Sella Nevea",[2354,5213,0],0,0],
["Kobarid",[3281,3348,0],0,0],
["Taff Grove",[4793,1862,0],0,0],
["Zappado",[5969,944,0],0,0],
["New Skooma",[7873,1403,0],0,0],
["Zelezniki",[8425,3152,0],0,0],
["Begunje",[8679,5043,0],0,0],
["Bled",[7961,4949,0],0,0],
["Mojstrana",[6420,6127,0],0,0],
["Podkoren",[4823,6512,0],0,0],
["Tarvisio",[3354,6649,0],0,0],
// Above are defaults
["Hoopsberg",[5549,7227,0],0,0],
["Arnoldstein",[4624,8042,0],0,0],
["Mello",[2267,9042,0],0,0],
["Vatra",[1062,9359,0],0,0],
["Borna",[1646,8814,0],0,0],
["Ukanc",[5406,3876,0],0,0],
["Smugglers Den",[7883,1936,0],0,0],
["Foxhill",[7022,1134,0],0,0],
["Koritnica",[5840,2363,0],0,0],
["FOB Boriana",[2688,3400,0],0,0]
]
};
if ((toLower worldName) == "smd_sahrani_a2") exitwith {
[
[localize "str_disp_srvsetup_random",[[11369,5348,0],[9343,5953,0],[7645,6408,0],[12369,7108,0],[9131,8319,0],[10697,9490,0],[13197,8848,0],[14307,12496,0],[9763,14424,0],[10690,16186,0],[17314,14304,0],[18952,13913,0],[4541,15297,0],[9691,11021,0],[8311,9058,0],[2106,2679,0],[7767,15806,0],[6222,17336,0],[14230,1691,0]],0,0,1],
["Parato",[11369,5348,0],0,0],
["Cayo",[9343,5953,0],0,0],
["Arcadia",[7645,6408,0],0,0],
["Ortego",[12369,7108,0],0,0],
["Somato",[9131,8319,0],0,0],
["Paraiso",[10697,9490,0],0,0],
["Corazol",[13197,8848,0],0,0],
["Bagango",[14307,12496,0],0,0],
["Pacamac",[9763,14424,0],0,0],
["Mataredo",[10690,16186,0],0,0],
["Masbete",[17314,14304,0],0,0],
["Pita",[18952,13913,0],0,0],
["Isla Del Vassal",[4541,15297,0],0,0],
["Rashidah",[9691,11021,0],0,0],
["Chantico",[8311,9058,0],0,0],
["Rahmadi",[2106,2679,0],0,0],
["Hunapu",[7767,15806,0],0,0],
["Cabo Valiente",[6222,17336,0],0,0]
]
};
}; };

@ -1,7 +1,11 @@
if (player distance respawn_west_original < 100) then { if (player distance respawn_west_original < 100) then {
// Ground spawn // Ground spawn
player setPosATL _grid; player setPosATL _grid;
if (surfaceIsWater respawn_west_original) then {player call fn_exitSwim;}; if (surfaceIsWater respawn_west_original) then {
player allowDamage false;
player call fn_exitSwim;
player allowDamage true;
};
// Show infoText if not in HALO spawn // Show infoText if not in HALO spawn
_nearestCity = nearestLocations [_grid, ["NameCityCapital","NameCity","NameVillage","NameLocal"],1000]; _nearestCity = nearestLocations [_grid, ["NameCityCapital","NameCity","NameVillage","NameLocal"],1000];

@ -19,7 +19,6 @@ if (!class_epoch) then { //Undefined variables in vanilla
DZE_HaloJump = false; DZE_HaloJump = false;
DZE_HaloOpenChuteHeight = 180; DZE_HaloOpenChuteHeight = 180;
DZE_HaloSpawnHeight = 2000; DZE_HaloSpawnHeight = 2000;
Z_MoneyVariable = "cashMoney";
}; };
if (spawn_selection) then { if (spawn_selection) then {

@ -144,7 +144,7 @@ if (class_selection && !_isPZombie) then {
[_bweps,3,_bag] call class_fillItems; [_bweps,3,_bag] call class_fillItems;
}; };
if (_onBack != "") then {dayz_onBack = _onBack;}; if (_onBack != "") then {dayz_onBack = _onBack;player setVariable ["dayz_onBack",dayz_onBack,true];};
_main = primaryWeapon player; _main = primaryWeapon player;
if (_main == "") then { if (_main == "") then {
@ -166,10 +166,11 @@ if (class_selection && !_isPZombie) then {
case (count class_choice > 0): {class_choice select 8}; //Custom loadout by UID case (count class_choice > 0): {class_choice select 8}; //Custom loadout by UID
default {0}; default {0};
}; };
if (Z_SingleCurrency) then {
_wealth = player getVariable [Z_MoneyVariable,0]; _wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
if (_wealth < _coins) then { if (_wealth < _coins) then {
player setVariable [Z_MoneyVariable,(_wealth + _coins),true]; player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),(_wealth + _coins),true];
};
}; };
}; };