Jump to content

Recommended Posts

it seems that infinite ammo does not turn off, and some of our admins are reporting that they are getting killed while in a vehicle when they have god mode on, from crashing, from ejecting from a vehicle, and getting shot while flying/driving

Infinite ammo not turning off was fixed a few commits ago. Do you have the latest version? I am not sure what is going on with your god mode. What shots kill you? Head, body, extremities? I personally have dive bombed many arial vehicles into buildings and traders for no reason without trouble. Even crashed a bike at 500 speed into buildings (this is hilarious because it destroys the buildings).

 

Well, tried to update to the latest version of the tool, and no luck, the adminmenu option is completely gone now...

 

Gonna rollback to the previous version till it gets fixed :(

 

The menu shows correctly for other people so you should try reinstalling the tools.

Link to comment
Share on other sites

i am using the version you posted in this thread yesterday (the minor update)

 

the godmode thing has not happened to me as of yet, but our other admin said he ejected from a c130 just before it took off and that killed him, crashing a UH-1Y killed him, and also getting shot while flying that chopper, he does not know what part of the body he was hit in

 

here is a vid of what is happening with the infinite ammo

 

goes for 1min and is 37mb

https://www.dropbox.com/s/wwj0wvn0360ciqb/My%20Movie.mp4

Link to comment
Share on other sites

Hello everyone!  I am relatively new to this, so bear with me :)

 

I installed admin mods, following the instructions as best as i can.

 

When i log in, i can see the menu, and i can access it.  So i tested it out.

 

I spawned a chinook.  It spawned right in front of me!  Perfect!  Now, i wanted to remove it.  So i clicked remove temporary, and suddenly, BOOM! Helicopter is removed, but it exploded and killed me as well! 

 

Tried this again with another helicopter, same thing.

 

Tried it with God mode. same thing.

 

Eventually, i followed the "Temporary despawning/blowing up fix".  Still doesn't work :/

 

Also, whenever i RIDE the vehicles, i die/blow up. :(

 

I am kinda lost, i have no idea what i am looking for!

 

I have uploaded the pbo files.  Maybe you can make sense of them!

 

Thanks :)

 

https://www.dropbox.com/s/8esrz5hm0fg3fbf/dayz_mission.pbo

 

https://www.dropbox.com/s/pnnb2qk7qp3lh73/dayz_server.pbo

Link to comment
Share on other sites

i am using the version you posted in this thread yesterday (the minor update)

 

the godmode thing has not happened to me as of yet, but our other admin said he ejected from a c130 just before it took off and that killed him, crashing a UH-1Y killed him, and also getting shot while flying that chopper, he does not know what part of the body he was hit in

 

here is a vid of what is happening with the infinite ammo

 

goes for 1min and is 37mb

https://www.dropbox.com/s/wwj0wvn0360ciqb/My%20Movie.mp4

 

I am 100% certain the god mode thing works. I may see a potential problem in the ammo. Found the problem with infinite ammo. Both vehicle god mode and infinite ammo had infinite ammo on.

Link to comment
Share on other sites

You put the server_functions.sqf fix in the wrong spot. You just pasted it into a random area of the code. Your mistake is shown in the spoiler below:

You were supposed to REPLACE the already existing 

    if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle)) then {

with:

    if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle) && (vehicle _x getVariable ["MalSar",0] !=1)) then {

So it should then look like this:

server_checkHackers = {
	if (DZE_DYN_AntiStuck2nd > 3) then { DZE_DYN_HackerCheck = nil; DZE_DYN_AntiStuck2nd = 0; };
	if(!isNil "DZE_DYN_HackerCheck") exitWith {  DZE_DYN_AntiStuck2nd = DZE_DYN_AntiStuck2nd + 1;};
	DZE_DYN_HackerCheck = true;
	{
		    if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle) && (vehicle _x getVariable ["MalSar",0] !=1)) then {
                {
 			diag_log ("CLEANUP: KILLING A HACKER " + (name _x) + " " + str(_x) + " IN " + (typeOf vehicle _x));
			(vehicle _x) setDamage 1;
			_x setDamage 1;
			sleep 0.25;
		};
		sleep 0.001;
	} forEach allUnits;
	DZE_DYN_HackerCheck = nil;
};

Go back and follow the readme again. You misinterpreted what you were supposed to do. I would recommend using a clean server build as there is no telling what you may have messed up in the files. It is better to be safe and scrap it now rather than after you have modded it with 30 addons. This can be done by simply coppying over a fresh server pbo and mpmissions folder. No need to replace everything. You need to make sure that you read the entire readme and that you follow it step by step. You missed the important words of "Find this line in the file:   and then replace it with this line: ". This tool is very volatile and if not implemented correctly many of the features will not work. 

Link to comment
Share on other sites

Need some input:

I have a question for everyone on a new feature: Do you want teleport to be bound to a function key (teleport F1, TP2me F2, TP2player F3), or do you want it to just stay as a scroll item? If I bind it to the F keys you can press that key at any time (including when the ma is open) to initiate teleport where as the scroll menu requires you to close the map and scroll through the menu to do the teleport. 

 

A question on ESP: I have found a decent way to reduce lag for the enhanced ESP and it will be released in the next update, however did you like the old ESP from blue phoenix more? I have been debating rewriting the ESP similar to what bluephoenix did in the past, but it will take a bit of time.

Link to comment
Share on other sites

Did what you said, but now i can't log in to my server lol.

 

It says "Waiting for server to authorize" or something along those lines.

 

When i remove both the pbos, server works. 

 

Getting confused :D

 

Did you follow the readme exactly on a brand new server pbo and mpmissions?

Link to comment
Share on other sites

Yes i did!  Turns out i just had to refresh my character so he can re download the mission again.

 

I can log in now!

 

Okay, i can now fly/drive vehicles without dying.  I can also delete LAND vehicles without them exploding.  however, when i delete anything that flies, it explodes.  Doesn't kill me though, so i don't care anymore :P

 

Thank you guys for your help! Cheers! :D

Link to comment
Share on other sites

Need some input:

I have a question for everyone on a new feature: Do you want teleport to be bound to a function key (teleport F1, TP2me F2, TP2player F3), or do you want it to just stay as a scroll item? If I bind it to the F keys you can press that key at any time (including when the ma is open) to initiate teleport where as the scroll menu requires you to close the map and scroll through the menu to do the teleport. 

 

A question on ESP: I have found a decent way to reduce lag for the enhanced ESP and it will be released in the next update, however did you like the old ESP from blue phoenix more? I have been debating rewriting the ESP similar to what bluephoenix did in the past, but it will take a bit of time.

 

I have code that will allow teleporting by holding the ALT key and clicking on the map - at any time. Something to consider.

Link to comment
Share on other sites

I have code that will allow teleporting by holding the ALT key and clicking on the map - at any time. Something to consider.

 

I already have this ready actually. I adapted the old bluephoenix version when I was attempting to change the teleport a while back to not require exceptions. It didn't work as planned but I should still have the code for it. I just felt like putting all teleports to a specific F key would be easier to remember and cleaner since it is all in the same area of the keyboard.

Link to comment
Share on other sites

i am using the version you posted in this thread yesterday (the minor update)

 

the godmode thing has not happened to me as of yet, but our other admin said he ejected from a c130 just before it took off and that killed him, crashing a UH-1Y killed him, and also getting shot while flying that chopper, he does not know what part of the body he was hit in

 

here is a vid of what is happening with the infinite ammo

 

goes for 1min and is 37mb

https://www.dropbox.com/s/wwj0wvn0360ciqb/My%20Movie.mp4

 

So I have fully tested the infinite ammo issue and it is because of the language. The command for infinite ammo gets stuck like that now. It used to only be a one time set, but now it is a static setting. It will be sent in the next update once I realize how to get this to stop happening. 

Link to comment
Share on other sites

Just a thought, Nox. You said the All items box cause problems with the game trying to load everything in at once. Is that crate REALLY needed? Why not separate into All weps and All items? EDIT: Gonna reinstall the tools with the latest version and see if my problem from yesterday went away. Why would my filters just suddenly do that? I read what BetterDead said but I don't understand. I was hoping it'd be as simple as changing a 5 to a 1. So what is the process with what he shows? Do i have to generate that for all the items, as it wasn't just the KA-60's rocket that triggers different kicks, but really all missiles/explosives, including avenger and hind, for instance. Thanks guys!

Link to comment
Share on other sites

Just a thought, Nox. You said the All items box cause problems with the game trying to load everything in at once. Is that crate REALLY needed? Why not separate into All weps and All items? EDIT: Gonna reinstall the tools with the latest version and see if my problem from yesterday went away. Why would my filters just suddenly do that? I read what BetterDead said but I don't understand. I was hoping it'd be as simple as changing a 5 to a 1. So what is the process with what he shows? Do i have to generate that for all the items, as it wasn't just the KA-60's rocket that triggers different kicks, but really all missiles/explosives, including avenger and hind, for instance. Thanks guys!

 

With that method you would have to do the exceptions for each thing that causes the kick. Now as for the everything box, it has no errors now, just laggs for a few seconds. This is already split into two boxes however. Those two boxes don't get EVERYTHING like the other box, but it gets almost everything. I could make them get every item, but the problem with that is a lot of the items in the box don't really exist in the dayz game, but they do in arma. 

Link to comment
Share on other sites

How do you teleport a player to you? If you try teleporting another player, Epoch's anticheat prevents them from being teleported. Just like with the regular teleport command, I needed to put my own UID into the anticheat section of the init.sqf.

 

I expect you are not using the AdminList.sqf and instead have your ID in the init.sqf. If you have the latest tools you will see in the AdminList.sqf that there are 3 arrays. You need ALL three of these for things to work correctly. You are most likely missing the third item which I believe is tempList.

Link to comment
Share on other sites

With that method you would have to do the exceptions for each thing that causes the kick. Now as for the everything box, it has no errors now, just laggs for a few seconds. This is already split into two boxes however. Those two boxes don't get EVERYTHING like the other box, but it gets almost everything. I could make them get every item, but the problem with that is a lot of the items in the box don't really exist in the dayz game, but they do in arma. 

Alright, but I feel like I missed something. Why do i all of a sudden have to do this? I was under the impression I was already replacing my files with your edited ones. Maybe I did something wrong. Everything worked alright, I go to bed and I wake up to it. I get BE Script Restriction #2 for crates, I was pretty sure I had the current one but I will reinstall when players get off my server.

Link to comment
Share on other sites

Alright, but I feel like I missed something. Why do i all of a sudden have to do this? I was under the impression I was already replacing my files with your edited ones. Maybe I did something wrong. Everything worked alright, I go to bed and I wake up to it. I get BE Script Restriction #2 for crates, I was pretty sure I had the current one but I will reinstall when players get off my server.

 

It shouldn't have happened. I don't know what went wrong but this game is a buggy one. Sometimes I can't even shut down the server correctly because it still runs in the background. Just reinstall and hopefully it is fine.

Link to comment
Share on other sites

You need to download a new server.pbo. Yours is missing all kinds of information. Your cleanup is missing, your check hackers function is missing, where did you get this file? Did it come with your server rental? What rental? I would download a clean server.pbo from epoch website and THEN redo all the changes required. It will work after that. Just so you know if you don't make the edit in the server_functions.sqf that you have, the tool swill work fine, so long as the server runs correctly, but you should know that you are missing important items int hat sqf. I would personally replace the entire pbo.

 

 

