Hi there,
as it was a while I posted something here in the forums, I start with something simple.
Much people know nowadays how to add own MapAddtions like new Houses and stuff like that on your DayZ Server, but if you put everything in your missionfile (in your mission.sqm or in a script which is the missionfile) it can be easily stolen from others.
This is a big problem cause everything whats in your missionfile is available for everyone who can play on your server.
Now how can we prevent that your stuff is going to be used without permission?
Here is my tutorial in 3 Steps!
Step 1 - Make your spawning script
====== ====================
You need your custom buildings as a script for spawning, but as long as you have your saves from the editor there is no problem to create this.
You just need to follow this guide
http://dayzepoch.com/forum/index.php?/topic/12-custom-buildings/page-2#entry1403
untill you get to these step
Don't do that and you're fine
You should have now a script with only commands like these
Step 2 - Put your script into your server.pbo
====== =============================
You need a tool to unpack .pbo files (e. g. http://www.armaholic.com/page.php?id=16369)
Then you go for your server folder, for my case its called "@DayZ_Epoch_Server". In this folder you open the addons folder and unpack your server.pbo. Afterwards delete or move your server.pbo to anywhere else.
Now open the new folder of your unpacking server.pbo files and open the init folder. There should be a script called like server_functions.sqf.
Open this one and search at the beginning for a code block like this one
Underneath these block you copy & paste these code line:
After that you save your new server_functions.sqf and quit it.
Then you'll have to open the compile folder instead of the init folder. Now we need our script out of Step 1. Copy and paste it in and rename to "server_spawnCustomBuildings.sqf" without " ".
Now you can go back to the directory where your old server.pbo was and repack the unpacked folder back to .pbo format.
Its important that your old server.pbo isn't present there anymore and is called like it was called before.
Step 3 - Calling of your script in the missionfile
====== ============================
The major part is done now. We only need to add the call into the missionfile.
For that go to your MPMissions folder inside your server. There are two possible cases
Case1: There is a folder in it and no .pbo then skip Case2
Case2: There is a .pbo and no folder, so you got to unpack it and delete the old packed .pbo again (in contrast to the server.pbo it isn't needed to pack your missionfile)
Now open your folder inside the MPMissions and open the init.sqf.
Add at the end the following:
Now save your init.sqf and start your server. Your buildings should spawn as usual and cannot be copied anymore cause all buildings and their positions are stored in the server.pbo which is never passed to the clients.
If you have multiple different Additions you naturally can do the same steps again and just rename the names.
This is also very good to handle cause if you don't want to spawn the part anymore you can comment it out or delete the call inside the init.sqf and it will no longer spawn. If you need it again paste it in again.
I hope this helps some people, have fun with your safe Map Additions!
Regards
kikyou2
as it was a while I posted something here in the forums, I start with something simple.
Much people know nowadays how to add own MapAddtions like new Houses and stuff like that on your DayZ Server, but if you put everything in your missionfile (in your mission.sqm or in a script which is the missionfile) it can be easily stolen from others.
This is a big problem cause everything whats in your missionfile is available for everyone who can play on your server.
Now how can we prevent that your stuff is going to be used without permission?
Here is my tutorial in 3 Steps!
Step 1 - Make your spawning script
====== ====================
You need your custom buildings as a script for spawning, but as long as you have your saves from the editor there is no problem to create this.
You just need to follow this guide
http://dayzepoch.com/forum/index.php?/topic/12-custom-buildings/page-2#entry1403
untill you get to these step
etc etc..
Add those objects left between this simple code in a new text doc editor
Don't do that and you're fine
You should have now a script with only commands like these
_vehicle_0 = objNull;
if (true) then
{
_this = createVehicle ["Land_Ind_Timbers", [4254.3887, 10755.609], [], 0, "CAN_COLLIDE"];
_vehicle_0 = _this;
_this setPos [4254.3887, 10755.609];
};
Step 2 - Put your script into your server.pbo
====== =============================
You need a tool to unpack .pbo files (e. g. http://www.armaholic.com/page.php?id=16369)
Then you go for your server folder, for my case its called "@DayZ_Epoch_Server". In this folder you open the addons folder and unpack your server.pbo. Afterwards delete or move your server.pbo to anywhere else.
Now open the new folder of your unpacking server.pbo files and open the init folder. There should be a script called like server_functions.sqf.
Open this one and search at the beginning for a code block like this one

Underneath these block you copy & paste these code line:
server_spawnCustomBuildings = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCustomBuildings.sqf";
After that you save your new server_functions.sqf and quit it.
Then you'll have to open the compile folder instead of the init folder. Now we need our script out of Step 1. Copy and paste it in and rename to "server_spawnCustomBuildings.sqf" without " ".
Now you can go back to the directory where your old server.pbo was and repack the unpacked folder back to .pbo format.
Its important that your old server.pbo isn't present there anymore and is called like it was called before.
Step 3 - Calling of your script in the missionfile
====== ============================
The major part is done now. We only need to add the call into the missionfile.
For that go to your MPMissions folder inside your server. There are two possible cases
Case1: There is a folder in it and no .pbo then skip Case2
Case2: There is a .pbo and no folder, so you got to unpack it and delete the old packed .pbo again (in contrast to the server.pbo it isn't needed to pack your missionfile)
Now open your folder inside the MPMissions and open the init.sqf.
Add at the end the following:
if (isServer) then {
call server_spawnCustomBuildings;
};
Now save your init.sqf and start your server. Your buildings should spawn as usual and cannot be copied anymore cause all buildings and their positions are stored in the server.pbo which is never passed to the clients.
If you have multiple different Additions you naturally can do the same steps again and just rename the names.
This is also very good to handle cause if you don't want to spawn the part anymore you can comment it out or delete the call inside the init.sqf and it will no longer spawn. If you need it again paste it in again.
I hope this helps some people, have fun with your safe Map Additions!
Regards
kikyou2