Jump to content

[FIX] Automatically Eject Players From Blown Up Vehicles


Recommended Posts

We have ran into the following two issues regarding blown up vehicles on our server:

  1. Players get stuck in blown up vehicles, and are actually unable to eject.
  2. Players refuse to eject from a blown up vehicle, as a way to avoid combat.

These are the steps I took to fix this issue:

  1. Navigate to dayz_server\compile.
  2. Open server_updateObject.sqf with your text editor of choice.
  3. CTRL+F and search for the following:
    _object_killed = {
    	private["_hitpoints","_array","_hit","_selection","_key","_damage"];

     

  4. Under that, copy and paste the following:
    if((count crew _object) > 0) then{
    	{ moveOut _x } forEach crew _object;
    };

     

  5. Save and done.

 

This has been tested a decent amount over the past few restarts on my server, and has been reported to be working by the players.  The only small issue we have found, is that when it gets close to a server restart, and there are 60-70 players online, it can sometimes take up to 20-30 seconds to eject the player(s).  If anyone has any suggestions on how to do this better, then please feel free to share.  Hopefully, this helps a few people.  Enjoy!

Link to comment
Share on other sites

Nice fix!

It'll work fine in 1.0.5.1 but in 1.0.6 this fix has already been added to the BIS_Effects files, which are executed by the client and should have no delay when the server becomes laggy (this fix also kills the player in the crash/explosion). Keep in mind that you can use the bis_effects files from 1.0.6 with 1.0.5.1 but some vehicles do not properly execute the BIS_Effects in 1.0.5.1 so vehicles like tanks, boats, some pooks and the CH53 will still not be fixed (configs have been fixed for 1.0.6 so all vehicles call BIS_Effects properly).  Once 1.0.6 comes out you will need to remove the fix in the OP from your server.

 

If you are looking to use the 1.0.6 files early you will need to set 2 variables:

DZE_SafeZonePosArray = []; //Nested array of safezone positions to excluded from killing the player and radii i.e. [[[posx,posy,posz], radius], [[posx,posy,posz], radius]];

DZE_NoVehicleExplosions = false; //set to true to disable vehicle explosions which should reduce griefing by ramming, other vehicles may still be destroyed if rammed.

 

You will probably be able to combine the effects of the OP fix and 1.0.6 fix so that 1.0.6 picks up where the op's fix is too delayed and the op's fix picks up where vehicles do not call the BIS_Effects files properly. 

 

https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/system/BIS_Effects/killed.sqf

Link to comment
Share on other sites

5 hours ago, salival said:

Hey,

For what it's worth this didn't work for me.

I had to change it to the following code to actually eject them.

 


	if ((count crew _object) > 0) then {
		{ _x action ["Eject",_object];  } forEach crew _object;
	};

 

That is odd.  It is still working on my server.  Also, I was under the impression "moveOut" was the same thing as ejecting, just without an animation.  Like I stated in my first post, it can take longer to eject players if the server hasn't restarted in a while, or has a lot of players online.  On my test server, it ejects players instantly.  On my live server, with 70 people online, it can take 10+ seconds.  Let me know if anyone has gotten this to work on their server.  Thanks.

Link to comment
Share on other sites

  • 2 weeks later...
12 hours ago, salival said:

@FreakingFred: I must apologise, I think your way and my way works the same. I was testing this with spawning in vehicles with infiSTAR, I don't think this puts the same handlers on the vehicle so it doesn't trigger this. If I grab a server spawned vehicle or a users vehicle it works fine.

yeah anything server spawned should work. Same thing for vehicle skins, they wont work if you spawn the vehicle in, but it will if you buy the vehicle fro the traders

Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...
Quote

That is odd.  It is still working on my server.  Also, I was under the impression "moveOut" was the same thing as ejecting, just without an animation.  Like I stated in my first post, it can take longer to eject players if the server hasn't restarted in a while, or has a lot of players online.  On my test server, it ejects players instantly.  On my live server, with 70 people online, it can take 10+ seconds.  Let me know if anyone has gotten this to work on their server.  Thanks.

Works great for me except air vehicles atm not giving a para.  At low pop time on my sever its pretty quick and high pop 50-60 players it does take longer, that's to be expected though. 

Link to comment
Share on other sites

On 7/31/2016 at 4:22 AM, salival said:

Hey,

For what it's worth this didn't work for me.

I had to change it to the following code to actually eject them.

 


	if ((count crew _object) > 0) then {
		{ _x action ["Eject",_object];  } forEach crew _object;
	};

 

Wow i missed this lol.  This fixed it Thanks guys.

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
  • Discord

×
×
  • Create New...