Ok I've replaced the old pbo with new one & it runs but when I do the changes in the server_functions.sqf & the server_updateObject.sqf  I just get a black screen when trying to get into game. I'm doing something wrong so I'll just post the two files here to show what I did:

 

server_functions.sqf

waituntil {!isnil "bis_fnc_init"};

BIS_MPF_remoteExecutionServer = {

    if ((_this select 1) select 2 == "JIPrequest") then {

        [nil,(_this select 1) select 0,"loc",rJIPEXEC,[any,any,"per","execVM","ca\Modules\Functions\init.sqf"]] call RE;

    };

};

/* Skaronator - secured better remoteExecServer

BIS_MPF_remoteExecutionServer = {

    if ((_this select 1) select 2 == "JIPrequest") then {

        _playerObj = (_this select 1) select 0;            

        remExField = [nil, nil, format ["";if !(isServer) then {[] execVM "ca\Modules\Functions\init.sqf";};""]];

        (owner _playerObj) publicVariableClient "remExField";

    };

};*/

BIS_Effects_Burn =                {};

server_playerLogin =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerLogin.sqf";

server_playerSetup =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSetup.sqf";

server_onPlayerDisconnect =     compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.sqf";

server_updateObject =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateObject.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";

server_deleteObj =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_deleteObj.sqf";

server_swapObject =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_swapObject.sqf";

server_publishVeh =             compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle.sqf";

server_publishVeh2 =             compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle2.sqf";

server_publishVeh3 =             compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle3.sqf";

server_tradeObj =                 compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.sqf";

server_traders =                 compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_traders.sqf";

server_playerSync =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSync.sqf";

server_spawnCrashSite  =        compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCrashSite.sqf";

server_spawnEvents =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnEvent.sqf";

//server_weather =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_weather.sqf";

fnc_plyrHit   =                    compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.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";

/* PVS/PVC - Skaronator */

server_sendToClient =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_sendToClient.sqf";

//onPlayerConnected             {[_uid,_name] call server_onPlayerConnect;};

onPlayerDisconnected         {[_uid,_name] call server_onPlayerDisconnect;};

server_updateNearbyObjects = {

    private["_pos"];

    _pos = _this select 0;

    {

        [_x, "gear"] call server_updateObject;

    } forEach nearestObjects [_pos, dayz_updateObjects, 10];

};

server_handleZedSpawn = {

    private["_zed"];

    _zed = _this select 0;

    _zed enableSimulation false;

};

zombie_findOwner = {

    private["_unit"];

    _unit = _this select 0;

    #ifdef DZE_SERVER_DEBUG

    diag_log ("CLEANUP: DELETE UNCONTROLLED ZOMBIE: " + (typeOf _unit) + " OF: " + str(_unit) );

    #endif

    deleteVehicle _unit;

};

vehicle_handleInteract = {

    private["_object"];

    _object = _this select 0;

    needUpdate_objects = needUpdate_objects - [_object];

    [_object, "all"] call server_updateObject;

};

array_reduceSizeReverse = {

    private["_array","_count","_num","_newarray","_startnum","_index"];

    _array = _this select 0;

    _newarray = [];

    _count = _this select 1;

    _num = count _array;

    if (_num > _count) then {

        _startnum = _num - 1;

        _index = _count - 1;

        for "_i" from 0 to _index do {

            _newarray set [(_index-_i),_array select (_startnum - _i)];

        };

        _array = _newarray;

    };

    _array

};

array_reduceSize = {

    private ["_array1","_array","_count","_num"];

    _array1 = _this select 0;

    _array = _array1 - ["Hatchet_Swing","Machete_Swing","Fishing_Swing","sledge_swing","crowbar_swing","CSGAS"];

    _count = _this select 1;

    _num = count _array;

    if (_num > _count) then {

        _array resize _count;

    };

    _array

};

object_handleServerKilled = {

    private["_unit","_objectID","_objectUID","_killer"];

    _unit = _this select 0;

    _killer = _this select 1;

    

    _objectID =     _unit getVariable ["ObjectID","0"];

    _objectUID = _unit getVariable ["ObjectUID","0"];

        

    [_objectID,_objectUID,_killer] call server_deleteObj;

    

    _unit removeAllMPEventHandlers "MPKilled";

    _unit removeAllEventHandlers "Killed";

    _unit removeAllEventHandlers "HandleDamage";

    _unit removeAllEventHandlers "GetIn";

    _unit removeAllEventHandlers "GetOut";

};

check_publishobject = {

    private["_allowed","_object","_playername"];

    _object = _this select 0;

    _playername = _this select 1;

    _allowed = false;

    if ((typeOf _object) in dayz_allowedObjects) then {

            //diag_log format ["DEBUG: Object: %1 published by %2 is Safe",_object, _playername];

            _allowed = true;

    };

    _allowed

};

//event Handlers

eh_localCleanup = {

    private ["_object"];

    _object = _this select 0;

    _object addEventHandler ["local", {

        if(_this select 1) then {

            private["_type","_unit"];

            _unit = _this select 0;

            _type = typeOf _unit;

             _myGroupUnit = group _unit;

             _unit removeAllMPEventHandlers "mpkilled";

             _unit removeAllMPEventHandlers "mphit";

             _unit removeAllMPEventHandlers "mprespawn";

             _unit removeAllEventHandlers "FiredNear";

            _unit removeAllEventHandlers "HandleDamage";

            _unit removeAllEventHandlers "Killed";

            _unit removeAllEventHandlers "Fired";

            _unit removeAllEventHandlers "GetOut";

            _unit removeAllEventHandlers "GetIn";

            _unit removeAllEventHandlers "Local";

            clearVehicleInit _unit;

            deleteVehicle _unit;

            deleteGroup _myGroupUnit;

            //_unit = nil;

            diag_log ("CLEANUP: DELETED A " + str(_type) );

        };

    }];

};

server_hiveWrite = {

    private["_data"];

    _data = "HiveExt" callExtension _this;

};

server_hiveReadWrite = {

    private["_key","_resultArray","_data"];

    _key = _this;

    _data = "HiveExt" callExtension _key;

    _resultArray = call compile format ["%1",_data];

    _resultArray

};

server_hiveReadWriteLarge = {

    private["_key","_resultArray","_data"];

    _key = _this;

    _data = "HiveExt" callExtension _key;

    _resultArray = call compile _data;

    _resultArray

};

server_checkIfTowed = {

    private ["_vehicle","_player","_attached"];

    if (DZE_HeliLift) then {

        _vehicle =     _this select 0;

        _player =     _this select 2;

        _attached = _vehicle getVariable["attached",false];

        if ((typeName _attached == "OBJECT")) then {

            _player action ["eject", _vehicle];

            detach _vehicle;

            _vehicle setVariable["attached",false,true];

            _attached setVariable["hasAttached",false,true];

        };

    };

};

server_characterSync = {

    private ["_characterID","_playerPos","_playerGear","_playerBackp","_medical","_currentState","_currentModel","_key"];

    _characterID =     _this select 0;    

    _playerPos =    _this select 1;

    _playerGear =    _this select 2;

    _playerBackp =    _this select 3;

    _medical =         _this select 4;

    _currentState =    _this select 5;

    _currentModel = _this select 6;

    

    _key = format["CHILD:201:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:",_characterID,_playerPos,_playerGear,_playerBackp,_medical,false,false,0,0,0,0,_currentState,0,0,_currentModel,0];

    _key call server_hiveWrite;

};

if(isnil "dayz_MapArea") then {

    dayz_MapArea = 10000;

};

if(isnil "DynamicVehicleArea") then {

    DynamicVehicleArea = dayz_MapArea / 2;

};

// Get all buildings and roads only once TODO: set variables to nil after done if nessicary

MarkerPosition = getMarkerPos "center";

RoadList = MarkerPosition nearRoads DynamicVehicleArea;

// Very taxing !!! but only on first startup

BuildingList = [];

{

    if (DZE_MissionLootTable) then {

        if (isClass (missionConfigFile >> "CfgBuildingLoot" >> (typeOf _x))) then

        {

                BuildingList set [count BuildingList,_x];

        };

    } else {

        if (isClass (configFile >> "CfgBuildingLoot" >> (typeOf _x))) then

        {

            BuildingList set [count BuildingList,_x];

        };

    };

    

    

} forEach (MarkerPosition nearObjects ["building",DynamicVehicleArea]);

spawn_vehicles = {

    private ["_random","_lastIndex","_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];

    

    if (!isDedicated) exitWith { }; //Be sure the run this

    while {count AllowedVehiclesList > 0} do {

        // BIS_fnc_selectRandom replaced because the index may be needed to remove the element

        _index = floor random count AllowedVehiclesList;

        _random = AllowedVehiclesList select _index;

        _vehicle = _random select 0;

        _velimit = _random select 1;

        _qty = {_x == _vehicle} count serverVehicleCounter;

        // If under limit allow to proceed

        if (_qty <= _velimit) exitWith {};

        // vehicle limit reached, remove vehicle from list

        // since elements cannot be removed from an array, overwrite it with the last element and cut the last element of (as long as order is not important)

        _lastIndex = (count AllowedVehiclesList) - 1;

        if (_lastIndex != _index) then {

            AllowedVehiclesList set [_index, AllowedVehiclesList select _lastIndex];

        };

        AllowedVehiclesList resize _lastIndex;

    };

    if (count AllowedVehiclesList == 0) then {

        diag_log("DEBUG: unable to find suitable vehicle to spawn");

    } else {

        // add vehicle to counter for next pass

        serverVehicleCounter set [count serverVehicleCounter,_vehicle];

    

        // Find Vehicle Type to better control spawns

        _isAir = _vehicle isKindOf "Air";

        _isShip = _vehicle isKindOf "Ship";

    

        if(_isShip || _isAir) then {

            if(_isShip) then {

                // Spawn anywhere on coast on water

                waitUntil{!isNil "BIS_fnc_findSafePos"};

                _position = [MarkerPosition,0,DynamicVehicleArea,10,1,2000,1] call BIS_fnc_findSafePos;

                //diag_log("DEBUG: spawning boat near coast " + str(_position));

            } else {

                // Spawn air anywhere that is flat

                waitUntil{!isNil "BIS_fnc_findSafePos"};

                _position = [MarkerPosition,0,DynamicVehicleArea,10,0,2000,0] call BIS_fnc_findSafePos;

                //diag_log("DEBUG: spawning air anywhere flat " + str(_position));

            };

        

        

        } else {

            // Spawn around buildings and 50% near roads

            if((random 1) > 0.5) then {

            

                waitUntil{!isNil "BIS_fnc_selectRandom"};

                _position = RoadList call BIS_fnc_selectRandom;

            

                _position = _position modelToWorld [0,0,0];

            

                waitUntil{!isNil "BIS_fnc_findSafePos"};

                _position = [_position,0,10,10,0,2000,0] call BIS_fnc_findSafePos;

            

                //diag_log("DEBUG: spawning near road " + str(_position));

            

            } else {

            

                waitUntil{!isNil "BIS_fnc_selectRandom"};

                _position = BuildingList call BIS_fnc_selectRandom;

            

                _position = _position modelToWorld [0,0,0];

            

                waitUntil{!isNil "BIS_fnc_findSafePos"};

                _position = [_position,0,40,5,0,2000,0] call BIS_fnc_findSafePos;

            

                //diag_log("DEBUG: spawning around buildings " + str(_position));

        

            };

        };

        // only proceed if two params otherwise BIS_fnc_findSafePos failed and may spawn in air

        if ((count _position) == 2) then {

    

            _dir = round(random 180);

        

            _istoomany = _position nearObjects ["AllVehicles",50];

            if((count _istoomany) > 0) exitWith { diag_log("DEBUG: Too many vehicles at " + str(_position)); };

        

            //place vehicle

            _veh = createVehicle [_vehicle, _position, [], 0, "CAN_COLLIDE"];

            _veh setdir _dir;

            _veh setpos _position;        

            

            if(DZEdebug) then {

                _marker = createMarker [str(_position) , _position];

                _marker setMarkerShape "ICON";

                _marker setMarkerType "DOT";

                _marker setMarkerText _vehicle;

            };    

        

            // Get position with ground

            _objPosition = getPosATL _veh;

        

            clearWeaponCargoGlobal  _veh;

            clearMagazineCargoGlobal  _veh;

            // _veh setVehicleAmmo DZE_vehicleAmmo;

            // Add 0-3 loots to vehicle using random cfgloots

            _num = floor(random 4);

            _allCfgLoots = ["trash","civilian","food","generic","medical","military","policeman","hunter","worker","clothes","militaryclothes","specialclothes","trash"];

            

            for "_x" from 1 to _num do {

                _iClass = _allCfgLoots call BIS_fnc_selectRandom;

                _itemTypes = [];

                if (DZE_MissionLootTable) then {

                    _itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iClass)) select 0);

                } else {

                    _itemTypes = ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0);

                };

                _index = dayz_CLBase find _iClass;

                _weights = dayz_CLChances select _index;

                _cntWeights = count _weights;

                

                _index = floor(random _cntWeights);

                _index = _weights select _index;

                _itemType = _itemTypes select _index;

                _veh addMagazineCargoGlobal [_itemType,1];

                //diag_log("DEBUG: spawed loot inside vehicle " + str(_itemType));

            };

            [_veh,[_dir,_objPosition],_vehicle,true,"0"] call server_publishVeh;

        };

    };

};

