Closes #15 Reviewed-on: #16 Co-authored-by: stuzer05 <stuzer05@stuzer.link> Co-committed-by: stuzer05 <stuzer05@stuzer.link>
This commit is contained in:
@ -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.
|
||||
#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_NAMES ["AdminName","AdminName","AdminName"]
|
||||
#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.
|
||||
//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)
|
||||
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: [])
|
||||
//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.
|
||||
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])
|
||||
DZAI_launcherLevels = [1,2,3];
|
||||
|
@ -32,7 +32,7 @@ DZMSObjectsDamageOff = false;
|
||||
DZMSAnnounceType = "TitleText";
|
||||
|
||||
// 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?
|
||||
DZMSMissHumanity = true;
|
||||
@ -62,7 +62,7 @@ DZMSRunGear = false;
|
||||
|
||||
// How long before bodies disappear? (in minutes) (default = 30)
|
||||
// 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)
|
||||
//( 0 is 0% of AI / 0.50 is 50% / 1 is 100% )
|
||||
@ -142,9 +142,9 @@ DZMSMissionArray = [
|
||||
"Medical_Outpost", // Medical Supplies, Weapons
|
||||
"Weapons_Cache", // Weapons
|
||||
"Stash_house", // Weapons
|
||||
"Weapons_Truck" // Weapons
|
||||
//"SMA1","SMA2","SMA3","SMA4","SMA5","SMA6",
|
||||
//"SMI1","SMI2","SMI3","SMI4","SM5I","SMI6"
|
||||
"Weapons_Truck", // Weapons
|
||||
"SMA1","SMA2","SMA3","SMA4","SMA5","SMA6",
|
||||
"SMI1","SMI2","SMI3","SMI4","SM5I","SMI6"
|
||||
];
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
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_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 */
|
||||
|
||||
|
@ -18,37 +18,4 @@ VG_RandomizeMyKey = {
|
||||
_return;
|
||||
};
|
||||
vg_serverKey = toString (8 call VG_RandomizeMyKey);
|
||||
vg_alreadySpawned = [];
|
||||
|
||||
VG_ClearTurrets = {
|
||||
//By denvdmj (probably, I found it on the biki)
|
||||
private ["_weaponArray","_findRecurse","_class","_obj","_turret","_mags"];
|
||||
_obj = _this;
|
||||
|
||||
_weaponArray = [];
|
||||
_weaponArray set [count _weaponArray,[-1]];
|
||||
|
||||
_findRecurse = {
|
||||
private ["_root", "_class", "_path", "_currentPath", "_thisThis"];
|
||||
_root = (_this select 0);
|
||||
_path = +(_this select 1);
|
||||
_thisThis = _this select 2;
|
||||
for "_i" from 0 to count _root -1 do {
|
||||
_class = _root select _i;
|
||||
if (isClass _class) then {
|
||||
_currentPath = _path + [_i];
|
||||
{_weaponArray set [count _weaponArray, _currentPath];} count getArray (_class >> "weapons");
|
||||
_class = _class >> "turrets";
|
||||
if (isClass _class) then {[_class, _currentPath, _thisThis] call _findRecurse;};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
[configFile >> "CfgVehicles" >> typeOf (_obj) >> "turrets", [], _this] call _findRecurse;
|
||||
|
||||
{
|
||||
_turret = _x;
|
||||
_mags = _obj magazinesTurret _turret;
|
||||
{_obj removeMagazinesTurret[_x,_turret];} count _mags;
|
||||
} forEach _weaponArray;
|
||||
};
|
||||
vg_alreadySpawned = [];
|
@ -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;
|
||||
_player = _this select 1;
|
||||
@ -53,18 +53,17 @@ if (_outcome != "PASS") then {
|
||||
_object setPos _location;
|
||||
};
|
||||
|
||||
_object addEventHandler ["HandleDamage",{false}];
|
||||
_object addEventHandler ["HandleDamage",{0}];
|
||||
|
||||
clearWeaponCargoGlobal _object;
|
||||
clearMagazineCargoGlobal _object;
|
||||
if (vg_clearAmmo && {vg_serverKey == _serverKey}) then {_object call VG_ClearTurrets;};
|
||||
|
||||
_object setFuel _fuel;
|
||||
_object setDamage _damage;
|
||||
|
||||
[_inventory select 0,_inventory select 1,_inventory select 2,_object] call fn_addCargo;
|
||||
|
||||
_object setVariable ["ObjectID", _oid, true];
|
||||
_object setVariable ["ObjectID", _oid];
|
||||
_object setVariable ["lastUpdate",diag_tickTime];
|
||||
_object setVariable ["VGObjectID",_VG_ObjID, false];
|
||||
|
||||
@ -83,22 +82,19 @@ if (_outcome != "PASS") then {
|
||||
processInitCommands;
|
||||
|
||||
_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";};
|
||||
_isAir = _object isKindOf "Air";
|
||||
|
||||
{
|
||||
_selection = _x select 0;
|
||||
_dam = _x select 1;
|
||||
_dam = [_x select 1,(_x select 1) min 0.8] select (!_isAir && {_selection in dayZ_explosiveParts});
|
||||
[_object,_selection,_dam] call fnc_veh_setFixServer;
|
||||
} forEach _hitpoints;
|
||||
|
||||
[_object,_hitpoints] call server_setHitpoints;
|
||||
|
||||
[_object,"all",true] call server_updateObject;
|
||||
|
||||
[_object,vg_clearAmmo,false] call fn_vehicleAddons;
|
||||
|
||||
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
|
||||
|
||||
_object call fnc_veh_ResetEH;
|
||||
{if (_object isKindOf _x) exitWith {_object disableTIEquipment true;}} count vg_disableThermal;
|
||||
_object call fnc_veh_ResetEH;
|
||||
|
||||
PVDZE_veh_Init = _object;
|
||||
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;
|
||||
_player = _this select 1;
|
||||
@ -6,31 +6,9 @@ _woGear = _this select 2;
|
||||
_clientID = owner _player;
|
||||
_playerUID = if (count _this > 3) then {_this select 3} else {getPlayerUID _player};
|
||||
|
||||
_gearCount = {
|
||||
private ["_counter"];
|
||||
_counter = 0;
|
||||
{_counter = _counter + _x;} count _this;
|
||||
_counter;
|
||||
};
|
||||
|
||||
_fnc_sanitizeInput = {
|
||||
private ["_input","_badChars"];
|
||||
|
||||
_input = _this;
|
||||
_input = toArray (_input);
|
||||
_badChars = [60,62,38,123,125,91,93,59,58,39,96,126,44,46,47,63,124,92,34];
|
||||
|
||||
{
|
||||
_input = _input - [_x];
|
||||
} forEach _badChars;
|
||||
|
||||
_input = toString (_input);
|
||||
_input
|
||||
};
|
||||
|
||||
_class = typeOf _vehicle;
|
||||
_displayName = (getText(configFile >> "cfgVehicles" >> _class >> "displayName")) call _fnc_sanitizeInput;
|
||||
_name = if (alive _player) then {(name _player) call _fnc_sanitizeInput;} else {"unknown player";};
|
||||
_displayName = [(getText(configFile >> "cfgVehicles" >> _class >> "displayName")),1] call fnc_sanitizeInput;
|
||||
_name = if (alive _player) then {[(name _player),1] call fnc_sanitizeInput;} else {"unknown player";};
|
||||
|
||||
_charID = _vehicle getVariable ["CharacterID","0"];
|
||||
_objectID = _vehicle getVariable ["ObjectID","0"];
|
||||
@ -71,9 +49,9 @@ if (!_woGear) then {
|
||||
_weapons = getWeaponCargo _vehicle;
|
||||
_magazine = getMagazineCargo _vehicle;
|
||||
_backPack = getBackpackCargo _vehicle;
|
||||
_weaponsCount = (_weapons select 1) call _gearCount;
|
||||
_magazineCount = (_magazine select 1) call _gearCount;
|
||||
_backPackCount = (_backPack select 1) call _gearCount;
|
||||
_weaponsCount = (_weapons select 1) call fnc_gearCount;
|
||||
_magazineCount = (_magazine select 1) call fnc_gearCount;
|
||||
_backPackCount = (_backPack select 1) call fnc_gearCount;
|
||||
_inventory = [_weapons, _magazine, _backPack];
|
||||
_inventoryCount = [_weaponsCount, _magazineCount, _backPackCount];
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
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";};
|
||||
|
||||
@ -15,7 +15,7 @@ _typeOf = typeOf _object;
|
||||
if !(_typeOf in DZE_unlockedStorage) exitWith {diag_log "server_changeCode called with invalid storage object!"};
|
||||
|
||||
_lockedClass = getText (configFile >> "CfgVehicles" >> _typeOf >> "lockedClass");
|
||||
_pos = _object getVariable ["OEMPos",getPosATL _object];
|
||||
_pos = getPosATL _object;
|
||||
_dir = getDir _object;
|
||||
_vector = [vectorDir _object, vectorUp _object];
|
||||
_charID = _object getVariable ["CharacterID","0"];
|
||||
@ -35,30 +35,30 @@ if (_exitReason != "") exitWith {diag_log _exitReason};
|
||||
_weapons = getWeaponCargo _object;
|
||||
_magazines = getMagazineCargo _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;
|
||||
|
||||
_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 setVectorDirAndUp _vector;
|
||||
_holder setPosATL _pos;
|
||||
_holder setVariable ["CharacterID",_characterID,true];
|
||||
_holder setVariable ["OEMPos",_pos,true];
|
||||
|
||||
if (DZE_permanentPlot) then {
|
||||
_ownerPUID = if (_charID == "0000" || _charID == "10000") then {_playerUID} else {_ownerID};
|
||||
_worldSpace = [_dir,_pos,_ownerPUID,_vector];
|
||||
_holder setVariable ["ownerPUID",_ownerPUID,true];
|
||||
} else {
|
||||
_worldSpace = [_dir,_pos];
|
||||
};
|
||||
_ownerPUID = if (_charID == "0000" || _charID == "10000") then {_playerUID} else {_ownerID};
|
||||
_worldSpace = [_dir,_pos,_ownerPUID,_vector];
|
||||
_holder setVariable ["ownerPUID",_ownerPUID,true];
|
||||
|
||||
if (Z_singleCurrency) then {_holder setVariable ["cashMoney",_coins,true];};
|
||||
|
||||
if (_isZSC) then {_holder setVariable ["cashMoney",_coins,true];};
|
||||
|
||||
_objectUID = _worldSpace call dayz_objectUID2;
|
||||
_holder setVariable ["ObjectUID",_objectUID,true];
|
||||
_holder setVariable ["ObjectUID",_objectUID];
|
||||
|
||||
deleteVehicle _object;
|
||||
|
||||
@ -69,7 +69,7 @@ _holder setVariable ["BackpackCargo",_backpacks,false];
|
||||
|
||||
[_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 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
|
||||
*/
|
||||
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";};
|
||||
_id = _this select 0;
|
||||
_uid = _this select 1;
|
||||
_activatingPlayer = _this select 2;
|
||||
_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;
|
||||
local _activatingPlayer = objectFromNetID(_this select 0);
|
||||
local _obj = objectFromNetID(_this select 1);
|
||||
local _clientKey = _this select 2;
|
||||
local _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 (isServer) then {
|
||||
if (_processDelete) then {deleteVehicle _objPos};
|
||||
local _id = _obj getVariable ["ObjectID","0"];
|
||||
local _uid = _obj getVariable ["ObjectUID","0"];
|
||||
_type = typeOf _obj;
|
||||
|
||||
if (typeName _objPos != "ARRAY") then {
|
||||
_objPos = typeof _objPos;
|
||||
};
|
||||
|
||||
//remove from database
|
||||
if (parseNumber _id > 0) then {
|
||||
//Send request
|
||||
_key = format["CHILD:304:%1:",_id];
|
||||
_key call server_hiveWrite;
|
||||
diag_log format["DELETE: Player %1(%2) deleted %4 with ID: %3",(_activatingPlayer call fa_plr2str), _PlayerUID, _id, _objPos];
|
||||
} else {
|
||||
//Send request
|
||||
_key = format["CHILD:310:%1:",_uid];
|
||||
_key call server_hiveWrite;
|
||||
diag_log format["DELETE: Player %1(%2) deleted %4 with UID: %3",(_activatingPlayer call fa_plr2str), _PlayerUID, _uid, _objPos];
|
||||
};
|
||||
local _processDelete = [true,_this select 3] select (count _this > 3);
|
||||
if (_processDelete) then {deleteVehicle _obj};
|
||||
|
||||
//remove from database
|
||||
if (parseNumber _id > 0) then {
|
||||
//Send request
|
||||
_key = format["CHILD:304:%1:",_id];
|
||||
_key call server_hiveWrite;
|
||||
diag_log format["DELETE: Player %1(%2) deleted %4 with ID: %3",(_activatingPlayer call fa_plr2str), _playerUID, _id, _type];
|
||||
} else {
|
||||
//Send request
|
||||
_key = format["CHILD:310:%1:",_uid];
|
||||
_key call server_hiveWrite;
|
||||
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;
|
||||
_obj = _this select 1;
|
||||
@ -6,7 +6,7 @@ _status = _this select 2;
|
||||
|
||||
_name = ["Dead Player",name _player] select (alive _player);
|
||||
_type = typeOf _obj;
|
||||
_pos = _obj getVariable ["OEMPos",getPosATL _obj];
|
||||
_pos = getPosATL _obj;
|
||||
_dir = direction _obj;
|
||||
_vector = [vectorDir _obj, vectorUp _obj];
|
||||
_charID = _obj getVariable ["CharacterID","0"];
|
||||
@ -51,27 +51,30 @@ if !(_type in DZE_DoorsLocked) then {
|
||||
if (_exitReason != "") exitWith {diag_log _exitReason};
|
||||
|
||||
call {
|
||||
_isZSC = false;
|
||||
if (Z_singleCurrency) then {
|
||||
_isZSC = _type in DZE_MoneyStorageClasses;
|
||||
};
|
||||
if (_status == 0) exitwith { //Unlocking
|
||||
_unlockedClass = getText (configFile >> "CfgVehicles" >> _type >> "unlockedClass");
|
||||
_weapons = _obj getVariable ["WeaponCargo",[]];
|
||||
_magazines = _obj getVariable ["MagazineCargo",[]];
|
||||
_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;
|
||||
|
||||
// Create new unlocked safe, then delete old locked safe
|
||||
_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 setVectorDirAndUp _vector;
|
||||
_holder setPosATL _pos;
|
||||
_holder setVariable ["CharacterID",_charID,true];
|
||||
_holder setVariable ["ObjectID",_objectID,true];
|
||||
_holder setVariable ["ObjectUID",_objectUID,true];
|
||||
_holder setVariable ["OEMPos",_pos,true];
|
||||
_holder setVariable ["ObjectID",_objectID];
|
||||
_holder setVariable ["ObjectUID",_objectUID];
|
||||
_holder setDamage _damage;
|
||||
if (DZE_permanentPlot) then {_holder setVariable ["ownerPUID",_ownerID,true];};
|
||||
if (Z_singleCurrency) then {_holder setVariable ["cashMoney",_coins,true];};
|
||||
_holder setVariable ["ownerPUID",_ownerID,true];
|
||||
if (_isZSC && {_unlockedClass in DZE_MoneyStorageClasses}) then {_holder setVariable ["cashMoney",_coins,true];};
|
||||
deleteVehicle _obj;
|
||||
|
||||
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
|
||||
@ -84,22 +87,21 @@ call {
|
||||
_weapons = getWeaponCargo _obj;
|
||||
_magazines = getMagazineCargo _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;
|
||||
|
||||
// Create new locked safe, then delete old unlocked safe
|
||||
_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 setVectorDirAndUp _vector;
|
||||
_holder setPosATL _pos;
|
||||
_holder setVariable ["CharacterID",_charID,true];
|
||||
_holder setVariable ["ObjectID",_objectID,true];
|
||||
_holder setVariable ["ObjectUID",_objectUID,true];
|
||||
_holder setVariable ["OEMPos",_pos,true];
|
||||
_holder setVariable ["ObjectID",_objectID];
|
||||
_holder setVariable ["ObjectUID",_objectUID];
|
||||
_holder setDamage _damage;
|
||||
if (DZE_permanentPlot) then {_holder setVariable ["ownerPUID",_ownerID,true];};
|
||||
if (Z_singleCurrency) then {_holder setVariable ["cashMoney",_coins,true];};
|
||||
_holder setVariable ["ownerPUID",_ownerID,true];
|
||||
if (_isZSC && {_lockedClass in DZE_MoneyStorageClasses}) then {_holder setVariable ["cashMoney",_coins,true];};
|
||||
deleteVehicle _obj;
|
||||
|
||||
// Local setVariable gear onto new locked safe for easy access on next unlock
|
||||
@ -114,7 +116,7 @@ call {
|
||||
_weapons = getWeaponCargo _obj;
|
||||
_magazines = getMagazineCargo _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];
|
||||
deleteVehicle _obj;
|
||||
@ -122,7 +124,7 @@ call {
|
||||
_holder setPosATL _pos;
|
||||
_holder addMagazineCargoGlobal [getText(configFile >> "CfgVehicles" >> _packedClass >> "seedItem"),1];
|
||||
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
|
||||
if (Z_singleCurrency && {_coins > 0}) then {
|
||||
if (_isZSC && {_coins > 0}) then {
|
||||
private "_displayName";
|
||||
|
||||
_displayName = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
|
||||
@ -140,7 +142,7 @@ call {
|
||||
|
||||
if (_status < 4) then {
|
||||
_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];};
|
||||
"Safe"
|
||||
};
|
||||
|
@ -1,47 +1,51 @@
|
||||
/* Maintain Area - written by Skaronator */
|
||||
/*
|
||||
1: PVDZE_maintainArea = [player,1,[[Object, _objectID, _objectUID],[Object, _objectID, _objectUID]...etc]];
|
||||
2: PVDZE_maintainArea = [player,2,[Object, _objectID, _objectUID]];
|
||||
/* Maintain Area - written by Skaronator
|
||||
Updated by iben
|
||||
|
||||
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 {
|
||||
{
|
||||
local _obj = objectFromNetId _x;
|
||||
local _ID = _obj getVariable ["ObjectID", "0"];
|
||||
|
||||
_player = _this select 0;
|
||||
_option = _this select 1;
|
||||
_objectsInfo = _this select 2;
|
||||
if (_ID == "0") then {
|
||||
local _UID = _obj getVariable ["ObjectUID", "0"];
|
||||
|
||||
if (_option == 1) then {
|
||||
{
|
||||
_obj = _x select 0;
|
||||
_ID = _x select 1;
|
||||
_UID = _x select 2;
|
||||
if (_ID == "0") then {
|
||||
if (_UID != "0") then {
|
||||
_obj setDamage 0;
|
||||
_key = format["CHILD:397:%1:", _UID];
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
} else {
|
||||
_obj setDamage 0;
|
||||
_key = format["CHILD:396:%1:", _ID];
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
} 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)];
|
||||
} else {
|
||||
_obj = _objectsInfo select 0;
|
||||
_ID = _objectsInfo select 1;
|
||||
_UID = _objectsInfo select 2;
|
||||
if (_ID == "0") then {
|
||||
if (_UID != "0") then {
|
||||
_obj setDamage 0;
|
||||
_key = format["CHILD:397:%1:", _UID];
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
} else {
|
||||
_obj setDamage 0;
|
||||
_key = format["CHILD:396:%1:", _ID];
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
};
|
||||
if (_UID != "0") then {
|
||||
_obj setDamage 0;
|
||||
(format ["CHILD:397:%1:", _UID]) call server_hiveWrite
|
||||
}
|
||||
} else {
|
||||
_obj setDamage 0;
|
||||
(format ["CHILD:396:%1:", _ID]) 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
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
local _obj = objectFromNetId ((_this select 2) select 0);
|
||||
local _ID = _obj getVariable ["ObjectID", "0"];
|
||||
|
||||
if (_ID == "0") exitWith {
|
||||
local _UID = _obj getVariable ["ObjectUID", "0"];
|
||||
|
||||
if (_UID != "0") then {
|
||||
_obj setDamage 0;
|
||||
(format ["CHILD:397:%1:", _UID]) call server_hiveWrite
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
_obj setDamage 0;
|
||||
(format ["CHILD:396:%1:", _ID]) call server_hiveWrite
|
||||
|
@ -18,7 +18,6 @@ _sourceID = _this select 10;
|
||||
//Mark player as dead so we bypass the ghost system
|
||||
dayz_died set [count dayz_died, _playerID];
|
||||
|
||||
_newObject setVariable ["bodyName",_playerName,true];
|
||||
_newObject setVariable ["bodyUID",_playerID,true];
|
||||
_pos = getPosATL _newObject;
|
||||
|
||||
@ -86,5 +85,4 @@ if (_playerName != "unknown" || {_sourceName != "unknown"}) then {
|
||||
};
|
||||
|
||||
_newObject setDamage 1;
|
||||
_newObject setOwner 0;
|
||||
//dead_bodyCleanup set [count dead_bodyCleanup,_newObject];
|
||||
_newObject setOwner 0;
|
@ -194,8 +194,3 @@ if (count dayz_activeInvites > 0) then {
|
||||
|
||||
PVCDZ_plr_PlayerAccepted = [_playerName,diag_ticktime];
|
||||
(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;
|
||||
_playerObj setVariable ["hit_legs",(_fractures select 0),true];
|
||||
_playerObj setVariable ["hit_hands",(_fractures select 1),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 ["blood_testdone",if (count _medical >= 15) then {(_medical select 14)} else {false},true];
|
||||
@ -114,7 +115,10 @@ if (count _medical > 0) then {
|
||||
};
|
||||
} else {
|
||||
//Reset bleeding wounds
|
||||
call fnc_usec_resetWoundPoints;
|
||||
{
|
||||
_playerObj setVariable["hit_"+_x,false,true];
|
||||
} forEach USEC_typeOfWounds;
|
||||
|
||||
//Reset fractures
|
||||
_playerObj setVariable ["hit_legs",0,true];
|
||||
_playerObj setVariable ["hit_hands",0,true];
|
||||
@ -228,7 +232,6 @@ if (_findIndex > -1) then {
|
||||
// Sync weather settings for JIP player
|
||||
_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)];
|
||||
_clientID publicVariableClient "PVCDZ_plr_Login2";
|
||||
if (dayz_townGenerator) then {
|
||||
@ -240,7 +243,7 @@ _playerObj setVariable ["lastTime",diag_ticktime];
|
||||
|
||||
//set server-side inventory variable to monitor player gear
|
||||
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
|
||||
|
@ -2,8 +2,7 @@
|
||||
|
||||
local _character = _this select 0;
|
||||
local _magazines = _this select 1;
|
||||
local _dayz_onBack = _this select 2;
|
||||
local _weaponsPlayer = _this select 3;
|
||||
local _dayz_onBack = _character getVariable ["dayz_onBack",""];
|
||||
local _characterID = _character getVariable ["characterID","0"];
|
||||
local _playerUID = getPlayerUID _character;
|
||||
local _charPos = getPosATL _character;
|
||||
@ -41,7 +40,7 @@ local _usec_Dead = _character getVariable ["USEC_isDead",false];
|
||||
local _lastTime = _character getVariable ["lastTime",-1];
|
||||
local _modelChk = _character getVariable ["model_CHK",""];
|
||||
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
|
||||
local _statsDiff = [_character,_playerUID] call server_getStatsDiff;
|
||||
_humanity = _statsDiff select 0;
|
||||
@ -54,17 +53,12 @@ local _charPosLen = count _charPos;
|
||||
local _magTemp = [];
|
||||
|
||||
if (!isNil "_magazines") then {
|
||||
_playerGear = [_weaponsPlayer,_magazines,_dayz_onBack];
|
||||
_character setVariable["ServerMagArray",[_magazines,_dayz_onBack,_weaponsPlayer], false];
|
||||
_playerGear = [weapons _character,_magazines,_dayz_onBack];
|
||||
_character setVariable["ServerMagArray",_magazines, false];
|
||||
} else {
|
||||
//check Magazines everytime they aren't sent by player_forceSave
|
||||
_magTemp = (_lastMagazines select 0);
|
||||
if (isNil "_dayz_onBack") then {
|
||||
_dayz_onBack = _lastMagazines select 1;
|
||||
};
|
||||
if (isNil "_weaponsPlayer") then {
|
||||
_weaponsPlayer = _lastMagazines select 2;
|
||||
};
|
||||
_magTemp = _lastMagazines;
|
||||
|
||||
if (count _magTemp > 0) then {
|
||||
_magazines = [(magazines _character),20] call array_reduceSize;
|
||||
{
|
||||
@ -73,7 +67,7 @@ if (!isNil "_magazines") then {
|
||||
_class = _x select 0;
|
||||
};
|
||||
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;
|
||||
if (_MatchedCount > _CountedActual) then {
|
||||
_magTemp set [_forEachIndex, "0"];
|
||||
@ -81,16 +75,15 @@ if (!isNil "_magazines") then {
|
||||
} else {
|
||||
_magTemp set [_forEachIndex, "0"];
|
||||
};
|
||||
} forEach (_lastMagazines select 0);
|
||||
} forEach _lastMagazines;
|
||||
_magazines = _magTemp - ["0"];
|
||||
_magazines = [_magazines,_dayz_onBack,_weaponsPlayer];
|
||||
_character setVariable["ServerMagArray",_magazines, false];
|
||||
_playerGear = [_magazines select 2,_magazines select 0,_magazines select 1];
|
||||
_playerGear = [weapons _character,_magazines,_dayz_onBack];
|
||||
} else {
|
||||
_magazines = [_magTemp,_dayz_onBack,_weaponsPlayer];
|
||||
_magazines = _magTemp;
|
||||
};
|
||||
_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
|
||||
|
@ -31,11 +31,12 @@ if ([_object, "Server"] call check_publishobject) then {
|
||||
|
||||
if !(_object isKindOf "TrapItems") then {
|
||||
if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then {
|
||||
_object addEventHandler ["HandleDamage", {false}];
|
||||
_object addEventHandler ["HandleDamage", {0}];
|
||||
} 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.
|
||||
_object enableSimulation false;
|
||||
|
||||
|
@ -63,25 +63,25 @@ if (_outcome != "PASS") then {
|
||||
diag_log("CUSTOM: failed to get id for : " + str(_uid));
|
||||
} else {
|
||||
_oid = _result select 1;
|
||||
_object setVariable ["ObjectID", _oid, true];
|
||||
_object setVariable ["ObjectID", _oid];
|
||||
|
||||
#ifdef OBJECT_DEBUG
|
||||
diag_log("CUSTOM: Selected " + str(_oid));
|
||||
#endif
|
||||
|
||||
_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;
|
||||
|
||||
{
|
||||
_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,_array] call server_setHitpoints;
|
||||
|
||||
_object setFuel _fuel;
|
||||
_object setvelocity [0,0,1];
|
||||
|
||||
[_object,"all",true] call server_updateObject;
|
||||
|
||||
[_object,DZE_clearVehicleAmmo,DZE_addVehicleAmmo] call fn_vehicleAddons;
|
||||
|
||||
_object call fnc_veh_ResetEH;
|
||||
|
||||
PVDZE_veh_Init = _object;
|
||||
|
@ -73,15 +73,14 @@ if (_outcome != "PASS") then {
|
||||
|
||||
if(!_donotusekey) then {
|
||||
_object setvehiclelock "locked";
|
||||
//_object setVariable ["MF_Tow_Cannot_Tow",true,true];
|
||||
};
|
||||
|
||||
clearWeaponCargoGlobal _object;
|
||||
clearMagazineCargoGlobal _object;
|
||||
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
|
||||
_object setVariable ["ObjectID", _oid, true];
|
||||
_object setVariable ["ObjectID", _oid];
|
||||
_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 {
|
||||
_object attachTo [_object_para, [0,0,-1.6]];
|
||||
@ -94,9 +93,10 @@ if (_outcome != "PASS") then {
|
||||
deleteVehicle _object_para;
|
||||
};
|
||||
};
|
||||
|
||||
[_object,DZE_clearVehicleAmmo,DZE_addVehicleAmmo] call fn_vehicleAddons;
|
||||
|
||||
_object call fnc_veh_ResetEH;
|
||||
_object setVariable ["Owner", [_playerUID], true];
|
||||
|
||||
PVDZE_veh_Init = _object;
|
||||
publicVariable "PVDZE_veh_Init";
|
||||
|
@ -1,7 +1,7 @@
|
||||
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"];
|
||||
,"_hit","_inv"];
|
||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||
|
||||
if (count _this < 6) exitWith {
|
||||
@ -16,7 +16,6 @@ _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;
|
||||
|
||||
@ -47,7 +46,7 @@ _magazines = getMagazineCargo _object;
|
||||
_backpacks = getBackpackCargo _object;
|
||||
_inv = [_weapons,_magazines,_backpacks];
|
||||
|
||||
if (Z_SingleCurrency && ZSC_VehicleMoneyStorage) then {
|
||||
if (Z_SingleCurrency && {ZSC_VehicleMoneyStorage}) then {
|
||||
_coins = _object getVariable ["cashMoney",0];
|
||||
};
|
||||
|
||||
@ -67,9 +66,9 @@ diag_log ("PUBLISH: Attempt " + str(_object));
|
||||
_dir = _worldspace select 0;
|
||||
_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
|
||||
diag_log ("HIVE: WRITE: "+ str(_key));
|
||||
diag_log ("HIVE: WRITE: "+ _key);
|
||||
#endif
|
||||
|
||||
_key call server_hiveWrite;
|
||||
@ -93,9 +92,6 @@ if (_outcome != "PASS") then {
|
||||
#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;
|
||||
@ -107,11 +103,11 @@ if (_outcome != "PASS") then {
|
||||
// switch var to new vehicle at this point.
|
||||
_object = _newobject;
|
||||
|
||||
_object setVariable ["ObjectID", _oid, true];
|
||||
_object setVariable ["ObjectID", _oid];
|
||||
_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];
|
||||
};
|
||||
|
||||
@ -125,81 +121,24 @@ if (_outcome != "PASS") then {
|
||||
_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;
|
||||
|
||||
_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,_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";
|
||||
|
||||
{if (_object isKindOf _x) exitWith {_object disableTIEquipment true;}} count vkc_disableThermal;
|
||||
if (vkc_clearAmmo) then {_object call _clearTurrets;};
|
||||
|
||||
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;
|
||||
diag_log format["PUBLISH: %1(%2) upgraded %3 with UID %4 @%5",(_activatingPlayer call fa_plr2str),_playerUID,_class,_uid,(_location call fa_coor2str)];
|
||||
};
|
||||
|
@ -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];};
|
||||
|
||||
@ -67,10 +67,8 @@ if (!_allowed || !_proceed) exitWith {
|
||||
};
|
||||
|
||||
// Publish variables
|
||||
_object setVariable ["CharacterID",_charID,true];
|
||||
|
||||
//_object setVariable ["ObjectUID",_objectUID,true];
|
||||
_object setVariable ["OEMPos",(_worldspace select 1),true];
|
||||
_setGlobal = [false,true] select ((_class in DZE_isLockedStorageUpgrade) || (_class in DZE_DoorsLocked));
|
||||
_object setVariable ["CharacterID",_charID,_setGlobal];
|
||||
|
||||
//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;
|
||||
|
||||
_object setVariable ["lastUpdate",diag_tickTime];
|
||||
_object setVariable ["ObjectUID", _uid,true];
|
||||
// _object setVariable ["CharacterID",_charID,true];
|
||||
_object setVariable ["ObjectUID", _uid];
|
||||
|
||||
if (DZE_GodModeBase && {!(_class in DZE_GodModeBaseExclude)}) then {
|
||||
_object addEventHandler ["HandleDamage",{false}];
|
||||
_object addEventHandler ["HandleDamage",{0}];
|
||||
} 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 {
|
||||
[_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.
|
||||
*/
|
||||
|
||||
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;
|
||||
_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;
|
||||
local _index = dayz_serverPUIDArray find _playerUID;
|
||||
|
||||
_index = dayz_serverPUIDArray find _playerUID;
|
||||
|
||||
_exitReason = call {
|
||||
local _exitReason = call {
|
||||
//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
|
||||
//Coordinates can be used in place of object
|
||||
if (_objPos distance _player > (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]
|
||||
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 _playerPos),Z_VehicleDistance + 10,_params]
|
||||
};
|
||||
if (_index < 0) exitwith {
|
||||
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]
|
||||
};
|
||||
"";
|
||||
|
@ -20,5 +20,4 @@ if ((count _position) == 2) then {
|
||||
_veh enableSimulation false;
|
||||
_veh setDir round(random 360);
|
||||
_veh setPos _position;
|
||||
_veh setVariable ["ObjectID","1",true];
|
||||
};
|
@ -15,7 +15,7 @@ if ((count _position) == 2) then {
|
||||
_veh enableSimulation false;
|
||||
_veh setDir round(random 360);
|
||||
_veh setPos _position;
|
||||
_veh setVariable ["ObjectID","1",true];
|
||||
|
||||
_veh addEventHandler ["HandleDamage",{
|
||||
local _damage = _this select 2;
|
||||
if ((_this select 4) == "Sledge_Swing_Ammo") then {
|
||||
|
@ -15,5 +15,4 @@ if ((count _position) == 2) then {
|
||||
_veh enableSimulation false;
|
||||
_veh setDir round(random 360);
|
||||
_veh setPos _position;
|
||||
_veh setVariable ["ObjectID","1",true];
|
||||
};
|
@ -25,7 +25,7 @@ server_obj_inv = {
|
||||
local _class = _this select 3;
|
||||
|
||||
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
|
||||
};
|
||||
if (DZE_doorManagement && {_class in DZE_DoorsLocked}) exitwith {
|
||||
@ -37,7 +37,6 @@ server_obj_inv = {
|
||||
[getWeaponCargo _object, getMagazineCargo _object, getBackpackCargo _object]
|
||||
};
|
||||
|
||||
|
||||
local _previous = str(_object getVariable["lastInventory",[]]);
|
||||
if (str _inventory != _previous) then {
|
||||
local _key = "";
|
||||
@ -48,7 +47,7 @@ server_obj_inv = {
|
||||
_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
|
||||
_key = _key + str _coins + ":";
|
||||
};
|
||||
|
@ -7,11 +7,9 @@
|
||||
"PVDZ_plr_Login2" addPublicVariableEventHandler {(_this select 1) call server_playerSetup};
|
||||
"PVDZ_plr_LoginRecord" addPublicVariableEventHandler {_id = (_this select 1) spawn dayz_recordLogin};
|
||||
"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_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
|
||||
"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.
|
||||
//Remove any you aren't using
|
||||
_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 = [];
|
||||
|
@ -24,6 +24,7 @@ server_playerSetup = compile preprocessFileLineNumbers "\z\addons\dayz_server\co
|
||||
server_onPlayerDisconnect = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.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_setHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_setHitpoints.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_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_deleteObj.sqf"; //Removes the object from the DB
|
||||
@ -40,7 +41,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_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_publishVeh3 = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle3.sqf"; //Used for car upgrades
|
||||
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_tradeObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.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";
|
||||
@ -54,29 +59,9 @@ spawn_ammosupply = compile preprocessFileLineNumbers "\z\addons\dayz_server\comp
|
||||
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_vehicles = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\spawn_vehicles.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
|
||||
if (DZE_Virtual_Garage) then {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\garage\init.sqf";
|
||||
};
|
||||
|
||||
vehicle_handleServerKilled = {
|
||||
@ -99,8 +84,7 @@ check_publishobject = {
|
||||
diag_log format["DEBUG: Checking if Object: %1 is allowed, published by %2",_object,_playername];
|
||||
#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;
|
||||
};
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
For detailed information about these variables see:
|
||||
https://github.com/ebayShopper/ESSV3/blob/master/DOCUMENTATION.md
|
||||
*/
|
||||
class_epoch = isClass (configFile >> "CfgWeapons" >> "Chainsaw");
|
||||
class_level1 = ["0","0","0"];
|
||||
class_level2 = ["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;
|
||||
|
||||
#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
|
||||
["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 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 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 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"],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"],if (class_epoch) then {"CoyoteBackpack_DZE1"} else {"DZ_Backpack_EP1"},[],[],3,0,0,"MeleeHatchet"]
|
||||
];
|
||||
class_customLoadout = [
|
||||
"12345678900000000", // ebay
|
||||
|
@ -41,9 +41,7 @@ for "_i" from 1 to (SPAWN_NUM) do
|
||||
|
||||
//_vehicle = createVehicle [_class, _position, [], 0, "CAN_COLLIDE"];
|
||||
_vehicle = _class createVehicle _position;
|
||||
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _vehicle];
|
||||
_vehicle setVariable ["ObjectID", 1, true];
|
||||
|
||||
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _vehicle];
|
||||
_size = sizeOf _class;
|
||||
|
||||
{
|
||||
|
@ -46,7 +46,6 @@ _spawnCrashSite =
|
||||
|
||||
_vehicle = "ClutterCutter_small_2_EP1" createVehicle _position;
|
||||
_vehicle = _class createVehicle [0,0,0];
|
||||
_vehicle setVariable ["ObjectID", 1, true];
|
||||
_vehicle setDir random 360;
|
||||
_vehicle setPos _position;
|
||||
|
||||
|
@ -90,6 +90,7 @@ AllowedVehiclesList = [
|
||||
["SUV_TK_CIV_EP1_DZE",_Ratio1],
|
||||
["SUV_White",_Ratio1],
|
||||
["SUV_Yellow",_Ratio1],
|
||||
["SUV_Blue_White",_Ratio1],
|
||||
["Tractor_DZE",_Ratio3],
|
||||
["TT650_Civ_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"
|
||||
|
||||
if (isNil "DZE_NPC_CleanUp_Time") then {DZE_NPC_CleanUp_Time = -1;};
|
||||
|
||||
sched_co_deleteVehicle = {
|
||||
private "_group";
|
||||
_this removeAllMPEventHandlers "mpkilled";
|
||||
@ -28,7 +26,7 @@ sched_co_deleteVehicle = {
|
||||
|
||||
|
||||
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
|
||||
// DELETE UNCONTROLLED ZOMBIES --- PUT FLIES ON FRESH PLAYER CORPSES --- REMOVE OLD FLIES & CORPSES
|
||||
_delQtyZ = 0;
|
||||
@ -36,10 +34,9 @@ sched_corpses = {
|
||||
_delQtyG = 0;
|
||||
_delQtyV = 0;
|
||||
_addFlies = 0;
|
||||
_delQtyAI = 0;
|
||||
{
|
||||
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;
|
||||
_delQtyZ = _delQtyZ + 1;
|
||||
} else {
|
||||
@ -62,28 +59,8 @@ sched_corpses = {
|
||||
_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
|
||||
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 {
|
||||
// flies have been switched off, we can delete body
|
||||
_sound = _x getVariable ["sched_co_fliesSource", nil];
|
||||
@ -120,7 +97,7 @@ sched_corpses = {
|
||||
if (_onoff == 1) then {
|
||||
_sound = createSoundSource["Sound_Flies",getPosATL _x,[],0];
|
||||
_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";
|
||||
};
|
||||
// broadcast flies status for everyone periodically, to update visible swarm
|
||||
@ -158,7 +135,7 @@ sched_corpses = {
|
||||
};
|
||||
};
|
||||
} forEach allDead;
|
||||
|
||||
|
||||
_delQtyAnimal = 0;
|
||||
{
|
||||
_animal = _x;
|
||||
@ -181,8 +158,8 @@ sched_corpses = {
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
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__,
|
||||
_delQtyZ,_delQtyAnimal,_delQtyP,_delQtyGrp,_addFlies,_delQtyG,_delQtyV,_delQtyAI];
|
||||
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];
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -215,4 +192,4 @@ sched_disconnectedPlayers = {
|
||||
|
||||
objNull
|
||||
};
|
||||
*/
|
||||
*/
|
@ -4,15 +4,11 @@
|
||||
*/
|
||||
|
||||
epoch_eventIsAny = {
|
||||
private ["_boolReturn","_event","_date","_bool","_index"];
|
||||
_event = _this select 0;
|
||||
_date = _this select 1;
|
||||
|
||||
_boolReturn = false;
|
||||
|
||||
_index = 0;
|
||||
local _event = _this select 0;
|
||||
local _date = _this select 1;
|
||||
local _boolReturn = false;
|
||||
local _index = 0;
|
||||
{
|
||||
_bool = false;
|
||||
if (typeName _x == "STRING") then {
|
||||
_boolReturn = true;
|
||||
} else {
|
||||
@ -21,50 +17,41 @@ epoch_eventIsAny = {
|
||||
if (!_boolReturn) exitWith {};
|
||||
_index = _index + 1;
|
||||
} count _event;
|
||||
|
||||
_boolReturn
|
||||
};
|
||||
|
||||
sched_event_init = {
|
||||
diag_log("EPOCH EVENTS INIT");
|
||||
diag_log formatText ["EPOCH EVENTS: %1 Events Scheduled",(count EpochEvents)];
|
||||
""
|
||||
};
|
||||
|
||||
sched_event = {
|
||||
private ["_date","_key","_result","_outcome","_handle","_datestr","_lastTime"];
|
||||
// Find current time from server
|
||||
_lastTime = _this;
|
||||
_key = "CHILD:307:";
|
||||
_result = _key call server_hiveReadWrite;
|
||||
_outcome = _result select 0;
|
||||
if(_outcome == "PASS") then {
|
||||
_date = _result select 1;
|
||||
_datestr = str(_date);
|
||||
local _lastTime = _this;
|
||||
local _key = "CHILD:307:";
|
||||
local _result = _key call server_hiveReadWrite;
|
||||
local _outcome = _result select 0;
|
||||
if (_outcome == "PASS") then {
|
||||
local _date = _result select 1;
|
||||
local _datestr = str(_date);
|
||||
if (_lastTime != _datestr) then {
|
||||
|
||||
// internal timestamp
|
||||
ServerCurrentTime = _date;
|
||||
|
||||
// Once a minute.
|
||||
_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
|
||||
if ((_x select 4) == -1) then {
|
||||
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.
|
||||
_lastIndex = (count EpochEvents) - 1;
|
||||
if (_lastIndex != _forEachIndex) then {EpochEvents set [_forEachIndex, EpochEvents select _lastIndex];};
|
||||
EpochEvents resize _lastIndex;
|
||||
EpochEvents = [EpochEvents,_forEachIndex] call fnc_deleteAt;
|
||||
} else {
|
||||
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);
|
||||
_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;
|
||||
|
@ -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_lootpiles.sqf");
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_sync.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_dzms.sqf");
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_event.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
|
||||
[ 60, 0, sched_event, sched_event_init ],
|
||||
[ 60, 224, sched_corpses ],
|
||||
[ 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_dzms, sched_dzms_init ],
|
||||
[ 6, 340, sched_lootpiles ],
|
||||
[ 900, 0, sched_sync ],
|
||||
[ 120, 48, sched_safetyVehicle ],
|
||||
[ 360, 480, sched_fps ],
|
||||
[ 30, 60, sched_traps, sched_traps_init ]
|
||||
] execFSM ("z\addons\dayz_code\system\scheduler\scheduler.fsm");
|
||||
];
|
||||
|
||||
//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;
|
||||
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"];
|
@ -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;
|
||||
_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];
|
||||
_vQty = _vQty + 1;
|
||||
} else {
|
||||
@ -183,21 +183,23 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
|
||||
};
|
||||
};
|
||||
|
||||
_object = _type createVehicle [0,0,0]; //more than 2x faster than createvehicle array
|
||||
_object setDir _dir;
|
||||
_object setPosATL _pos;
|
||||
_object = _type createVehicle [0,0,0]; //more than 2x faster than createvehicle array
|
||||
_object setDamage _damage;
|
||||
|
||||
if (_vecExists) then {
|
||||
_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 setPosATL _pos;
|
||||
|
||||
_doorLocked = _type in DZE_DoorsLocked;
|
||||
_isPlot = _type == "Plastic_Pole_EP1_DZ";
|
||||
|
||||
// prevent immediate hive write when vehicle parts are set up
|
||||
_object setVariable ["lastUpdate",diag_ticktime];
|
||||
_object setVariable ["ObjectID", _idKey, true];
|
||||
_object setVariable ["ObjectID", _idKey];
|
||||
_object setVariable ["OwnerPUID", _ownerPUID, true];
|
||||
if (Z_SingleCurrency && {_type in DZE_MoneyStorageClasses}) then {
|
||||
_object setVariable ["cashMoney", _storageMoney, true];
|
||||
@ -234,7 +236,7 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
|
||||
{_object addBackpackCargoGlobal [_x, _backpackqty select _foreachindex];} foreach _backpackcargo;
|
||||
};
|
||||
} else {
|
||||
if (DZE_permanentPlot && _isPlot) then {
|
||||
if (_isPlot) then {
|
||||
_object setVariable ["plotfriends", _inventory, true];
|
||||
};
|
||||
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 {
|
||||
_object setVariable["memDir",_dir,true];
|
||||
if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then {
|
||||
_object addEventHandler ["HandleDamage",{false}];
|
||||
_object addEventHandler ["HandleDamage",{0}];
|
||||
} 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 {
|
||||
_object enableSimulation true;
|
||||
};
|
||||
@ -338,8 +345,8 @@ if ((playersNumber west + playersNumber civilian) == 0) exitWith {
|
||||
|
||||
// prevent immediate hive write when vehicle parts are set up
|
||||
_object setVariable ["lastUpdate",diag_ticktime];
|
||||
_object setVariable ["ObjectID", _idKey, true];
|
||||
if (Z_SingleCurrency && ZSC_VehicleMoneyStorage) then {
|
||||
_object setVariable ["ObjectID", _idKey];
|
||||
if (Z_SingleCurrency && {ZSC_VehicleMoneyStorage}) then {
|
||||
_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 setVariable ["CharacterID", _ownerID, true];
|
||||
_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 _hitpoints;
|
||||
[_object,"damage"] call server_updateObject;
|
||||
|
||||
_setGlobal = [false,true] select (_ownerID != "0");
|
||||
_object setVariable ["CharacterID", _ownerID, _setGlobal];
|
||||
|
||||
[_object,_hitpoints] call server_setHitpoints;
|
||||
|
||||
_object setFuel _fuel;
|
||||
|
||||
[_object,"all",true] call server_updateObject;
|
||||
|
||||
[_object,DZE_clearVehicleAmmo,DZE_addVehicleAmmo] call fn_vehicleAddons;
|
||||
|
||||
_object call fnc_veh_ResetEH;
|
||||
if (_ownerID != "0" && {!(_object isKindOf "Bicycle")}) then {
|
||||
_object setVehicleLock "locked";
|
||||
//_object setVariable ["MF_Tow_Cannot_Tow",true,true];
|
||||
};
|
||||
if (_ownerID != "0" && {!(_object isKindOf "Bicycle")}) then {_object setVehicleLock "locked";};
|
||||
_serverVehicleCounter set [count _serverVehicleCounter,_type]; // total each vehicle
|
||||
_object enableSimulation true;
|
||||
_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];
|
||||
|
||||
if (isDedicated) then {endLoadingScreen;};
|
||||
[] call compile preprocessFileLineNumbers "\z\addons\dayz_server\DZAI\init\dzai_initserver.sqf";
|
||||
allowConnection = true;
|
||||
[] ExecVM "\z\addons\dayz_server\DZMS\DZMSInit.sqf";
|
||||
sm_done = true;
|
||||
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)
|
||||
{[_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;
|
||||
|
||||
// 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",[15529.827,13236.555,2.38],164],
|
||||
|
Reference in New Issue
Block a user