OtterNas3 Posted January 11, 2014 Author Report Share Posted January 11, 2014 You can put as many Vehicles on one Key as you like Or make 1 for Air Vehicles, 1 for Land Vehicles, 1 for Ships Or... or... ... .. . RRP47 1 Link to comment Share on other sites More sharing options...
cen Posted January 11, 2014 Report Share Posted January 11, 2014 The download didn't contain the other file which is why people were confused :) It now has the file in the zip. Link to comment Share on other sites More sharing options...
RRP47 Posted January 11, 2014 Report Share Posted January 11, 2014 I will be installing this on my server. Thanks for an awesome addition! Link to comment Share on other sites More sharing options...
cen Posted January 11, 2014 Report Share Posted January 11, 2014 Got it working with Otter's help! Make sure you have the version with the added ; in Vehiclefunctions.sqf Also, I removed the _hasKeyKit requirement. Here is my Vehiclefunctions.sqf (not the path to the folder is different since I use a Scripts folder: private ["_itemsPlayer","_temp_Keys","_temp_keysDisplayName","_temp_keysDisplayNameParse","_key_colors","_ownerKeyId","_carKey","_hasKey","_cTarget","_keyName","_carKeyName"]; waitUntil {!isNil "dayz_animalCheck"}; while{true} do { sleep 3; if (speed player <= 1 && (vehicle player) == player && !isEngineOn cursorTarget && (cursorTarget isKindOf "Car" || cursorTarget isKindOf "Air" || cursorTarget isKindOf "Ship")) then { _cTarget = cursorTarget; _carKey = _cTarget getVariable ["CharacterID","0"]; if (_carKey != "0") then { _itemsPlayer = items player; _temp_keys = []; _temp_keysDisplayName = []; _temp_keysDisplayNameParse = []; _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"]; { if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then { _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid"); _keyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName"); _temp_keysDisplayName set [count _temp_keysDisplayName,_keyName]; _temp_keysDisplayNameParse set [_ownerKeyId,_keyName]; _temp_keys set [count _temp_keys,str(_ownerKeyId)]; }; } forEach _itemsPlayer; _hasKey = _carKey in _temp_keys; if (_hasKey && (count _temp_keys) > 1 && (_ctarget distance player) <= 10) then { _carKeyName = (_temp_keysDisplayNameParse select (parseNumber _carKey)); _temp_keys = _temp_keys - [_carKey]; _temp_keysDisplayName = _temp_keysDisplayName - [_carKeyName]; if (s_player_copyToKey < 0) then { s_player_copyToKey = player addAction [("<t color=""#0000FF"">" + ("Change Vehicle Key") + "</t>"),"Scripts\VehicleKeyChanger\VehicleKeyChanger.sqf",[_cTarget, _temp_keys, _carKey, _temp_keysDisplayName, _carKeyName],-1,false,false,"",""]; }; } else { player removeAction s_player_copyToKey; s_player_copyToKey = -1; }; } else { player removeAction s_player_copyToKey; s_player_copyToKey = -1; }; } else { player removeAction s_player_copyToKey; s_player_copyToKey = -1; }; }; Link to comment Share on other sites More sharing options...
fullaholes Posted January 11, 2014 Report Share Posted January 11, 2014 Meh, still doesn't work for me. I don't get an option when I'm next to a vehicle. Same for me, no option in scroll menu or when near the vehicles to create masterkey.. ? Link to comment Share on other sites More sharing options...
OtterNas3 Posted January 11, 2014 Author Report Share Posted January 11, 2014 it works with these files on my server now, please redownload and copy over again the custom folder. It MUST work! Link to comment Share on other sites More sharing options...
OtterNas3 Posted January 11, 2014 Author Report Share Posted January 11, 2014 Please check your custom\vehiclefunctions.sqf It has to look like this: private ["_itemsPlayer","_temp_Keys","_temp_keysDisplayName","_temp_keysDisplayNameParse","_key_colors","_ownerKeyId","_carKey","_hasKey","_cTarget","_keyName","_carKeyName"]; waitUntil {!isNil "dayz_animalCheck"}; while{true} do { sleep 3; if (speed player <= 1 && (vehicle player) == player && !isEngineOn cursorTarget && (cursorTarget isKindOf "Car" || cursorTarget isKindOf "Air" || cursorTarget isKindOf "Ship")) then { _cTarget = cursorTarget; _carKey = _cTarget getVariable ["CharacterID","0"]; if (_carKey != "0") then { _itemsPlayer = items player; _hasKeyKit = "ItemKeyKit" in _itemsPlayer; _temp_keys = []; _temp_keysDisplayName = []; _temp_keysDisplayNameParse = []; _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"]; { if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then { _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid"); _keyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName"); _temp_keysDisplayName set [count _temp_keysDisplayName,_keyName]; _temp_keysDisplayNameParse set [_ownerKeyId,_keyName]; _temp_keys set [count _temp_keys,str(_ownerKeyId)]; }; } forEach _itemsPlayer; _hasKey = _carKey in _temp_keys; if (_hasKey && _hasKeyKit && (count _temp_keys) > 1 && (_ctarget distance player) <= 10) then { _carKeyName = (_temp_keysDisplayNameParse select (parseNumber _carKey)); _temp_keys = _temp_keys - [_carKey]; _temp_keysDisplayName = _temp_keysDisplayName - [_carKeyName]; if (s_player_copyToKey < 0) then { s_player_copyToKey = player addAction [("<t color=""#0000FF"">" + ("Change Vehicle Key") + "</t>"),"custom\VehicleKeyChanger\VehicleKeyChanger.sqf",[_cTarget, _temp_keys, _carKey, _temp_keysDisplayName, _carKeyName],-1,false,false,"",""]; }; } else { player removeAction s_player_copyToKey; s_player_copyToKey = -1; }; } else { player removeAction s_player_copyToKey; s_player_copyToKey = -1; }; } else { player removeAction s_player_copyToKey; s_player_copyToKey = -1; }; }; Specially look at this line: _hasKeyKit = "ItemKeyKit" in _itemsPlayer; the ; on the end of the line was missing in one version of the downloadpackage! If it's missing in your's add it to the end of the line or just redownload the VehicleChangeKey.zip from first post amd replace the file. Link to comment Share on other sites More sharing options...
calamity Posted January 11, 2014 Report Share Posted January 11, 2014 working great so far thankz for this.... great work Link to comment Share on other sites More sharing options...
fullaholes Posted January 11, 2014 Report Share Posted January 11, 2014 OtterNas3, you sir are a genius, works flawlessly now. Many thanks for this. Link to comment Share on other sites More sharing options...
Radec59437 Posted January 11, 2014 Report Share Posted January 11, 2014 This is great.However I can see some issues with players trying to use this for vehicles on weird places (tight spaces, helipads, etc.) since the vehicle seems to basically respawn and frequently bounces around a little.Also, I don't know how to replicate it but it once duped a Humvee I had spawned via the HIVE function of InfiSTAR.It did that only once and it doesn't seem to do it with any other vehicle, perhaps it was due to some temporary desync issue. Link to comment Share on other sites More sharing options...
OtterNas3 Posted January 12, 2014 Author Report Share Posted January 12, 2014 working great so far thankz for this.... great work Thank you OtterNas3, you sir are a genius, works flawlessly now. Many thanks for this. Your welcome, but there are other coders here who should be called - Genius! Im just putting my thoughts together. This is great. However I can see some issues with players trying to use this for vehicles on weird places (tight spaces, helipads, etc.) since the vehicle seems to basically respawn and frequently bounces around a little. Also, I don't know how to replicate it but it once duped a Humvee I had spawned via the HIVE function of InfiSTAR. It did that only once and it doesn't seem to do it with any other vehicle, perhaps it was due to some temporary desync issue. The script uses the "upgrade" function of Epoch, thats why they seem to -bump- a bit. It deletes them and spawns a new one on the same position. Cause there is no reset of the velocity in the respawn function, the vehicles bumps on uneven ground. So there is no way i could reset the velocity for the Vehicle when its respawned, I tested a bit and this would be the best way to stop the movement: unpbo your dayz_server.pbo Edit file dayz_server\compiles\server_publishVehicle3.sqf Go to line 90, it should look like this: _object setPosATL _location; replace the line with this block: _location = [(_location) select 0, (_location) select 1, ((_location) select 2) + 0.2]; _object setPosATL _location; sleep 0.1; _object setVelocity [0,0,0.1]; This stops the movement on all surfaces, also when you upgrade the vehicle with one of the upgrade documents. For the duping, i guess you spawned the Vehicle and did not get in as a Driver once before you changed the Key? I'm pretty sure this is what cause the duping. Link to comment Share on other sites More sharing options...
cen Posted January 12, 2014 Report Share Posted January 12, 2014 FYI if anyone is running infistar AH you need to whitelist the menu and the action. Menu name is '#USER:_keyMenu' NAIL 1 Link to comment Share on other sites More sharing options...
NAIL Posted January 12, 2014 Report Share Posted January 12, 2014 FYI if anyone is running infistar AH you need to whitelist the menu and the action. Menu name is '#USER:_keyMenu' Thanks, just came back for this. IMO should be an edit to the original post. Link to comment Share on other sites More sharing options...
OtterNas3 Posted January 12, 2014 Author Report Share Posted January 12, 2014 InfiStar is not Epoch vanilla thats why noone post the needed things to whitelist anything for it, but: If you could give me the needed lines and the place to insert it in infiStar i put em in my first post Link to comment Share on other sites More sharing options...
Radec59437 Posted January 12, 2014 Report Share Posted January 12, 2014 I've ran into the same issue with InfiSTAR, adding "#USER:_keyMenu" in the ALLOWED CMDMenus list (_cMenu=) as cen said is all you need to make this work properly :) Link to comment Share on other sites More sharing options...
OtterNas3 Posted January 12, 2014 Author Report Share Posted January 12, 2014 Added this to the main post Link to comment Share on other sites More sharing options...
Monk Posted January 12, 2014 Report Share Posted January 12, 2014 While testing i have noticed that if you change the key on vehicles from ARMA like CH_47F_BAF, BTR90, Reammo truck etc are spawning back in with gear in them. Has anyone else noticed this? Link to comment Share on other sites More sharing options...
OtterNas3 Posted January 12, 2014 Author Report Share Posted January 12, 2014 Thats why Epoch dont use these Vehicles and created for the most Vehicles a _DZ or _DZE version. you could change the code for the respawning part in server_publishVehicle3.sqf to clear the Weapon, Magazine and Backpack Cargo before it readds the loot that was in before changing the key. I will have a look hold on... EDIT: Find this in the server_publishVehicle3.sqf: // switch var to new vehicle at this point. _object = _newobject; Replace with: // switch var to new vehicle at this point. _object = _newobject; clearWeaponCargoGlobal _object; clearMagazineCargoGlobal _object; clearBackpackCargoGlobal _object; Should fix it Link to comment Share on other sites More sharing options...
Radec59437 Posted January 12, 2014 Report Share Posted January 12, 2014 Yep, having the same problem. A player reported changing a key on a UN Ural, the ural duped its contents and threw them all on the floor.Also, a player has reported getting a blackscreen right after duping the key and getting into the vehicle (but I think he didn't wait it out and got into the old, despawning vehicle and got broken); rejoining fixed it, but it's probably worth warning people to wait a few seconds before re-entering the new vehicle. Link to comment Share on other sites More sharing options...
OtterNas3 Posted January 12, 2014 Author Report Share Posted January 12, 2014 The respawn of the Vehicles depends on the Server load, if your server fps is very low it takes some time for the server to respawn the vehicle. Database reaction time does matter too. I could insert a lock of the vehicle so noone can hop in whille changing the key for it. Or maybe moving the original Key for the vehicle into the players backpack. Will have a look tomorrow. For the duping, i never had such a thing on my server with normal Epoch vehicles. For Arma2/OA vehicles which holds any gear in it try the fix i posted 2 posts ago Link to comment Share on other sites More sharing options...
Monk Posted January 12, 2014 Report Share Posted January 12, 2014 Fix for arma2/oa vehicles worked perfectly. Link to comment Share on other sites More sharing options...
OtterNas3 Posted January 12, 2014 Author Report Share Posted January 12, 2014 Thanks for the report, will add it to the main post! Link to comment Share on other sites More sharing options...
OtterNas3 Posted January 12, 2014 Author Report Share Posted January 12, 2014 Update V1.1 Keymakers Kit is needed Cars get locked on Keychange process Old Vehicle Key gets moved to the Backpack of the player Link to comment Share on other sites More sharing options...
BetterDeadThanZed Posted January 13, 2014 Report Share Posted January 13, 2014 Very cool! The "no bouncing" code should be standard in Epoch. I've installed this and will test it out! Link to comment Share on other sites More sharing options...
Mr.Rodgers Posted January 16, 2014 Report Share Posted January 16, 2014 Love the mod but it seems to make around 6 or 7 dupes of a vehicle for regular players or spawn a extra one after restart. Anyone get this fixed? If so can you point me in the right direction please and I have the a for mentioned changes to publishvehicle3 changed. I run Epoch 1.0.3 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now