spawn_ammosupply = {

    private ["_position","_veh","_istoomany","_marker","_spawnveh","_WreckList"];

    if (isDedicated) then {

        _WreckList = ["Supply_Crate_DZE"];

        waitUntil{!isNil "BIS_fnc_selectRandom"};

        _position = RoadList call BIS_fnc_selectRandom;

        _position = _position modelToWorld [0,0,0];

        waitUntil{!isNil "BIS_fnc_findSafePos"};

        _position = [_position,5,20,5,0,2000,0] call BIS_fnc_findSafePos;

        if ((count _position) == 2) then {

            _istoomany = _position nearObjects ["All",5];

            

            if((count _istoomany) > 0) exitWith { diag_log("DEBUG VEIN: Too many at " + str(_position)); };

            

            _spawnveh = _WreckList call BIS_fnc_selectRandom;

            if(DZEdebug) then {

                _marker = createMarker [str(_position) , _position];

                _marker setMarkerShape "ICON";

                _marker setMarkerType "DOT";

                _marker setMarkerText str(_spawnveh);

            };

            

            _veh = createVehicle [_spawnveh,_position, [], 0, "CAN_COLLIDE"];

            _veh enableSimulation false;

            _veh setDir round(random 360);

            _veh setpos _position;

            _veh setVariable ["ObjectID","1",true];

        };

    };

};

DZE_LocalRoadBlocks = [];

spawn_roadblocks = {

    private ["_position","_veh","_istoomany","_marker","_spawnveh","_WreckList"];

    _WreckList = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];

    

    waitUntil{!isNil "BIS_fnc_selectRandom"};

    if (isDedicated) then {

    

        _position = RoadList call BIS_fnc_selectRandom;

        

        _position = _position modelToWorld [0,0,0];

        

        waitUntil{!isNil "BIS_fnc_findSafePos"};

        _position = [_position,0,10,5,0,2000,0] call BIS_fnc_findSafePos;

        

        if ((count _position) == 2) then {

            // Get position with ground

            

            _istoomany = _position nearObjects ["All",5];

        

            if((count _istoomany) > 0) exitWith { diag_log("DEBUG: Too many at " + str(_position)); };

            

            waitUntil{!isNil "BIS_fnc_selectRandom"};

            _spawnveh = _WreckList call BIS_fnc_selectRandom;

            if(DZEdebug) then {

                _marker = createMarker [str(_position) , _position];

                _marker setMarkerShape "ICON";

                _marker setMarkerType "DOT";

                _marker setMarkerText str(_spawnveh);

            };

            _veh = createVehicle [_spawnveh,_position, [], 0, "CAN_COLLIDE"];

            _veh enableSimulation false;

            _veh setDir round(random 360); // Randomize placement a bit

            _veh setpos _position;

            _veh setVariable ["ObjectID","1",true];

        };

    

    };

    

};

spawn_mineveins = {

    private ["_position","_veh","_istoomany","_marker","_spawnveh","_positions"];

    if (isDedicated) then {

        

        _position = [getMarkerPos "center",0,(HeliCrashArea*0.75),10,0,2000,0] call BIS_fnc_findSafePos;

        if ((count _position) == 2) then {

            

            _positions = selectBestPlaces [_position, 500, "(1 + forest) * (1 + hills) * (1 - houses) * (1 - sea)", 10, 5];

            _position = (_positions call BIS_fnc_selectRandom) select 0;

            // Get position with ground

            _istoomany = _position nearObjects ["All",10];

        

            if((count _istoomany) > 0) exitWith { diag_log("DEBUG VEIN: Too many objects at " + str(_position)); };

            if(isOnRoad _position) exitWith { diag_log("DEBUG VEIN: on road " + str(_position)); };

            

            _spawnveh = ["Iron_Vein_DZE","Iron_Vein_DZE","Iron_Vein_DZE","Iron_Vein_DZE","Iron_Vein_DZE","Silver_Vein_DZE","Silver_Vein_DZE","Silver_Vein_DZE","Gold_Vein_DZE","Gold_Vein_DZE"] call BIS_fnc_selectRandom;

            if(DZEdebug) then {

                _marker = createMarker [str(_position) , _position];

                _marker setMarkerShape "ICON";

                _marker setMarkerType "DOT";

                _marker setMarkerText str(_spawnveh);

            };

            

            //diag_log("DEBUG: Spawning a crashed " + _spawnveh + " with " + _spawnloot + " at " + str(_position));

            _veh = createVehicle [_spawnveh,_position, [], 0, "CAN_COLLIDE"];

            _veh enableSimulation false;

            // Randomize placement a bit

            _veh setDir round(random 360);

            _veh setpos _position;

            _veh setVariable ["ObjectID","1",true];

        

        };

    };

};

if(isnil "DynamicVehicleDamageLow") then {

    DynamicVehicleDamageLow = 0;

};

if(isnil "DynamicVehicleDamageHigh") then {

    DynamicVehicleDamageHigh = 100;

};

if(isnil "DynamicVehicleFuelLow") then {

    DynamicVehicleFuelLow = 0;

};

if(isnil "DynamicVehicleFuelHigh") then {

    DynamicVehicleFuelHigh = 100;

};

if(isnil "DZE_DiagFpsSlow") then {

    DZE_DiagFpsSlow = false;

};

if(isnil "DZE_DiagFpsFast") then {

    DZE_DiagFpsFast = false;

};

if(isnil "DZE_DiagVerbose") then {

    DZE_DiagVerbose = false;

};

dze_diag_fps = {

    if(DZE_DiagVerbose) then {

        diag_log format["DEBUG FPS : %1 OBJECTS: %2 : PLAYERS: %3", diag_fps,(count (allMissionObjects "")),(playersNumber west)];

    } else {

        diag_log format["DEBUG FPS : %1", diag_fps];

    };

};

// Damage generator function

generate_new_damage = {

    private ["_damage"];

    _damage = ((random(DynamicVehicleDamageHigh-DynamicVehicleDamageLow))+DynamicVehicleDamageLow) / 100;

    _damage;

};

// Damage generator fuction

generate_exp_damage = {

    private ["_damage"];

    _damage = ((random(DynamicVehicleDamageHigh-DynamicVehicleDamageLow))+DynamicVehicleDamageLow) / 100;

    

    // limit this to 85% since vehicle would blow up otherwise.

    //if(_damage >= 0.85) then {

    //    _damage = 0.85;

    //};

    _damage;

};

server_getDiff =    {

    private["_variable","_object","_vNew","_vOld","_result"];

    _variable = _this select 0;

    _object =     _this select 1;

    _vNew =     _object getVariable[_variable,0];

    _vOld =     _object getVariable[(_variable + "_CHK"),_vNew];

    _result =     0;

    if (_vNew < _vOld) then {

        //JIP issues

        _vNew = _vNew + _vOld;

        _object getVariable[(_variable + "_CHK"),_vNew];

    } else {

        _result = _vNew - _vOld;

        _object setVariable[(_variable + "_CHK"),_vNew];

    };

    _result

};

server_getDiff2 =    {

    private["_variable","_object","_vNew","_vOld","_result"];

    _variable = _this select 0;

    _object =     _this select 1;

    _vNew =     _object getVariable[_variable,0];

    _vOld =     _object getVariable[(_variable + "_CHK"),_vNew];

    _result = _vNew - _vOld;

    _object setVariable[(_variable + "_CHK"),_vNew];

    _result

};

dayz_objectUID = {

    private["_position","_dir","_key","_object"];

    _object = _this;

    _position = getPosATL _object;

    _dir = direction _object;

    _key = [_dir,_position] call dayz_objectUID2;

    _key

};

dayz_objectUID2 = {

    private["_position","_dir","_key"];

    _dir = _this select 0;

    _key = "";

    _position = _this select 1;

    {

        _x = _x * 10;

        if ( _x < 0 ) then { _x = _x * -10 };

        _key = _key + str(round(_x));

    } forEach _position;

    _key = _key + str(round(_dir));

    _key

};

dayz_objectUID3 = {

    private["_position","_dir","_key"];

    _dir = _this select 0;

    _key = "";

    _position = _this select 1;

    {

        _x = _x * 10;

        if ( _x < 0 ) then { _x = _x * -10 };

        _key = _key + str(round(_x));

    } forEach _position;

    _key = _key + str(round(_dir + time));

    _key

};

dayz_recordLogin = {

    private["_key"];

    _key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2];

    _key call server_hiveWrite;

};

dayz_perform_purge = {

    if(!isNull(_this)) then {

        _this removeAllMPEventHandlers "mpkilled";

        _this removeAllMPEventHandlers "mphit";

        _this removeAllMPEventHandlers "mprespawn";

        _this removeAllEventHandlers "FiredNear";

        _this removeAllEventHandlers "HandleDamage";

        _this removeAllEventHandlers "Killed";

        _this removeAllEventHandlers "Fired";

        _this removeAllEventHandlers "GetOut";

        _this removeAllEventHandlers "GetIn";

        _this removeAllEventHandlers "Local";

        clearVehicleInit _this;

        deleteVehicle _this;

        deleteGroup (group _this);

    };

};

