If you dont want to use: http://opendayz.net/threads/release-essv2-enhanced-spawn-selection-v2.21547/
As you want a random spawn location for player who join your server just like me.
One thing to notice is that i didn't test this without anti-hack. ( I've used infistar on server side with a reason. PM me if you want to know that reason and why i did it in this specific way. )
Without Antihack on server side* NOT TESTED, NEED RESPONSE IF WORKS OR SOLUTION! :
First add this in init:
execVM "Custom\loadout.sqf";
Above:
dayz_paraSpawn = false; // Halo spawn
DZE_BackpackAntiTheft = false; // Prevent stealing from backpacks in trader zones
in Custom\loadout.sqf:
//change loadout on spawn,
// added by: Stijnkluiters github: https://github.com/stijnkluiters
// default array = [
//"ItemBandage",
//"ItemBandage",
//"17Rnd_9x19_glock17",
//"17Rnd_9x19_glock17",
//"ItemMorphine",
private ["_isHero","_humanity","_isBandit"];
_humanity = player getVariable["humanity",0]; // This is where my own server failed because of my anti-hack
_isBandit = _humanity < -5000;
_isHero = _humanity > 5000;
if (_isHero) then {
//hero
diag_log format["LOADOUT: Hero"];
DefaultMagazines = ["ItemMap","HandRoadFlare","ItemBandage","ItemPainkiller","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov"];
DefaultWeapons = ["Makarov_DZ","ItemFlashlight"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackItems = []; // Can include both weapons and magazines i.e. ["PDW_DZ","30Rnd_9x19_UZI"];
};
if (_isBandit) then {
//bndit
diag_log format["LOADOUT: Bandit"];
DefaultMagazines = ["ItemMap","HandRoadFlare","ItemBandage","ItemPainkiller","8Rnd_9x18_Makarov","8Rnd_9x18_Makarov"];
DefaultWeapons = ["Makarov_DZ","ItemFlashlight"];
DefaultBackpack = "DZ_Patrol_Pack_EP1";
DefaultBackpackItems = []; // Can include both weapons and magazines i.e. ["PDW_DZ","30Rnd_9x19_UZI"];
};
With Antihack on server side* TESTED, WORKS! :
Go to /z/addons/dayz_server/compile/server_playerLogin.sqf
And add:
"_primcharvar",
"_humanity"
// Line 1 in code.
to private[];
after doing so.
Add this:
//Do Connection Attempt
// humanity
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:102:%1:",_charID];
_primcharvar = _key call server_hiveReadWrite;
if (count _primcharvar > 0) then {
if ((_primcharvar select 0) != "ERROR") then {
_doLoop = 9;
};
};
_doLoop = _doLoop + 1;
};
_humanity = _primcharvar select 5;
after:
DRUGS
Before star... you should add this items into your traders menus.
1.Create this path: mpmissions\your instance\scripts\drugs\
2-Create the sqfs into the new path.
3.Now you need extra_rc.hpp or deploy anything mod.
4.Now we gonna create an epoch event to spawn weed fields.
Now this is optional... since i do not use road blocks for anything... i just change it by weed plants.. so if u wanna do the same:
1-Open spawn_roadblocks.sqf located in dayz_server\compile\
then change this line:
_spawnveh = DZE_isWreck call BIS_fnc_selectRandom;
by:
_spawnveh = "Fiberplant";
2-open your init.sqf find this line to manage the amount of fiber plants spawned.
MaxDynamicDebris = 20; // was changed by juandayz to spawn fiberplants
Optional too. Create a police Drugs check point. (if player cross that check point with drugs police gonna remove it)
You will need create the map addon.. i just give you the code for remove drugs.
heres where fn_selfactions define when you can remove
this part only allow to remove if the object is a :
for everyone:
_isDestructable
DZE_isWreck
DZE_isWreckBuilding
DZE_isRemovable
for owners:
_isModular
_isModularDoor
_isGenerator
DZE_isDestroyableStorage
so heres is the defines for each variables,,
so looking it. the only place where youre object can be defined is in builtItems or ModularItems.. not sure but dont think you gonna find your object here.. so to start to test you can try it:
you will need a custom fn_selfactions.sqf
below:
_isGenerator = _cursorTarget isKindOf "Generator_DZ";
paste:
_nonremovable = _cursorTarget isKindOf "MetalFence_7";
below :
if (_isAlive) then {
paste
if (_nonremovable) then {
_player_deleteBuild = false;
};