Deploy Bike help please

So i've been trying to get deploy bike feature on a DayZ Vanilla server version 1.8.1 i've managed to get the bike to deploy via right click on a tool box, but whenever i go to get on it, it kills me. i've seen people saying to fix this i need to edit a section in the Dayz_server.pbo under 'checkhacker' but in the dayz server pbo's (bliss, chernarus 1 and dayz) none of them have the check hacker part? any help would be appreciated.
 
Check the RPT for a line that says "killed a hacker" .. its there. You are using 1.8.1 .. I only have 1.8.3 on my pc right now and checking that the code you need to edit is located in
@Hive\Addons\dayz_server\system\scheduler\sched_safetyVehicle.sqf
the actual code is right here
Code:
sched_safetyVehicle = {
    {
        if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor) && (typeOf vehicle _x) != "ParachuteWest") then {
            diag_log [ __FILE__, "KILLING A HACKER", name _x, " IN ", typeOf vehicle _x ];
            (vehicle _x) setDamage 1;
            _x setDamage 1;
        };
    } forEach allUnits;

    objNull
};

We used to use a setvariable "sarge" and then check for that in this bit of code but it looks like you can simply add your bike into the dayz_serverObjectMonitor array.
So in the code that creates the bike put this line after the createvehicle line:
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_this];
the variable _this should be the same as what is returned in your createvehicle line ...

If 1.8.1 still uses the old method and not the scheduler then you will still find the same code in server_cleanup.fsm and the fix is nearly the same. Read the instructions for Sarges AI on editing the file .. https://github.com/Swiss-Sarge/SAR_AI-1.5.0 ... look for this line which starts the instructions
A2) Adjust your server_cleanup.fsm file for group cleanups

and then you will have to add the sarge variable to your bike
_this setvariable["sarge", true, true];
 
Last edited:
i've looked into what you have suggested, went to the section in the server_cleanup, but in my RPT it doesnt give me any errors or restrictions ect, so i have no idea what i replace the _this with?
 
you may not have to replace it, ...

post your deploy bike script .. the file with the createvehicle line

you said dayz 1.8.1 right? will edit and upload later so you have it working.
 
that is an Epoch script. You can tell because it has variables that say DZE_ instead of Dayz_
So here is a LONG POST that has pictures to help you along in the future. The end result will be a working script though ...
Its confusing, but I hope you can gain some insight into how this is working and it will help you in the future. I normally do not like to actually edit files and upload them because the person gains no knowledge on how to do it for themselves later. But this is such a simple fix, I could do it for you in 15 seconds .. but the price for that is a bit of a lesson. Your 2 completed files are at the bottom of the page though.
If it still doesn't work after editing your 2 files and restarting the server, upload your files and I will fix them up .. no charge :D

First I know I am looking for the part that does the infamous "killed a hacker" because the server is blowing up a vehicle that it thinks was spawned in by a hacker. It thinks that because the vehicles is not in any of the 'safe' lists of vehicles that it knows to be spawned in by the server.

So to find that code we go to our notepad++ find in files tab and type in hacker. We paste in the location for our dayz_server folder so it searches all files in that folder.
KrdvC9j.png


What results is a list of the word and the files its in. By clicking on one, that file is opened in the upper panel and directly at the location of the word. Look closely and you can see the "killed a hacker" line and all the code. The file is the server_cleanup.fsm (in later dayz versions the code is moved to a scheduler file)
UUe39tM.png