dayz_perform_purge_player = {

    private ["_countr","_backpack","_backpackType","_backpackWpn","_backpackMag","_objWpnTypes","_objWpnQty","_location","_dir","_holder","_weapons","_magazines"];

    diag_log ("Purging player: " + str(_this));    

    if(!isNull(_this)) then {

        _location = getPosATL _this;

        _dir = getDir _this;

        _holder = createVehicle ["GraveDZE", _location, [], 0, "CAN_COLLIDE"];

        _holder setDir _dir;

        _holder setPosATL _location;

        _holder enableSimulation false;

        _weapons = weapons _this;

        _magazines = magazines _this;

        // find backpack

        if(!(isNull unitBackpack _this)) then {

            _backpack = unitBackpack _this;

            _backpackType = typeOf _backpack;

            _backpackWpn = getWeaponCargo _backpack;

            _backpackMag = getMagazineCargo _backpack;

            _holder addBackpackCargoGlobal [_backpackType,1];

            // add items from backpack

            _objWpnTypes = _backpackWpn select 0;

            _objWpnQty = _backpackWpn select 1;

            _countr = 0;

            {

                _holder addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];

                _countr = _countr + 1;

            } forEach _objWpnTypes;

            // add backpack magazine items

            _objWpnTypes = _backpackMag select 0;

            _objWpnQty = _backpackMag select 1;

            _countr = 0;

            {

                _holder addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];

                _countr = _countr + 1;

            } forEach _objWpnTypes;

        };

    };

    // add weapons

    {

        _holder addWeaponCargoGlobal [_x, 1];

    } forEach _weapons;

    // add mags

    {

        _holder addMagazineCargoGlobal [_x, 1];

    } forEach _magazines;

    _this removeAllMPEventHandlers "mpkilled";

    _this removeAllMPEventHandlers "mphit";

    _this removeAllMPEventHandlers "mprespawn";

    _this removeAllEventHandlers "FiredNear";

    _this removeAllEventHandlers "HandleDamage";

    _this removeAllEventHandlers "Killed";

    _this removeAllEventHandlers "Fired";

    _this removeAllEventHandlers "GetOut";

    _this removeAllEventHandlers "GetIn";

    _this removeAllEventHandlers "Local";

    clearVehicleInit _this;

    deleteVehicle _this;

    deleteGroup (group _this);

    //  _this = nil;

};

dayz_removePlayerOnDisconnect = {

    if(!isNull(_this)) then {

        _this removeAllMPEventHandlers "mphit";

        deleteVehicle _this;

        deleteGroup (group _this);

    };

};

server_timeSync = {

    //Send request

    private ["_hour","_minute","_date","_key","_result","_outcome"];

    _key = "CHILD:307:";

    _result = _key call server_hiveReadWrite;

    _outcome = _result select 0;

    if(_outcome == "PASS") then {

        _date = _result select 1;

        

        if(dayz_fullMoonNights) then {

            _hour = _date select 3;

            _minute = _date select 4;

            //Force full moon nights

            _date = [2013,8,3,_hour,_minute];

        };

        setDate _date;

        PVDZE_plr_SetDate = _date;

        publicVariable "PVDZE_plr_SetDate";

        diag_log ("TIME SYNC: Local Time set to " + str(_date));    

    };

};

// must spawn these

server_spawncleanDead = {

    private ["_deathTime","_delQtyZ","_delQtyP","_qty","_allDead"];

    _allDead = allDead;

    _delQtyZ = 0;

    _delQtyP = 0;

    {

        if (local _x) then {

            if (_x isKindOf "zZombie_Base") then

            {

                _x call dayz_perform_purge;

                sleep 0.05;

                _delQtyZ = _delQtyZ + 1;

            } else {

                if (_x isKindOf "CAManBase") then {

                    _deathTime = _x getVariable ["processedDeath", diag_tickTime];

                    if (diag_tickTime - _deathTime > 1800) then {

                        _x call dayz_perform_purge_player;

                        sleep 0.025;

                        _delQtyP = _delQtyP + 1;

                    };

                };

            };

        };

        sleep 0.025;

    } forEach _allDead;

    if (_delQtyZ > 0 or _delQtyP > 0) then {

        _qty = count _allDead;

        diag_log (format["CLEANUP: Deleted %1 players and %2 zombies out of %3 dead",_delQtyP,_delQtyZ,_qty]);

    };

};

server_cleanupGroups = {

    if (DZE_DYN_AntiStuck3rd > 3) then { DZE_DYN_GroupCleanup = nil; DZE_DYN_AntiStuck3rd = 0; };

    if(!isNil "DZE_DYN_GroupCleanup") exitWith {  DZE_DYN_AntiStuck3rd = DZE_DYN_AntiStuck3rd + 1;};

    DZE_DYN_GroupCleanup = true;

    {

        if (count units _x == 0) then {

            deleteGroup _x;

        };

        sleep 0.001;

    } forEach allGroups;

    DZE_DYN_GroupCleanup = nil;

};

server_checkHackers = {

    if (DZE_DYN_AntiStuck2nd > 3) then { DZE_DYN_HackerCheck = nil; DZE_DYN_AntiStuck2nd = 0; };

    if(!isNil "DZE_DYN_HackerCheck") exitWith {  DZE_DYN_AntiStuck2nd = DZE_DYN_AntiStuck2nd + 1;};

    DZE_DYN_HackerCheck = true;

    {

        //if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle)) then {

if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle) && (vehicle _x getVariable ["MalSar",0] !=1)) then {

            diag_log ("CLEANUP: KILLING A HACKER " + (name _x) + " " + str(_x) + " IN " + (typeOf vehicle _x));

            (vehicle _x) setDamage 1;

            _x setDamage 1;

            sleep 0.25;

        };

        sleep 0.001;

    } forEach allUnits;

    DZE_DYN_HackerCheck = nil;

};

server_spawnCleanFire = {

    private ["_delQtyFP","_qty","_delQtyNull","_missionFires"];

    _missionFires = allMissionObjects "Land_Fire_DZ";

    _delQtyFP = 0;

    {

        if (local _x) then {

            deleteVehicle _x;

            sleep 0.025;

            _delQtyFP = _delQtyFP + 1;

        };

        sleep 0.001;

    } forEach _missionFires;

    if (_delQtyFP > 0) then {

        _qty = count _missionFires;

        diag_log (format["CLEANUP: Deleted %1 fireplaces out of %2",_delQtyNull,_qty]);

    };

};

server_spawnCleanLoot = {

    private ["_created","_delQty","_nearby","_age","_keep","_qty","_missionObjs","_dateNow"];

    if (DZE_DYN_AntiStuck > 3) then { DZE_DYN_cleanLoot = nil; DZE_DYN_AntiStuck = 0; };

    if(!isNil "DZE_DYN_cleanLoot") exitWith {  DZE_DYN_AntiStuck = DZE_DYN_AntiStuck + 1;};

    DZE_DYN_cleanLoot = true;

    _missionObjs =  allMissionObjects "ReammoBox";

    _delQty = 0;

    _dateNow = (DateToNumber date);

    {

        _keep = _x getVariable ["permaLoot",false];

        if (!_keep) then {

            _created = _x getVariable ["created",-0.1];

            if (_created == -0.1) then {

                _x setVariable ["created",_dateNow,false];

                _created = _dateNow;

            } else {

                _age = (_dateNow - _created) * 525948;

                if (_age > 20) then {

                    _nearby = {(isPlayer _x) and (alive _x)} count (_x nearEntities [["CAManBase","AllVehicles"], 130]);

                    if (_nearby==0) then {

                        deleteVehicle _x;

                        sleep 0.025;

                        _delQty = _delQty + 1;

                    };

                };

            };

        };

        sleep 0.001;

    } forEach _missionObjs;

    if (_delQty > 0) then {

        _qty = count _missionObjs;

        diag_log (format["CLEANUP: Deleted %1 Loot Piles out of %2",_delQty,_qty]);

    };

    DZE_DYN_cleanLoot = nil;

};

server_spawnCleanAnimals = {

    private ["_pos","_delQtyAnimal","_qty","_missonAnimals","_nearby"];

    _missonAnimals = entities "CAAnimalBase";

    _delQtyAnimal = 0;

    {

        if (local _x) then {

            _x call dayz_perform_purge;

            sleep 0.05;

            _delQtyAnimal = _delQtyAnimal + 1;

        } else {

            if (!alive _x) then {

                _pos = getPosATL _x;

                if (count _pos > 0) then {

                    _nearby = {(isPlayer _x) and (alive _x)} count (_pos nearEntities [["CAManBase","AllVehicles"], 130]);

                    if (_nearby==0) then {

                        _x call dayz_perform_purge;

                        sleep 0.05;

                        _delQtyAnimal = _delQtyAnimal + 1;

                    };

                };

            };

        };

        sleep 0.001;

    } forEach _missonAnimals;

    if (_delQtyAnimal > 0) then {

        _qty = count _missonAnimals;

        diag_log (format["CLEANUP: Deleted %1 Animals out of %2",_delQtyAnimal,_qty]);

    };

};

