Jump to content

[RELEASE] Vehicle Key Changer - For making Masterkey - V 1.4 (Updated 06/15/2014)


OtterNas3

Recommended Posts

Had installed the previous version of the master-key, but it had the bug of dumping gear and dupeing vehicles. 

 

So, I updated to latest version, which allowed me to claim and re-key unowned vehicles but apparently "broke" the master-key program. 

 

Friend helping me apply the fix that Gwandoya came up with, but still wont work. 

I feel like we are missing something, maybe because the solution is a combination of different threads scattered around. I'd love it if the OP could be updated to include everything needed to install this script. 

Link to comment
Share on other sites

Exactly, to claim a vehicle you need to have a key in your inventory.

 

There're some conditions must be fulfilled before you can claim a vehicle or change a key.

You need to have these in your inventory (payments depend on init settings, but I use these).

 

1. to claim a vehicle which has no key:

  • 1 Keymakers Kit
  • 1 Key
  • 10oz GoldBar
  • 1 GoldBar

2. to change the key of a vehicle to another key:

  • 1 Keymakers Kit
  • the key of the vehicle you want change key for ("KeyAlice")
  • an other key which will open the vehicle ("KeyBob")
  • 1 GoldBar

As the author showed in his video when you change a key from "KeyAlice" to "KeyBob", you can calmly drop "KeyAlice", because that doesn't belong to the vehicle anymore.

If you do that with several different "KeyAlices" you can have several vehicles with "KeyBob", that's why "KeyBob" is called "Master Key" :)

Link to comment
Share on other sites

Works fine, thanks!

 

But there is one BIG problem; i remove the ammo from the tanks and let the players buy it.

So basicly if the player set a Masterkey, the removeammo script doesent work on the new spawned one.

 

So no Not_DZE vehicle use. Suggestions?

Link to comment
Share on other sites

I'm finding that after installing this and doing the fixes on this page made it all work, except vehicles seem to be randomly teleporting on restart back to their previous locations. Is there a fix for this, or something you have to live with in order to make this work?

Link to comment
Share on other sites

Works fine, thanks!

 

But there is one BIG problem; i remove the ammo from the tanks and let the players buy it.

So basicly if the player set a Masterkey, the removeammo script doesent work on the new spawned one.

 

So no Not_DZE vehicle use. Suggestions?

 

Where do you call you´re remove ammo script?

Link to comment
Share on other sites

Hello everyone, so it worked for me well in a script pack. Not really this one, but pretty similar. So after i have updated infiSTAR admin tool (week ago) it started giving me a BE restriction. I know that the problem has to be somwhere in BE files on the server, so there must be an exception command to add... and where to add... any ideas?

 

Cause i dont really want to write in BE filters an exeption for an exact player doing that stuff... for each one ofc... and thats a lot.

Link to comment
Share on other sites

  • 2 weeks later...

@tkdmaster:

 

To avoid vehicles porting to previous locations (what I read often in the last posts) is it not enough to get into the vehicle and get out again to save it correctly to the DB again...I mean as a workaround. On my linux server it's the same when towing/lifting a vehicle. I just need to get into that after towing/lifting and then it's ok and stays where it should. I don't know if that works for you but maybe it's worth a try.

Link to comment
Share on other sites

Love this mod, its a shame that it still seems to have the old bug of teleporting vehicles at random on restarts....I've been forced to remove it form my server after at least 20+ vehicles got teleported around, regardless of how many times you get in or out of them.

 

Really hope someone can either find a fix for this, or can re-write the silly thing to work alittle more smoothly.

Link to comment
Share on other sites

Where do you call you´re remove ammo script?

 

After initialization by the traders.

I also guessd that it will be fine to call the remove_ammo by setting the masterkey, but there is the problem left that

arma non _DZ vehicles will spawn with default gear (wich where will be removed by the trader initialization also).

So we have to set remove_gear and remove_ammo on keychange.

But ive never tryed.

 

And than there is the problem with the duping when the server is under presure.

Vehicles will dupe themself sometimes when players set masterkey on an busy server.

