Jump to content
  • 0

Disable Key Removing on Selling


NetShark

Question

Hi,

 

This is my first topic and I did it because I was looking for a while a solution for my situation and I couldn't find it. I hope it's in the right place.

 

PROBLEM:

I need to disable the auto key deletion from toolbelt done by Epoch when a Player sells a vehicle.

 

REASON:

I just installed the script "" by "OtterNas3" and it works wonderful. However, there's a little problem with one epoch settings I found on an previous changelog:

 

[CHANGED] Selling vehicle will now remove the key if you have it on your toolbelt.

 

If I have a Master Key for all my vehicles and I want to sell one I will lose my Master Key :(

 

Is there an option that can disable this funtion?

 

Thanks in advance for your help.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Put the key in your backpack, sell the vehicle, put the key back in your toolbelt (or does it take the key from the backpack as well) ?.

 

Failing that, have a look at the previous release and the current one with the change you highlighted and see what code was changed.  That would be a starting point and you may be able to reverse it.

Link to comment
Share on other sites

  • 0

Put the key in your backpack, sell the vehicle, put the key back in your toolbelt (or does it take the key from the backpack as well) ?.

 

Failing that, have a look at the previous release and the current one with the change you highlighted and see what code was changed.  That would be a starting point and you may be able to reverse it.

:) Thanks for the answer man.

And yes... putting the key in the backpack works, and that's our actual solution... but sometimes people forget it.. and lose their master keys.

 

Ok, I'll take a look at the code to figure it out..... however, I thought that this was just a setting option like those we find in the init.sqf :) but well... thanks.

 

Have a nice one.

Link to comment
Share on other sites

  • 0

Remove the following codes from trade_any_.... ( vehicles for example). You will need to setup a custom trader stuff thingy tho ^^

// remove Key
_temp_keys = [];
_keyColor = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
{
	if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _keyColor) then {
		if (str(getNumber(configFile >> "CfgWeapons" >> _x >> "keyid")) == _objectCharacterId) then {
		         [_activatingPlayer,_x] call BIS_fnc_invRemove;
		};
	};
} count (items _activatingPlayer);
Link to comment
Share on other sites

  • 0

 

Remove the following codes from trade_any_.... ( vehicles for example). You will need to setup a custom trader stuff thingy tho ^^

// remove Key
_temp_keys = [];
_keyColor = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
{
	if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _keyColor) then {
		if (str(getNumber(configFile >> "CfgWeapons" >> _x >> "keyid")) == _objectCharacterId) then {
		         [_activatingPlayer,_x] call BIS_fnc_invRemove;
		};
	};
} count (items _activatingPlayer);

 

Hey, thanks for the tip.... but why is it necesary to create a custom trader?

Wouldn't be enough with removing the code you said?

Link to comment
Share on other sites

  • 0

Not a new trader a new trade_any_vehicle file or whatever you will have to move them to the mission and edit them

 

You will need to move a file into the mission and edit the comples.sqf for the new path and change the path of the trade_any_xxx files in the file you moved over.

 

Let me know if you need it more specific

Link to comment
Share on other sites

  • 0

Not a new trader a new trade_any_vehicle file or whatever you will have to move them to the mission and edit them

 

You will need to move a file into the mission and edit the comples.sqf for the new path and change the path of the trade_any_xxx files in the file you moved over.

 

Let me know if you need it more specific

 

Thank you man.

 

One question. I have a custom compiles.sqf in my Mission file... and I found another in the dayz_code.pbo.. the custom file I have is related to one script.... and I browsed both and I couldnt find any link to the trade_any_xxx files... is there another complies.sqf somewhere else? or Im doing a bad search?

Link to comment
Share on other sites

  • 0

Thank you man.

 

One question. I have a custom compiles.sqf in my Mission file... and I found another in the dayz_code.pbo.. the custom file I have is related to one script.... and I browsed both and I couldnt find any link to the trade_any_xxx files... is there another complies.sqf somewhere else? or Im doing a bad search?

 

dayz_code\compile\player_traderMenuConfig.sqf

 

that need to be called in your compiles ( custom)

 

And then take the trade_any files and change them. 

 

in dayz_code\actions

Link to comment
Share on other sites

  • 0

dayz_code\compile\player_traderMenuConfig.sqf

 

that need to be called in your compiles ( custom)

 

And then take the trade_any files and change them. 

 

in dayz_code\actions

 

Umm.. I see... this means that I would modify the dayz_code.pbo file, because there's where trade_any_xxx files are.

 

Ummm.... Can I take those "trade_any_xxx" files, move them from dayz_code.pbo to my mission.pbo, modify them and change the paths somewhere to inform the server their new location?

 

I ask this because inside the file "player_traderMenuConfig.sqf" there's a reference to those "trade_any_xxx", but the paths are not set in there. So the server will look for those files in their original location: @DayZ_Epoch/addons/dayz_code.pbo/actions/trade_any_vehicle.sqf

 

Reference to "trade_any_xxx" in "player_traderMenuConfig.sqf"

		_typeNum = 1;
		if (_type == "trade_weapons") then {
			_typeNum = 3;
		} else { 
			if (_type in ["trade_backpacks", "trade_any_vehicle", "trade_any_vehicle_free", "trade_any_boat", "trade_any_bicycle"]) then {
				_typeNum = 2;
			};
		};

I personally prefer to make all the modifications directly to my mission.pbo or server.pbo... of course changing the paths wherever it's required to adjust it, including bringing some files from dayz_code.pbo to my mission.pbo.

 

Where can I modify these path to handle these "trade_any_xxx" files from my Mission.pbo?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...