server_getLocalObjVars = {

    private ["_player","_obj","_objectID","_objectUID","_weapons","_magazines","_backpacks"];

    _player = _this select 0;

    _obj = _this select 1;

    _objectID     = _obj getVariable["ObjectID","0"];

    _objectUID    = _obj getVariable["ObjectUID","0"];

    _weapons = _obj getVariable ["WeaponCargo", false];

    _magazines = _obj getVariable ["MagazineCargo", false];

    _backpacks = _obj getVariable ["BackpackCargo", false];

    PVDZE_localVarsResult = [_weapons,_magazines,_backpacks];

    (owner _player) publicVariableClient "PVDZE_localVarsResult";

    

    diag_log format["SAFE UNLOCKED: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player)];

};

server_setLocalObjVars = {

    private ["_obj","_holder","_weapons","_magazines","_backpacks","_player","_objectID","_objectUID"];

    _obj = _this select 0;

    _holder = _this select 1;

    _player = _this select 2;

    _objectID     = _obj getVariable["ObjectID","0"];

    _objectUID    = _obj getVariable["ObjectUID","0"];

    _weapons =         getWeaponCargo _obj;

    _magazines =     getMagazineCargo _obj;

    _backpacks =     getBackpackCargo _obj;

    

    deleteVehicle _obj;

    _holder setVariable ["WeaponCargo", _weapons];

    _holder setVariable ["MagazineCargo", _magazines];

    _holder setVariable ["BackpackCargo", _backpacks];

    

    diag_log format["SAFE LOCKED: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player)];

};

 

 

server_updateObject.sqf

/*

[_object,_type] spawn server_updateObject;

*/

private ["_object","_type","_objectID","_uid","_lastUpdate","_needUpdate","_object_position","_object_inventory","_object_damage","_isNotOk","_parachuteWest","_firstTime","_object_killed","_object_repair","_isbuildable"];

_object =     _this select 0;

if(isNull(_object)) exitWith {

    diag_log format["Skipping Null Object: %1", _object];

};

_type =     _this select 1;

_parachuteWest = ((typeOf _object == "ParachuteWest") or (typeOf _object == "ParachuteC"));

_isbuildable = (typeOf _object) in dayz_allowedObjects;

_isNotOk = false;

_firstTime = false;

_objectID =    _object getVariable ["ObjectID","0"];

_uid =         _object getVariable ["ObjectUID","0"];

if ((typeName _objectID != "string") || (typeName _uid != "string")) then

{

    diag_log(format["Non-string Object: ID %1 UID %2", _objectID, _uid]);

    //force fail

    _objectID = "0";

    _uid = "0";

};

if (_object getVariable "MalSar" == 1) exitWith {};

if (!_parachuteWest and !(locked _object)) then {

    if (_objectID == "0" && _uid == "0") then

    {

        _object_position = getPosATL _object;

        _isNotOk = true;

    };

};

// do not update if buildable and not ok

if (_isNotOk and _isbuildable) exitWith {  };

// delete if still not ok

if (_isNotOk) exitWith { deleteVehicle _object; diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",typeOf _object,_object_position select 0,_object_position select 1, _object_position select 2]); };

_lastUpdate = _object getVariable ["lastUpdate",time];

_needUpdate = _object in needUpdate_objects;

// TODO ----------------------

_object_position = {

    private["_position","_worldspace","_fuel","_key"];

        _position = getPosATL _object;

        _worldspace = [

            round(direction _object),

            _position

        ];

        _fuel = 0;

        if (_object isKindOf "AllVehicles") then {

            _fuel = fuel _object;

        };

        _key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];

        //diag_log ("HIVE: WRITE: "+ str(_key));

        _key call server_hiveWrite;

};

_object_inventory = {

    private["_inventory","_previous","_key"];

        _inventory = [

            getWeaponCargo _object,

            getMagazineCargo _object,

            getBackpackCargo _object

        ];

        _previous = str(_object getVariable["lastInventory",[]]);

        if (str(_inventory) != _previous) then {

            _object setVariable["lastInventory",_inventory];

            if (_objectID == "0") then {

                _key = format["CHILD:309:%1:%2:",_uid,_inventory];

            } else {

                _key = format["CHILD:303:%1:%2:",_objectID,_inventory];

            };

            //diag_log ("HIVE: WRITE: "+ str(_key));

            _key call server_hiveWrite;

        };

};

_object_damage = {

    private["_hitpoints","_array","_hit","_selection","_key","_damage"];

        _hitpoints = _object call vehicle_getHitpoints;

        _damage = damage _object;

        _array = [];

        {

            _hit = [_object,_x] call object_getHit;

            _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");

            if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};

            _object setHit ["_selection", _hit]

        } forEach _hitpoints;

    

        _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];

        //diag_log ("HIVE: WRITE: "+ str(_key));

        _key call server_hiveWrite;

    _object setVariable ["needUpdate",false,true];

    };

_object_killed = {

    private["_hitpoints","_array","_hit","_selection","_key","_damage"];

    _hitpoints = _object call vehicle_getHitpoints;

    //_damage = damage _object;

    _damage = 1;

    _array = [];

    {

        _hit = [_object,_x] call object_getHit;

        _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");

        if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};

        _hit = 1;

        _object setHit ["_selection", _hit]

    } forEach _hitpoints;

    

    if (_objectID == "0") then {

        _key = format["CHILD:306:%1:%2:%3:",_uid,_array,_damage];

    } else {

        _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];

    };

    //diag_log ("HIVE: WRITE: "+ str(_key));

    _key call server_hiveWrite;

    _object setVariable ["needUpdate",false,true];

};

_object_repair = {

    private["_hitpoints","_array","_hit","_selection","_key","_damage"];

    _hitpoints = _object call vehicle_getHitpoints;

    _damage = damage _object;

    _array = [];

    {

        _hit = [_object,_x] call object_getHit;

        _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");

        if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};

        _object setHit ["_selection", _hit]

    } forEach _hitpoints;

    

    _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];

    //diag_log ("HIVE: WRITE: "+ str(_key));

    _key call server_hiveWrite;

    _object setVariable ["needUpdate",false,true];

};

// TODO ----------------------

_object setVariable ["lastUpdate",time,true];

switch (_type) do {

    case "all": {

        call _object_position;

        call _object_inventory;

        call _object_damage;

        };

    case "position": {

        if (!(_object in needUpdate_objects)) then {

            //diag_log format["DEBUG Position: Added to NeedUpdate=%1",_object];

            needUpdate_objects set [count needUpdate_objects, _object];

        };

    };

    case "gear": {

        call _object_inventory;

            };

    case "damage": {

        if ( (time - _lastUpdate) > 5) then {

            call _object_damage;

        } else {

            if (!(_object in needUpdate_objects)) then {

                //diag_log format["DEBUG Damage: Added to NeedUpdate=%1",_object];

                needUpdate_objects set [count needUpdate_objects, _object];

            };

        };

    };

    case "killed": {

        call _object_killed;

    };

    case "repair": {

        call _object_damage;

    };

};

 

 

Thank you kindly...

Link to comment
Share on other sites

I expect you are not using the AdminList.sqf and instead have your ID in the init.sqf. If you have the latest tools you will see in the AdminList.sqf that there are 3 arrays. You need ALL three of these for things to work correctly. You are most likely missing the third item which I believe is tempList.

I am using the adminlist.sqf but it appears I still have the ID's in my init.sqf without the third array.

Link to comment
Share on other sites

Ok I've replaced the old pbo with new one & it runs but when I do the changes in the server_functions.sqf & the server_updateObject.sqf  I just get a black screen when trying to get into game. I'm doing something wrong so I'll just post the two files here to show what I did:

 

server_functions.sqf

waituntil {!isnil "bis_fnc_init"};

BIS_MPF_remoteExecutionServer = {

    if ((_this select 1) select 2 == "JIPrequest") then {

        [nil,(_this select 1) select 0,"loc",rJIPEXEC,[any,any,"per","execVM","ca\Modules\Functions\init.sqf"]] call RE;

    };

};

/* Skaronator - secured better remoteExecServer

BIS_MPF_remoteExecutionServer = {

    if ((_this select 1) select 2 == "JIPrequest") then {

        _playerObj = (_this select 1) select 0;            

        remExField = [nil, nil, format ["";if !(isServer) then {[] execVM "ca\Modules\Functions\init.sqf";};""]];

        (owner _playerObj) publicVariableClient "remExField";

    };

};*/

BIS_Effects_Burn =                {};

server_playerLogin =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerLogin.sqf";

server_playerSetup =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSetup.sqf";

server_onPlayerDisconnect =     compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.sqf";

server_updateObject =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateObject.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";

server_deleteObj =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_deleteObj.sqf";

server_swapObject =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_swapObject.sqf";

server_publishVeh =             compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle.sqf";

server_publishVeh2 =             compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle2.sqf";

server_publishVeh3 =             compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle3.sqf";

server_tradeObj =                 compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.sqf";

server_traders =                 compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_traders.sqf";

server_playerSync =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSync.sqf";

server_spawnCrashSite  =        compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCrashSite.sqf";

server_spawnEvents =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnEvent.sqf";

//server_weather =                compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_weather.sqf";

fnc_plyrHit   =                    compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.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";

/* PVS/PVC - Skaronator */

server_sendToClient =            compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_sendToClient.sqf";

//onPlayerConnected             {[_uid,_name] call server_onPlayerConnect;};

onPlayerDisconnected         {[_uid,_name] call server_onPlayerDisconnect;};

server_updateNearbyObjects = {

    private["_pos"];

    _pos = _this select 0;

    {

        [_x, "gear"] call server_updateObject;

    } forEach nearestObjects [_pos, dayz_updateObjects, 10];

};

server_handleZedSpawn = {

    private["_zed"];

    _zed = _this select 0;

    _zed enableSimulation false;

};

zombie_findOwner = {

    private["_unit"];

    _unit = _this select 0;

    #ifdef DZE_SERVER_DEBUG

    diag_log ("CLEANUP: DELETE UNCONTROLLED ZOMBIE: " + (typeOf _unit) + " OF: " + str(_unit) );

    #endif

    deleteVehicle _unit;

};

vehicle_handleInteract = {

    private["_object"];

    _object = _this select 0;

    needUpdate_objects = needUpdate_objects - [_object];

    [_object, "all"] call server_updateObject;

};

array_reduceSizeReverse = {

    private["_array","_count","_num","_newarray","_startnum","_index"];

    _array = _this select 0;

    _newarray = [];

    _count = _this select 1;

    _num = count _array;

    if (_num > _count) then {

        _startnum = _num - 1;

        _index = _count - 1;

        for "_i" from 0 to _index do {

            _newarray set [(_index-_i),_array select (_startnum - _i)];

        };

        _array = _newarray;

    };

    _array

};

array_reduceSize = {

    private ["_array1","_array","_count","_num"];

    _array1 = _this select 0;

    _array = _array1 - ["Hatchet_Swing","Machete_Swing","Fishing_Swing","sledge_swing","crowbar_swing","CSGAS"];

    _count = _this select 1;

    _num = count _array;

    if (_num > _count) then {

        _array resize _count;

    };

    _array

};

object_handleServerKilled = {

    private["_unit","_objectID","_objectUID","_killer"];

    _unit = _this select 0;

    _killer = _this select 1;

    

    _objectID =     _unit getVariable ["ObjectID","0"];

    _objectUID = _unit getVariable ["ObjectUID","0"];

        

    [_objectID,_objectUID,_killer] call server_deleteObj;

    

    _unit removeAllMPEventHandlers "MPKilled";

    _unit removeAllEventHandlers "Killed";

    _unit removeAllEventHandlers "HandleDamage";

    _unit removeAllEventHandlers "GetIn";

    _unit removeAllEventHandlers "GetOut";

};

check_publishobject = {

    private["_allowed","_object","_playername"];

    _object = _this select 0;

    _playername = _this select 1;

    _allowed = false;

    if ((typeOf _object) in dayz_allowedObjects) then {

            //diag_log format ["DEBUG: Object: %1 published by %2 is Safe",_object, _playername];

            _allowed = true;

    };

    _allowed

};

//event Handlers

eh_localCleanup = {

    private ["_object"];

    _object = _this select 0;

    _object addEventHandler ["local", {

        if(_this select 1) then {

            private["_type","_unit"];

            _unit = _this select 0;

            _type = typeOf _unit;

             _myGroupUnit = group _unit;

             _unit removeAllMPEventHandlers "mpkilled";

             _unit removeAllMPEventHandlers "mphit";

             _unit removeAllMPEventHandlers "mprespawn";

             _unit removeAllEventHandlers "FiredNear";

            _unit removeAllEventHandlers "HandleDamage";

            _unit removeAllEventHandlers "Killed";

            _unit removeAllEventHandlers "Fired";

            _unit removeAllEventHandlers "GetOut";

            _unit removeAllEventHandlers "GetIn";

            _unit removeAllEventHandlers "Local";

            clearVehicleInit _unit;

            deleteVehicle _unit;

            deleteGroup _myGroupUnit;

            //_unit = nil;

            diag_log ("CLEANUP: DELETED A " + str(_type) );

        };

    }];

};

server_hiveWrite = {

    private["_data"];

    _data = "HiveExt" callExtension _this;

};

server_hiveReadWrite = {

    private["_key","_resultArray","_data"];

    _key = _this;

    _data = "HiveExt" callExtension _key;

    _resultArray = call compile format ["%1",_data];

    _resultArray

};

server_hiveReadWriteLarge = {

    private["_key","_resultArray","_data"];

    _key = _this;

    _data = "HiveExt" callExtension _key;

    _resultArray = call compile _data;

    _resultArray

};