So what we need to do is have a line of code that keeps your added vehicles from being destroyed. I had linked you to Sarges AI code because that had become the accepted method of preventing this. His "fixed" code block looks like this (see the entire file here )
Code:
    /*%FSM</STATE>*/
    /*%FSM<STATE "check_for_hacker">*/
    class check_for_hacker
    {
      name = "check_for_hacker";
      init = /*%FSM<STATEINIT""">*/"//Check for hackers" \n
       " {" \n
       "    if(vehicle _x != _x) then {" \n
       "        if  (!(vehicle _x in _safety) && ((typeOf vehicle _x) != ""ParachuteWest"") && (vehicle _x getVariable [""Sarge"",0] != 1) ) then {" \n
       "            diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
       "            (vehicle _x) setDamage 1;" \n
       "            _x setDamage 1;" \n
       "         };" \n
       "    };" \n
       " } forEach allUnits;" \n

So you can see the edited Sarges file has a line that checks for a variable (vehicle _x getVariable [""Sarge"",0] != 1) and what we are going to do is add that boolean to the code you have in your fsm file which gives us (I changed the variable Sarge to SafeVehicle)
Code:
      "     if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest""  && (vehicle _x getVariable [""SafeVehicle"",0] != 1)) then {" \n
So now this code block is going to look to see if the vehicle has a variable "SafeVehicle" set to 1 and if so, it will not delete the vehicle.

-----------------------------------------------------------------------------------------
Now for the deploy bike script. In the file deploy.sqf is this bit of code. You can see the line with createvehicle and its being assigned to the variable _object. That is what I meant about changing _this to whatever the variable vehicle was assigned to, in your case its _object.
N6EAkbZ.png


so we add our setvarible right below the other 2 setvariable lines
Code:
   _object setVariable ["SafeVehicle", "1", true];

And now our bike has a variable that tells the server that its safe, do not delete it. This code will work for any vehicle.


This is your edited deploy.sqf file. It only has the single additional line
http://pastebin.com/RnFvwTTH

This is your edited server_cleanup.fsm file with only a single edited line UNLESS you have previously edited this file for some other script. This file is located in your dayz_server.pbo
\dayz_server\system\server_cleanup.fsm
http://pastebin.com/73r4EfXF
 
if i allready have Sarge AI on the server, would i still add another (vehicle _x getVariable [""SafeVehicle"",0] != 1)) or would i edit the existing one with ""sarge"" in it?
 
If you already have sargeAI then you probably arlready have the sargeAI variable in your server_functions.fsm file as its included in the installation directions. in that case in your deploy bike file, rename the "SafeVehicle" with "Sarge"
 
I really don't want to seem like a pain in the ass, but my files are identical to yours now, i did it all myself following exactly what you instructed, but the servers still killing me. would this be anything to do with infistar? or am i just plain retarded.... heres what my RPT says upon death.

0:00:09 "CLEANUP: KILLING A HACKER Boots B 1-1-B:1 (Boots) REMOTE IN Old_bike_TK_INS_EP1"
 
Of course it will work on your server ...
The RPT line "killing a hacker is coming from that block in your server_cleanup.fsm, so its just not being stopped from executing.

As I said before, post your server_cleanup.fsm and your deploy.sqf and we will get it working.

You are remembering to repack the dayz_server.pbo ... maybe you should just upload the dayz_server.pbo and your mission pbo to dropbox/gdrive etc .. then we can cover all the bases.
 
Your server_cleanup.fsm has the sarge variable while the deploy bike has the safevehicle variable I had suggested, the two must match. Since you are running SargeAI, change the deploy.sqf safevehicle to sarge.

What you have in deploy.sqf
Code:
  _object = "Old_bike_TK_INS_EP1" createVehicle (position player);
    _object setVariable ["ObjectID", "1", true];
    _object setVariable ["ObjectUID", "1", true];
        _object setVariable ["SafeVehicle", "1", true];

change it to this
Code:
_object = "Old_bike_TK_INS_EP1" createVehicle (position player);
    _object setVariable ["ObjectID", "1", true];
    _object setVariable ["ObjectUID", "1", true];
    _object setVariable ["Sarge", "1", true];

here is the deploy.sqf pastebin to copy ..
http://pastebin.com/GRJyFzd7
 
I feel your pain. There is something that is not getting done right because it is a relatively simple fix. But arma has the tendency to make simple things difficult. As I mentioned before, if you upload the actual dayz_server.pbo and the mission pbo you are using then I can check and see if I can find the issue. Perhaps you are not packing into PBO after edits? Are you using vilayer? Their methods are more confusing.
 
Ran 1.8.1 dayz server using your files. Deploy bike works perfectly, no "killed a hacker'. As expected, since the code looks good, you are not using the files you uploaded for me. I do not know the method Nitrado uses for the pbos, but the ones you are editing are not being updated on your server. So, I dont know how they update the pbo's that you use but something is not being done correctly.

I can upload a video of me creating and riding a bike later, but it will take 20 minutes to upload and I have to go to work.
 
imho deploy bike is a gay script. Like I keep all the parts for a bike in my backpack that's retarded! I have a similar script on my server where we ride a cow. it works exactly like to deploy bike script right now accept it spawns accou that we ride. My next step histo create a trigger that will spawn in cows near the Barnes as the player walks through so that you can get on one and write it. I will post that when I'm done
 
Hmm kinda annoying how the scripts are fine yet still kills me >.< stupid ass nitrado, I'll take a look at the server when I get in to see what's going on, as for the cow thing, man that sounds awesome, IDE love to try that out when you share it :)
 
Back
Top