ok so here goes....
step 1
in your server pbo you will find your serverFunctions.sqf(note yours may be named slightly diff if its dayz, maybe server_functions.sqf idk)
in this file you want to code this(rem this is only the nuke codes so you may have other code in and around this)
Code:
waituntil {!isnil "bis_fnc_init"};
server_nukeLauncher = compile preprocessFileLineNumbers "\jDay_server\compile\nukeLauncher.sqf";
step 2
same as step 1 but this file will be your serverMonitor.sqf(or w/e yours is server_monitor.sqf idk its your files

)
so we want to make it look like this
Code:
waitUntil{initialized}; //means all the functions are now defined
if (isServer) then {
null = [] spawn server_nukeLauncher;
//null = [] spawn server_portalSpawner;
null = [] spawn server_spawnC130CrashSite;
};
now rem that this is my mod im developing so anything not nuke related just take as a place identifier for your files. The initialzed comes from the init compiles i load in my mission init.sqf(that should make sense

) For those of us that over ride the compiles and variables for dayz mods this is understood. If not you may want to come join my very slim dev team so i can train you and you can make some awesome stuffs 8) thats another story tho
ok so now we have the server nuke portion setup with a pre compiled varibale right? right....
step 3
now we are going to the actual nukeLauncher.sqf and we copy this into the file( or make a new one idk its your files

)
Code:
private ["_minTime","_randomTime","_nukeTimer","_coords","_rad","_cnps","_towns","_townnumber","_townName","_townPos","_nukePad","_locNuke"];
while {true} do {
_minTime = 2800;
_randomTime = random 800;
_nukeTimer = ((_minTime) + (_randomTime)); // How long for nuke to sleep before next explosion
//_coords = [[],0,-1,20,0,20,0] call BIS_fnc_findSafePos;
/*
_nukeMarkerG = createMarker ["nukeMarkerG", _coords];
_nukeMarkerG setMarkerColor "ColorGreen";
_nukeMarkerG setMarkerShape "ELLIPSE";
_nukeMarkerG setMarkerBrush "Grid";
_nukeMarkerG setMarkerSize [1500,1500];
_nukeMarkerO = createMarker ["nukeMarkerO", _coords];
_nukeMarkerO setMarkerColor "ColorOrange";
_nukeMarkerO setMarkerShape "ELLIPSE";
_nukeMarkerO setMarkerBrush "Grid";
_nukeMarkerO setMarkerSize [1200,1200];
_nukeMarkerR = createMarker ["nukeMarkerR", _coords];
_nukeMarkerR setMarkerColor "ColorRed";
_nukeMarkerR setMarkerShape "ELLIPSE";
_nukeMarkerR setMarkerBrush "Grid";
_nukeMarkerR setMarkerSize [800,800];
*/
_rad=20000;
_cnps = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
townlistserver= nearestLocations [_cnps, ["nameCity","nameVillage"], _rad];
_towns= townlistserver;
if ((count _towns) != 0) then {
_townnumber = floor (random (count _towns));
_townName = _towns select _townnumber;
_townPos = (position _townName);
};
sleep 3;
_nukePad = createVehicle ["Land_HelipadEmpty_F", _townPos,[], 0, "NONE"];
_locNuke = "nukepos";
_nukePad setVehicleVarName _locNuke;
_nukePad call compile format ["%1=_This ; PublicVariable ""%1""",_locNuke];
sleep 3;
nukeGo = true;
publicVariable "nukeGo";
diag_log format ["Cyberdyne Systems: Nuke Launcher: Sleeping for %1 seconds",_nukeTimer];
sleep _nukeTimer;
//deleteMarker "nukeMarkerR";
sleep 3;
//deleteMarker "nukeMarkerO";
sleep 3;
//deleteMarker "nukeMarkerG";
//sleep 3;
deleteVehicle _nukePad;
};
please always double, triple and fanatically check file pathways......must must must do this always o.0
This file will run by the server and it will choose a city randomly. The city is then marked with an invisi heli pad and the pad is then marked with a public variable. This is how the splosion will know where to splode(get it?

)
Are we done with the server pbo? Yes....i think, i was wrong once before....just once though
step 4
in your mission pbo you will now need to place all of your nuke files to be run globally...this **** is exhausting sometimes lol
in your init.sqf code we should all be familiar with the if (!isDedicated then { portion right? Right....
so what i do since i am dev my own mod is i run a clientInit.sqf within the if (!isDedicated) then portion liek this
Code:
/* Run Only on Client */
if(!isDedicated) then {
[] execVM "\jDay_code\init\clientInit.sqf";
waitUntil {player == player};
_EHkilled = player addEventHandler ["killed", {_this spawn jDay_playerDeath_fnc}];
};
all you need is the clientInit.sqf the other lines are from the mod im dev. I really doint care if you use anything i post either. Just plx dont claim somethign that isnt yours even if you dont give credit. I dont and i hope you all wont as well 8)
step 5
the clientInit.sqf i keep in my addon, thats just how i roll. You can put this in the mission too i think, lots of options here...
Code:
if (isDedicated) exitWith {};
/* Load Database */
[] execVM "\jDay_code\system\functions\statSave\loadAccount.sqf";
/* Atomic Explosions */
[] execVM "\jDay_code\system\clientEvents\nukeMonitor.sqf";
notice the path leads to my addon. Like i mentioned before, this can be altered(its all your code anyways 8))
step 6
nukeMonitor.sqf is also in my addon
Code:
while {true} do {
nukeGo = false;
sleep 1;
waitUntil {nukeGo};
// COLORCORRECTION
execVM "system\nuke\jDay_colorcorrection.sqf";
_ticker = 60;
while {_ticker >= 0} do {
//titleText [format["Radio: Impact in %1 in seconds.", _ticker], "PLAIN DOWN"];
_ticker = _ticker - 1;
sleep 1;
};
_distancePlayer = player distance nukepos;
if (_distancePlayer <= 2000) then {
[] execVM "system\nuke\nuke.sqf";
0 fadeMusic 1;
playSound "nuke";
15 fadeMusic 0;
} else {
// COLORCORRECTION
execVM "system\nuke\jDaycolorcorrection.sqf";
};
};
im a little -.- right now too so sorry if i get something wrong lol
this file is going to run on the client always, however; it will wait till the public variable is set by the server(rem the server files?)
when the cycle is done it will restart and reset...the variable to false to make it wait once more until the server is ready again.
this is now the point where you will use whatever nuke scripts you choose to use, i use someone elses and i cannot rightfully post his work without at least asking first. From here it should be pretty obvious how to path these files out to the desired nuke mod.
I believe thats it, if you see something wrong or w/e please let me know 8)