server_checkIfTowed = {

    private ["_vehicle","_player","_attached"];

    if (DZE_HeliLift) then {

        _vehicle =     _this select 0;

        _player =     _this select 2;

        _attached = _vehicle getVariable["attached",false];

        if ((typeName _attached == "OBJECT")) then {

            _player action ["eject", _vehicle];

            detach _vehicle;

            _vehicle setVariable["attached",false,true];

            _attached setVariable["hasAttached",false,true];

        };

    };

};

server_characterSync = {

    private ["_characterID","_playerPos","_playerGear","_playerBackp","_medical","_currentState","_currentModel","_key"];

    _characterID =     _this select 0;    

    _playerPos =    _this select 1;

    _playerGear =    _this select 2;

    _playerBackp =    _this select 3;

    _medical =         _this select 4;

    _currentState =    _this select 5;

    _currentModel = _this select 6;

    

    _key = format["CHILD:201:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:",_characterID,_playerPos,_playerGear,_playerBackp,_medical,false,false,0,0,0,0,_currentState,0,0,_currentModel,0];

    _key call server_hiveWrite;

};

if(isnil "dayz_MapArea") then {

    dayz_MapArea = 10000;

};

if(isnil "DynamicVehicleArea") then {

    DynamicVehicleArea = dayz_MapArea / 2;

};

// Get all buildings and roads only once TODO: set variables to nil after done if nessicary

MarkerPosition = getMarkerPos "center";

RoadList = MarkerPosition nearRoads DynamicVehicleArea;

// Very taxing !!! but only on first startup

BuildingList = [];

{

    if (DZE_MissionLootTable) then {

        if (isClass (missionConfigFile >> "CfgBuildingLoot" >> (typeOf _x))) then

        {

                BuildingList set [count BuildingList,_x];

        };

    } else {

        if (isClass (configFile >> "CfgBuildingLoot" >> (typeOf _x))) then

        {

            BuildingList set [count BuildingList,_x];

        };

    };

    

    

} forEach (MarkerPosition nearObjects ["building",DynamicVehicleArea]);

spawn_vehicles = {

    private ["_random","_lastIndex","_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];

    

    if (!isDedicated) exitWith { }; //Be sure the run this

    while {count AllowedVehiclesList > 0} do {

        // BIS_fnc_selectRandom replaced because the index may be needed to remove the element

        _index = floor random count AllowedVehiclesList;

        _random = AllowedVehiclesList select _index;

        _vehicle = _random select 0;

        _velimit = _random select 1;

        _qty = {_x == _vehicle} count serverVehicleCounter;

        // If under limit allow to proceed

        if (_qty <= _velimit) exitWith {};

        // vehicle limit reached, remove vehicle from list

        // since elements cannot be removed from an array, overwrite it with the last element and cut the last element of (as long as order is not important)

        _lastIndex = (count AllowedVehiclesList) - 1;

        if (_lastIndex != _index) then {

            AllowedVehiclesList set [_index, AllowedVehiclesList select _lastIndex];

        };

        AllowedVehiclesList resize _lastIndex;

    };

    if (count AllowedVehiclesList == 0) then {

        diag_log("DEBUG: unable to find suitable vehicle to spawn");

    } else {

        // add vehicle to counter for next pass

        serverVehicleCounter set [count serverVehicleCounter,_vehicle];

    

        // Find Vehicle Type to better control spawns

        _isAir = _vehicle isKindOf "Air";

        _isShip = _vehicle isKindOf "Ship";

    

        if(_isShip || _isAir) then {

            if(_isShip) then {

                // Spawn anywhere on coast on water

                waitUntil{!isNil "BIS_fnc_findSafePos"};

                _position = [MarkerPosition,0,DynamicVehicleArea,10,1,2000,1] call BIS_fnc_findSafePos;

                //diag_log("DEBUG: spawning boat near coast " + str(_position));

            } else {

                // Spawn air anywhere that is flat

                waitUntil{!isNil "BIS_fnc_findSafePos"};

                _position = [MarkerPosition,0,DynamicVehicleArea,10,0,2000,0] call BIS_fnc_findSafePos;

                //diag_log("DEBUG: spawning air anywhere flat " + str(_position));

            };

        

        

        } else {

            // Spawn around buildings and 50% near roads

            if((random 1) > 0.5) then {

            

                waitUntil{!isNil "BIS_fnc_selectRandom"};

                _position = RoadList call BIS_fnc_selectRandom;

            

                _position = _position modelToWorld [0,0,0];

            

                waitUntil{!isNil "BIS_fnc_findSafePos"};

                _position = [_position,0,10,10,0,2000,0] call BIS_fnc_findSafePos;

            

                //diag_log("DEBUG: spawning near road " + str(_position));

            

            } else {

            

                waitUntil{!isNil "BIS_fnc_selectRandom"};

                _position = BuildingList call BIS_fnc_selectRandom;

            

                _position = _position modelToWorld [0,0,0];

            

                waitUntil{!isNil "BIS_fnc_findSafePos"};

                _position = [_position,0,40,5,0,2000,0] call BIS_fnc_findSafePos;

            

                //diag_log("DEBUG: spawning around buildings " + str(_position));

        

            };

        };

        // only proceed if two params otherwise BIS_fnc_findSafePos failed and may spawn in air

        if ((count _position) == 2) then {

    

            _dir = round(random 180);

        

            _istoomany = _position nearObjects ["AllVehicles",50];

            if((count _istoomany) > 0) exitWith { diag_log("DEBUG: Too many vehicles at " + str(_position)); };

        

            //place vehicle

            _veh = createVehicle [_vehicle, _position, [], 0, "CAN_COLLIDE"];

            _veh setdir _dir;

            _veh setpos _position;        

            

            if(DZEdebug) then {

                _marker = createMarker [str(_position) , _position];

                _marker setMarkerShape "ICON";

                _marker setMarkerType "DOT";

                _marker setMarkerText _vehicle;

            };    

        

            // Get position with ground

            _objPosition = getPosATL _veh;

        

            clearWeaponCargoGlobal  _veh;

            clearMagazineCargoGlobal  _veh;

            // _veh setVehicleAmmo DZE_vehicleAmmo;

            // Add 0-3 loots to vehicle using random cfgloots

            _num = floor(random 4);

            _allCfgLoots = ["trash","civilian","food","generic","medical","military","policeman","hunter","worker","clothes","militaryclothes","specialclothes","trash"];

            

            for "_x" from 1 to _num do {

                _iClass = _allCfgLoots call BIS_fnc_selectRandom;

                _itemTypes = [];

                if (DZE_MissionLootTable) then {

                    _itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iClass)) select 0);

                } else {

                    _itemTypes = ((getArray (configFile >> "cfgLoot" >> _iClass)) select 0);

                };

                _index = dayz_CLBase find _iClass;

                _weights = dayz_CLChances select _index;

                _cntWeights = count _weights;

                

                _index = floor(random _cntWeights);

                _index = _weights select _index;

                _itemType = _itemTypes select _index;

                _veh addMagazineCargoGlobal [_itemType,1];

                //diag_log("DEBUG: spawed loot inside vehicle " + str(_itemType));

            };

            [_veh,[_dir,_objPosition],_vehicle,true,"0"] call server_publishVeh;

        };

    };

};

spawn_ammosupply = {

    private ["_position","_veh","_istoomany","_marker","_spawnveh","_WreckList"];

    if (isDedicated) then {

        _WreckList = ["Supply_Crate_DZE"];

        waitUntil{!isNil "BIS_fnc_selectRandom"};

        _position = RoadList call BIS_fnc_selectRandom;

        _position = _position modelToWorld [0,0,0];

        waitUntil{!isNil "BIS_fnc_findSafePos"};

        _position = [_position,5,20,5,0,2000,0] call BIS_fnc_findSafePos;

        if ((count _position) == 2) then {

            _istoomany = _position nearObjects ["All",5];

            

            if((count _istoomany) > 0) exitWith { diag_log("DEBUG VEIN: Too many at " + str(_position)); };

            

            _spawnveh = _WreckList call BIS_fnc_selectRandom;

            if(DZEdebug) then {

                _marker = createMarker [str(_position) , _position];

                _marker setMarkerShape "ICON";

                _marker setMarkerType "DOT";

                _marker setMarkerText str(_spawnveh);

            };

            

            _veh = createVehicle [_spawnveh,_position, [], 0, "CAN_COLLIDE"];

            _veh enableSimulation false;

            _veh setDir round(random 360);

            _veh setpos _position;

            _veh setVariable ["ObjectID","1",true];

        };

    };

};

DZE_LocalRoadBlocks = [];

spawn_roadblocks = {

    private ["_position","_veh","_istoomany","_marker","_spawnveh","_WreckList"];

    _WreckList = ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];

    

    waitUntil{!isNil "BIS_fnc_selectRandom"};

    if (isDedicated) then {

    

        _position = RoadList call BIS_fnc_selectRandom;

        

        _position = _position modelToWorld [0,0,0];

        

        waitUntil{!isNil "BIS_fnc_findSafePos"};

        _position = [_position,0,10,5,0,2000,0] call BIS_fnc_findSafePos;

        

        if ((count _position) == 2) then {

            // Get position with ground

            

            _istoomany = _position nearObjects ["All",5];

        

            if((count _istoomany) > 0) exitWith { diag_log("DEBUG: Too many at " + str(_position)); };

            

            waitUntil{!isNil "BIS_fnc_selectRandom"};

            _spawnveh = _WreckList call BIS_fnc_selectRandom;

            if(DZEdebug) then {

                _marker = createMarker [str(_position) , _position];

                _marker setMarkerShape "ICON";

                _marker setMarkerType "DOT";

                _marker setMarkerText str(_spawnveh);

            };

            _veh = createVehicle [_spawnveh,_position, [], 0, "CAN_COLLIDE"];

            _veh enableSimulation false;

            _veh setDir round(random 360); // Randomize placement a bit

            _veh setpos _position;

            _veh setVariable ["ObjectID","1",true];

        };

    

    };

    

};

spawn_mineveins = {

    private ["_position","_veh","_istoomany","_marker","_spawnveh","_positions"];

    if (isDedicated) then {

        

        _position = [getMarkerPos "center",0,(HeliCrashArea*0.75),10,0,2000,0] call BIS_fnc_findSafePos;

        if ((count _position) == 2) then {

            

            _positions = selectBestPlaces [_position, 500, "(1 + forest) * (1 + hills) * (1 - houses) * (1 - sea)", 10, 5];

            _position = (_positions call BIS_fnc_selectRandom) select 0;

            // Get position with ground

            _istoomany = _position nearObjects ["All",10];

        

            if((count _istoomany) > 0) exitWith { diag_log("DEBUG VEIN: Too many objects at " + str(_position)); };

            if(isOnRoad _position) exitWith { diag_log("DEBUG VEIN: on road " + str(_position)); };

            

            _spawnveh = ["Iron_Vein_DZE","Iron_Vein_DZE","Iron_Vein_DZE","Iron_Vein_DZE","Iron_Vein_DZE","Silver_Vein_DZE","Silver_Vein_DZE","Silver_Vein_DZE","Gold_Vein_DZE","Gold_Vein_DZE"] call BIS_fnc_selectRandom;

            if(DZEdebug) then {

                _marker = createMarker [str(_position) , _position];

                _marker setMarkerShape "ICON";

                _marker setMarkerType "DOT";

                _marker setMarkerText str(_spawnveh);

            };

            

            //diag_log("DEBUG: Spawning a crashed " + _spawnveh + " with " + _spawnloot + " at " + str(_position));

            _veh = createVehicle [_spawnveh,_position, [], 0, "CAN_COLLIDE"];

            _veh enableSimulation false;

            // Randomize placement a bit

            _veh setDir round(random 360);

            _veh setpos _position;

            _veh setVariable ["ObjectID","1",true];

        

        };

    };

};

