• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Looking for a Mod to Prevent Picking Up Vehicles (Without Disabling EAC)

noname835

Member
Hello, I am currently setting up a server to make it as realistic as possible, and I’ve been searching for a specific mod for some time. I want to prevent players from picking up their vehicles once they’ve been placed on the ground. For the sake of realism, it’s hard to imagine a player picking up their 4x4 and putting it in their backpack. However, I’d like to do this without having to disable EAC, if possible.

 
You can try searching in blocks.xml for canpickup

Copy that and xpath to the vehicles by appending and changing the true to false

 
You can try searching in blocks.xml for canpickup

Copy that and xpath to the vehicles by appending and changing the true to false
Thank you for your response, but I don’t quite understand your explanation. I found the block.xml file on my FTP server in the config folder. Should I modify an existing line or add a new one?

 
Always best to do client side and test in single player. 

But as a little mod that appends the vehicles and adds the canpick up false is best . Shouldn't edit base game a update will only revert it to vanilla.

I can take a look tomorrow.

Hmm thinking someone may have already done this will check that to

 
Always best to do client side and test in single player. 

But as a little mod that appends the vehicles and adds the canpick up false is best . Shouldn't edit base game a update will only revert it to vanilla.

I can take a look tomorrow.

Hmm thinking someone may have already done this will check that to
If you could make a small mod, that would be great. I've been looking for this for a long time. Thank you in advance if you can do something.

 
Here I am again, passing by to see if anyone has any suggestions to prevent a player from picking up a vehicle and putting it back in their bag.

 
I am pretty sure it is not possible without C#. 

The pick up property is included in the vehicle entity in c# and it is not exposed in the xml, meaning you cannot simply change it with xml only. For this to happen you need to patch the vehicle class with a harmony patch. 

One mod that does this (with c#) is Ravenhearst.

 
If you do want to do it via C#, then I think this is what you need to do:

  1. Modify EntityVehicle.GetActivationCommands so it doesn't include the "take" command
  2. Modify EntityVehicle.OnEntityActivated to ignore the original command index 7, and to decrease the command indexes after it by one (since you removed "take" which is index 7 in the command array)

Since this is in the base class, it should remove the "take" command from all vehicles.

EDIT: You would do this via Harmony patches to those two methods. If you don't know how to use Harmony, and want to, then there are examples in other mods, or you could ask in the Harmony/C# section of Guppy's Discord.

 
Last edited by a moderator:
I can look into making a Harmony mod for this feature. recently been thinking of the same idea,

I would start with Ravenhearst code.

 
Back
Top