The players tend to use this bugs, we decided to comment the masterkey out. Since the last epoch patch bring us

the duping bugs back, we have to wait for the epoch 1.5 update or wait for the money for an root.

Link to comment
Share on other sites

Sandbird, mind if I ask which fixes you did put in? Because when we put it in we had issues where vehicles were randomly teleporting around the map at restart and the position of none of the vehicles was being updated in the database.

Link to comment
Share on other sites

Sandbird, mind if I ask which fixes you did put in? Because when we put it in we had issues where vehicles were randomly teleporting around the map at restart and the position of none of the vehicles was being updated in the database.

 

Well i did the fixes here on page 8 :

But havent tested it yet on the server.

Link to comment
Share on other sites

Hi!

 

In first line thanks for the author for this great idea and code!

 

To solve the problem with disappearing and replaced vehicles, open VehicleKeyChanger_init.sqf and place the following code after function ON_fnc_vkc_reset in line 56:

dayz_objectUID_vkc = {
	private["_position","_dir","_key","_object"];
	_object = _this;
	_position = getPosATL _object;
	_dir = direction _object;
	_key = [_dir,_position] call dayz_objectUID2_vkc;
    _key
};

dayz_objectUID2_vkc = {
	private["_position","_dir","_key"];
	_dir = _this select 0;
	_key = "";
	_position = _this select 1;
	{
		_x = _x * 10;
		if ( _x < 0 ) then { _x = _x * -10 };
		_key = _key + str(round(_x));
	} forEach _position;
	_key = _key + str(round(_dir));
	_key
};

I suggest to reset some variables as well, place the following code after waitUntil {!isNil "dayz_animalCheck"}; in line 83:

s_player_copyToKey=-1;
lastKeyChangeCursorTarget = [objNull,objNull,objNull,objNull,objNull];

I also changed the self action menu text in that case when you claim a vehicle without a key, text "Change Vehicle Key" changed to "Claim Vehicle" in line 118.

 

And I got an odd 'general error' in some cases (probably when I had no key in my inventory but all other requirements were fullfilled)

so, I changed

if (_carKey != "0") then {

to

} else {

Now open VehicleKeyChanger.sqf and add the following code to line 129:

	/* Giving unique UID for claimed vehicles */
	if (_targetVehicleUID=="0") then {
		_targetVehicleUID = _targetVehicle call dayz_objectUID_vkc;
		_targetVehicle setVariable ["ObjectUID",_targetVehicleUID,true]; // It does probably nothing and it's not needed :)
	};

With these modfifications you can Claim a server spawned vehicle which has only ObjectID (MySQL primary, autoincremented ID) but ObjectUID=0.

On our server you can claim mission vehicles as well, because for mission vehicles we generate ObjectID="0" and ObjectUID=_vehicle call dayz_objectUID; (Server side call.)

dayz_objectUID and dayz_objectUID2 are standard ObjectUID generator functions from server_functions.sqf, and we had to place them to client side (_vkc added to names).

To fix objects stored in your database with ObjectUID=0 just run this MySQL command on object_data table:

UPDATE object_data SET ObjectUID=ROUND(RAND(1)*1000000000000000) WHERE ObjectUID=0

 

[ Modifications made for Vehicle Key Changer - For making Masterkey - V 1.3 (Updated 02/20/2014) ]

 

 

Seems to have worked like a charm, Thank You!!!!

Link to comment
Share on other sites

Put this one on my server, all works but..

If i write price in config, for making new key, players must have in inventory money, how much is price ,but after making key, money stay in inventory so anyway its for free.

Maybe i do somethink wrong??? Bad english, sorry

 

b_560_95_1.png

Link to comment
Share on other sites

This mod is just a mess...i just saw about the vehiclefunctions.sqf

Wtf..its not even included in the download....Is this thing still needed or what ?

Any word on this? Is this file only needed if you want to claim vehicles? I dont allow that option on my server so if so, i think im good.

 

Zero

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
  • Advertisement
×
×
  • Create New...