if(isnil "DynamicVehicleDamageLow") then {

    DynamicVehicleDamageLow = 0;

};

if(isnil "DynamicVehicleDamageHigh") then {

    DynamicVehicleDamageHigh = 100;

};

if(isnil "DynamicVehicleFuelLow") then {

    DynamicVehicleFuelLow = 0;

};

if(isnil "DynamicVehicleFuelHigh") then {

    DynamicVehicleFuelHigh = 100;

};

if(isnil "DZE_DiagFpsSlow") then {

    DZE_DiagFpsSlow = false;

};

if(isnil "DZE_DiagFpsFast") then {

    DZE_DiagFpsFast = false;

};

if(isnil "DZE_DiagVerbose") then {

    DZE_DiagVerbose = false;

};

dze_diag_fps = {

    if(DZE_DiagVerbose) then {

        diag_log format["DEBUG FPS : %1 OBJECTS: %2 : PLAYERS: %3", diag_fps,(count (allMissionObjects "")),(playersNumber west)];

    } else {

        diag_log format["DEBUG FPS : %1", diag_fps];

    };

};

// Damage generator function

generate_new_damage = {

    private ["_damage"];

    _damage = ((random(DynamicVehicleDamageHigh-DynamicVehicleDamageLow))+DynamicVehicleDamageLow) / 100;

    _damage;

};

// Damage generator fuction

generate_exp_damage = {

    private ["_damage"];

    _damage = ((random(DynamicVehicleDamageHigh-DynamicVehicleDamageLow))+DynamicVehicleDamageLow) / 100;

    

    // limit this to 85% since vehicle would blow up otherwise.

    //if(_damage >= 0.85) then {

    //    _damage = 0.85;

    //};

    _damage;

};

server_getDiff =    {

    private["_variable","_object","_vNew","_vOld","_result"];

    _variable = _this select 0;

    _object =     _this select 1;

    _vNew =     _object getVariable[_variable,0];

    _vOld =     _object getVariable[(_variable + "_CHK"),_vNew];

    _result =     0;

    if (_vNew < _vOld) then {

        //JIP issues

        _vNew = _vNew + _vOld;

        _object getVariable[(_variable + "_CHK"),_vNew];

    } else {

        _result = _vNew - _vOld;

        _object setVariable[(_variable + "_CHK"),_vNew];

    };

    _result

};

server_getDiff2 =    {

    private["_variable","_object","_vNew","_vOld","_result"];

    _variable = _this select 0;

    _object =     _this select 1;

    _vNew =     _object getVariable[_variable,0];

    _vOld =     _object getVariable[(_variable + "_CHK"),_vNew];

    _result = _vNew - _vOld;

    _object setVariable[(_variable + "_CHK"),_vNew];

    _result

};

dayz_objectUID = {

    private["_position","_dir","_key","_object"];

    _object = _this;

    _position = getPosATL _object;

    _dir = direction _object;

    _key = [_dir,_position] call dayz_objectUID2;

    _key

};

dayz_objectUID2 = {

    private["_position","_dir","_key"];

    _dir = _this select 0;

    _key = "";

    _position = _this select 1;

    {

        _x = _x * 10;

        if ( _x < 0 ) then { _x = _x * -10 };

        _key = _key + str(round(_x));

    } forEach _position;

    _key = _key + str(round(_dir));

    _key

};

dayz_objectUID3 = {

    private["_position","_dir","_key"];

    _dir = _this select 0;

    _key = "";

    _position = _this select 1;

    {

        _x = _x * 10;

        if ( _x < 0 ) then { _x = _x * -10 };

        _key = _key + str(round(_x));

    } forEach _position;

    _key = _key + str(round(_dir + time));

    _key

};

dayz_recordLogin = {

    private["_key"];

    _key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2];

    _key call server_hiveWrite;

};

dayz_perform_purge = {

    if(!isNull(_this)) then {

        _this removeAllMPEventHandlers "mpkilled";

        _this removeAllMPEventHandlers "mphit";

        _this removeAllMPEventHandlers "mprespawn";

        _this removeAllEventHandlers "FiredNear";

        _this removeAllEventHandlers "HandleDamage";

        _this removeAllEventHandlers "Killed";

        _this removeAllEventHandlers "Fired";

        _this removeAllEventHandlers "GetOut";

        _this removeAllEventHandlers "GetIn";

        _this removeAllEventHandlers "Local";

        clearVehicleInit _this;

        deleteVehicle _this;

        deleteGroup (group _this);

    };

};

dayz_perform_purge_player = {

    private ["_countr","_backpack","_backpackType","_backpackWpn","_backpackMag","_objWpnTypes","_objWpnQty","_location","_dir","_holder","_weapons","_magazines"];

    diag_log ("Purging player: " + str(_this));    

    if(!isNull(_this)) then {

        _location = getPosATL _this;

        _dir = getDir _this;

        _holder = createVehicle ["GraveDZE", _location, [], 0, "CAN_COLLIDE"];

        _holder setDir _dir;

        _holder setPosATL _location;

        _holder enableSimulation false;

        _weapons = weapons _this;

        _magazines = magazines _this;

        // find backpack

        if(!(isNull unitBackpack _this)) then {

            _backpack = unitBackpack _this;

            _backpackType = typeOf _backpack;

            _backpackWpn = getWeaponCargo _backpack;

            _backpackMag = getMagazineCargo _backpack;

            _holder addBackpackCargoGlobal [_backpackType,1];

            // add items from backpack

            _objWpnTypes = _backpackWpn select 0;

            _objWpnQty = _backpackWpn select 1;

            _countr = 0;

            {

                _holder addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];

                _countr = _countr + 1;

            } forEach _objWpnTypes;

            // add backpack magazine items

            _objWpnTypes = _backpackMag select 0;

            _objWpnQty = _backpackMag select 1;

            _countr = 0;

            {

                _holder addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];

                _countr = _countr + 1;

            } forEach _objWpnTypes;

        };

    };

    // add weapons

    {

        _holder addWeaponCargoGlobal [_x, 1];

    } forEach _weapons;

    // add mags

    {

        _holder addMagazineCargoGlobal [_x, 1];

    } forEach _magazines;

    _this removeAllMPEventHandlers "mpkilled";

    _this removeAllMPEventHandlers "mphit";

    _this removeAllMPEventHandlers "mprespawn";

    _this removeAllEventHandlers "FiredNear";

    _this removeAllEventHandlers "HandleDamage";

    _this removeAllEventHandlers "Killed";

    _this removeAllEventHandlers "Fired";

    _this removeAllEventHandlers "GetOut";

    _this removeAllEventHandlers "GetIn";

    _this removeAllEventHandlers "Local";

    clearVehicleInit _this;

    deleteVehicle _this;

    deleteGroup (group _this);

    //  _this = nil;

};

dayz_removePlayerOnDisconnect = {

    if(!isNull(_this)) then {

        _this removeAllMPEventHandlers "mphit";

        deleteVehicle _this;

        deleteGroup (group _this);

    };

};

server_timeSync = {

    //Send request

    private ["_hour","_minute","_date","_key","_result","_outcome"];

    _key = "CHILD:307:";

    _result = _key call server_hiveReadWrite;

    _outcome = _result select 0;

    if(_outcome == "PASS") then {

        _date = _result select 1;

        

        if(dayz_fullMoonNights) then {

            _hour = _date select 3;

            _minute = _date select 4;

            //Force full moon nights

            _date = [2013,8,3,_hour,_minute];

        };

        setDate _date;

        PVDZE_plr_SetDate = _date;

        publicVariable "PVDZE_plr_SetDate";

        diag_log ("TIME SYNC: Local Time set to " + str(_date));    

    };

};

// must spawn these

server_spawncleanDead = {

    private ["_deathTime","_delQtyZ","_delQtyP","_qty","_allDead"];

    _allDead = allDead;

    _delQtyZ = 0;

    _delQtyP = 0;

    {

        if (local _x) then {

            if (_x isKindOf "zZombie_Base") then

            {

                _x call dayz_perform_purge;

                sleep 0.05;

                _delQtyZ = _delQtyZ + 1;

            } else {

                if (_x isKindOf "CAManBase") then {

                    _deathTime = _x getVariable ["processedDeath", diag_tickTime];

                    if (diag_tickTime - _deathTime > 1800) then {

                        _x call dayz_perform_purge_player;

                        sleep 0.025;

                        _delQtyP = _delQtyP + 1;

                    };

                };

            };

        };

        sleep 0.025;

    } forEach _allDead;

    if (_delQtyZ > 0 or _delQtyP > 0) then {

        _qty = count _allDead;

        diag_log (format["CLEANUP: Deleted %1 players and %2 zombies out of %3 dead",_delQtyP,_delQtyZ,_qty]);

    };

};

server_cleanupGroups = {

    if (DZE_DYN_AntiStuck3rd > 3) then { DZE_DYN_GroupCleanup = nil; DZE_DYN_AntiStuck3rd = 0; };

    if(!isNil "DZE_DYN_GroupCleanup") exitWith {  DZE_DYN_AntiStuck3rd = DZE_DYN_AntiStuck3rd + 1;};

    DZE_DYN_GroupCleanup = true;

    {

        if (count units _x == 0) then {

            deleteGroup _x;

        };

        sleep 0.001;

    } forEach allGroups;

    DZE_DYN_GroupCleanup = nil;

};

server_checkHackers = {

    if (DZE_DYN_AntiStuck2nd > 3) then { DZE_DYN_HackerCheck = nil; DZE_DYN_AntiStuck2nd = 0; };

    if(!isNil "DZE_DYN_HackerCheck") exitWith {  DZE_DYN_AntiStuck2nd = DZE_DYN_AntiStuck2nd + 1;};

    DZE_DYN_HackerCheck = true;

    {

        //if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle)) then {

if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x)  && !((typeOf vehicle _x) in DZE_safeVehicle) && (vehicle _x getVariable ["MalSar",0] !=1)) then {

            diag_log ("CLEANUP: KILLING A HACKER " + (name _x) + " " + str(_x) + " IN " + (typeOf vehicle _x));

            (vehicle _x) setDamage 1;

            _x setDamage 1;

            sleep 0.25;

        };

        sleep 0.001;

    } forEach allUnits;

    DZE_DYN_HackerCheck = nil;

};

server_spawnCleanFire = {

    private ["_delQtyFP","_qty","_delQtyNull","_missionFires"];

    _missionFires = allMissionObjects "Land_Fire_DZ";

    _delQtyFP = 0;

    {

        if (local _x) then {

            deleteVehicle _x;

            sleep 0.025;

            _delQtyFP = _delQtyFP + 1;

        };

        sleep 0.001;

    } forEach _missionFires;

    if (_delQtyFP > 0) then {

        _qty = count _missionFires;

        diag_log (format["CLEANUP: Deleted %1 fireplaces out of %2",_delQtyNull,_qty]);

    };

};

server_spawnCleanLoot = {

    private ["_created","_delQty","_nearby","_age","_keep","_qty","_missionObjs","_dateNow"];

    if (DZE_DYN_AntiStuck > 3) then { DZE_DYN_cleanLoot = nil; DZE_DYN_AntiStuck = 0; };

    if(!isNil "DZE_DYN_cleanLoot") exitWith {  DZE_DYN_AntiStuck = DZE_DYN_AntiStuck + 1;};

    DZE_DYN_cleanLoot = true;

    _missionObjs =  allMissionObjects "ReammoBox";

    _delQty = 0;

    _dateNow = (DateToNumber date);

    {

        _keep = _x getVariable ["permaLoot",false];

        if (!_keep) then {

            _created = _x getVariable ["created",-0.1];

            if (_created == -0.1) then {

                _x setVariable ["created",_dateNow,false];

                _created = _dateNow;

            } else {

                _age = (_dateNow - _created) * 525948;

                if (_age > 20) then {

                    _nearby = {(isPlayer _x) and (alive _x)} count (_x nearEntities [["CAManBase","AllVehicles"], 130]);

                    if (_nearby==0) then {

                        deleteVehicle _x;

                        sleep 0.025;

                        _delQty = _delQty + 1;

                    };

                };

            };

        };

        sleep 0.001;

    } forEach _missionObjs;

    if (_delQty > 0) then {

        _qty = count _missionObjs;

        diag_log (format["CLEANUP: Deleted %1 Loot Piles out of %2",_delQty,_qty]);

    };

    DZE_DYN_cleanLoot = nil;

};

server_spawnCleanAnimals = {

    private ["_pos","_delQtyAnimal","_qty","_missonAnimals","_nearby"];

    _missonAnimals = entities "CAAnimalBase";

    _delQtyAnimal = 0;

    {

        if (local _x) then {

            _x call dayz_perform_purge;

            sleep 0.05;

            _delQtyAnimal = _delQtyAnimal + 1;

        } else {

            if (!alive _x) then {

                _pos = getPosATL _x;

                if (count _pos > 0) then {

                    _nearby = {(isPlayer _x) and (alive _x)} count (_pos nearEntities [["CAManBase","AllVehicles"], 130]);

                    if (_nearby==0) then {

                        _x call dayz_perform_purge;

                        sleep 0.05;

                        _delQtyAnimal = _delQtyAnimal + 1;

                    };

                };

            };

        };

        sleep 0.001;

    } forEach _missonAnimals;

    if (_delQtyAnimal > 0) then {

        _qty = count _missonAnimals;

        diag_log (format["CLEANUP: Deleted %1 Animals out of %2",_delQtyAnimal,_qty]);

    };

};

server_getLocalObjVars = {

    private ["_player","_obj","_objectID","_objectUID","_weapons","_magazines","_backpacks"];

    _player = _this select 0;

    _obj = _this select 1;

    _objectID     = _obj getVariable["ObjectID","0"];

    _objectUID    = _obj getVariable["ObjectUID","0"];

    _weapons = _obj getVariable ["WeaponCargo", false];

    _magazines = _obj getVariable ["MagazineCargo", false];

    _backpacks = _obj getVariable ["BackpackCargo", false];

    PVDZE_localVarsResult = [_weapons,_magazines,_backpacks];

    (owner _player) publicVariableClient "PVDZE_localVarsResult";

    

    diag_log format["SAFE UNLOCKED: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player)];

};

server_setLocalObjVars = {

    private ["_obj","_holder","_weapons","_magazines","_backpacks","_player","_objectID","_objectUID"];

    _obj = _this select 0;

    _holder = _this select 1;

    _player = _this select 2;

    _objectID     = _obj getVariable["ObjectID","0"];

    _objectUID    = _obj getVariable["ObjectUID","0"];

    _weapons =         getWeaponCargo _obj;

    _magazines =     getMagazineCargo _obj;

    _backpacks =     getBackpackCargo _obj;

    

    deleteVehicle _obj;

    _holder setVariable ["WeaponCargo", _weapons];

    _holder setVariable ["MagazineCargo", _magazines];

    _holder setVariable ["BackpackCargo", _backpacks];

    

    diag_log format["SAFE LOCKED: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player)];

};

 

 

server_updateObject.sqf

/*

[_object,_type] spawn server_updateObject;

*/

private ["_object","_type","_objectID","_uid","_lastUpdate","_needUpdate","_object_position","_object_inventory","_object_damage","_isNotOk","_parachuteWest","_firstTime","_object_killed","_object_repair","_isbuildable"];

_object =     _this select 0;

if(isNull(_object)) exitWith {

    diag_log format["Skipping Null Object: %1", _object];

};

_type =     _this select 1;

_parachuteWest = ((typeOf _object == "ParachuteWest") or (typeOf _object == "ParachuteC"));

_isbuildable = (typeOf _object) in dayz_allowedObjects;

_isNotOk = false;

_firstTime = false;

_objectID =    _object getVariable ["ObjectID","0"];

_uid =         _object getVariable ["ObjectUID","0"];

if ((typeName _objectID != "string") || (typeName _uid != "string")) then

{

    diag_log(format["Non-string Object: ID %1 UID %2", _objectID, _uid]);

    //force fail

    _objectID = "0";

    _uid = "0";

};

if (_object getVariable "MalSar" == 1) exitWith {};

if (!_parachuteWest and !(locked _object)) then {

    if (_objectID == "0" && _uid == "0") then

    {

        _object_position = getPosATL _object;

        _isNotOk = true;

    };

};

// do not update if buildable and not ok

if (_isNotOk and _isbuildable) exitWith {  };

// delete if still not ok

if (_isNotOk) exitWith { deleteVehicle _object; diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",typeOf _object,_object_position select 0,_object_position select 1, _object_position select 2]); };

_lastUpdate = _object getVariable ["lastUpdate",time];

_needUpdate = _object in needUpdate_objects;

// TODO ----------------------

_object_position = {

    private["_position","_worldspace","_fuel","_key"];

        _position = getPosATL _object;

        _worldspace = [

            round(direction _object),

            _position

        ];

        _fuel = 0;

        if (_object isKindOf "AllVehicles") then {

            _fuel = fuel _object;

        };

        _key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];

        //diag_log ("HIVE: WRITE: "+ str(_key));

        _key call server_hiveWrite;

};

_object_inventory = {

    private["_inventory","_previous","_key"];

        _inventory = [

            getWeaponCargo _object,

            getMagazineCargo _object,

            getBackpackCargo _object

        ];

        _previous = str(_object getVariable["lastInventory",[]]);

        if (str(_inventory) != _previous) then {

            _object setVariable["lastInventory",_inventory];

            if (_objectID == "0") then {

                _key = format["CHILD:309:%1:%2:",_uid,_inventory];

            } else {

                _key = format["CHILD:303:%1:%2:",_objectID,_inventory];

            };

            //diag_log ("HIVE: WRITE: "+ str(_key));

            _key call server_hiveWrite;

        };

};

_object_damage = {

    private["_hitpoints","_array","_hit","_selection","_key","_damage"];

        _hitpoints = _object call vehicle_getHitpoints;

        _damage = damage _object;

        _array = [];

        {

            _hit = [_object,_x] call object_getHit;

            _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");

            if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};

            _object setHit ["_selection", _hit]

        } forEach _hitpoints;

    

        _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];

        //diag_log ("HIVE: WRITE: "+ str(_key));

        _key call server_hiveWrite;

    _object setVariable ["needUpdate",false,true];

    };

_object_killed = {

    private["_hitpoints","_array","_hit","_selection","_key","_damage"];

    _hitpoints = _object call vehicle_getHitpoints;

    //_damage = damage _object;

    _damage = 1;

    _array = [];

    {

        _hit = [_object,_x] call object_getHit;

        _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");

        if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};

        _hit = 1;

        _object setHit ["_selection", _hit]

    } forEach _hitpoints;

    

    if (_objectID == "0") then {

        _key = format["CHILD:306:%1:%2:%3:",_uid,_array,_damage];

    } else {

        _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];

    };

    //diag_log ("HIVE: WRITE: "+ str(_key));

    _key call server_hiveWrite;

    _object setVariable ["needUpdate",false,true];

};

_object_repair = {

    private["_hitpoints","_array","_hit","_selection","_key","_damage"];

    _hitpoints = _object call vehicle_getHitpoints;

    _damage = damage _object;

    _array = [];

    {

        _hit = [_object,_x] call object_getHit;

        _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name");

        if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};

        _object setHit ["_selection", _hit]

    } forEach _hitpoints;

    

    _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage];

    //diag_log ("HIVE: WRITE: "+ str(_key));

    _key call server_hiveWrite;

    _object setVariable ["needUpdate",false,true];

};

// TODO ----------------------

_object setVariable ["lastUpdate",time,true];

switch (_type) do {

    case "all": {

        call _object_position;

        call _object_inventory;

        call _object_damage;

        };

    case "position": {

        if (!(_object in needUpdate_objects)) then {

            //diag_log format["DEBUG Position: Added to NeedUpdate=%1",_object];

            needUpdate_objects set [count needUpdate_objects, _object];

        };

    };

    case "gear": {

        call _object_inventory;

            };

    case "damage": {

        if ( (time - _lastUpdate) > 5) then {

            call _object_damage;

        } else {

            if (!(_object in needUpdate_objects)) then {

                //diag_log format["DEBUG Damage: Added to NeedUpdate=%1",_object];

                needUpdate_objects set [count needUpdate_objects, _object];

            };

        };

    };

    case "killed": {

        call _object_killed;

    };

    case "repair": {

        call _object_damage;

    };

};

 

 

Thank you kindly...

 

Do you use any extra mods? If not use these files: https://www.dropbox.com/sh/vjqkabisrg9vmq2/M85nb_O1oZ

 

Those files are already set up from a clean server build so it should work. The only thing they have in them is the stuff for admin tools.

Link to comment
Share on other sites

I am using the adminlist.sqf but it appears I still have the ID's in my init.sqf without the third array.

 

If you are using the AdminList.sqf then delete the lists from your init. You only need to use one or the other. So long as you are calling AdminList.sqf in the init.sqf teleporting players will work.

Link to comment
Share on other sites

Minor Update!

 

Bug Fix:

  • Infinite ammo now toggles correctly.
  • Enhanced ESP has reduced lag.

 

Download Now

 

 

 

ALSO:

I am now using the Releases function of github. When we believe the tool is at a necessary point where you should update to the new version we will create a new release so that everyone knows and you don't end up with some small bugs that still need to be worked out if you are hosting a server with a large player base. If you do not have a large player base on your server or you have a test server in which you would like to use the minor updates on please do. EVERY bug report helps us make these tools what they are and it is impossible for two people to test every function of the tool after each update. This release system is just a way to help keep large bug issues out of a populated server so it does not mess with those who absolutely need these tools to function.

 

Releases can be found at:

 https://github.com/gregariousjb/Epoch-Admin-Tools/releases

 

I have already posted two releases, v1.0 is the tool BEFORE admin mode and mod mode were created. v1.5 is the latest commit and includes this minor update. It is nearly bug free and will work fine for all server needs. 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...