Jump to content
  • 0

[Help] Using the UID to Lock/Unlock purchased Vehicles


Willy

Question

 So I was cruising different Epoch servers and I came across a server that had purchased vehics lockable without the need for the actual keys taking up a toolbelt slot. (never been a fan of all the key juggling for my fleet LoL)

 

 Ive tried to reach out to the servers owner/admin and haven't heard back from him yet.

 

 Google has led me around in a few circles on my search for this script/mod.

 

 

Could anyone point me in the right direction maybe ?

 

Thanks in advance for your time

 

Ole Man Willy

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

BlackSheep25 replied on the OpenDayZ forums:

"That script will allow anyone with the UID in the list to scroll on vehicles and unlock/lock it, with a few edits you could get it to allow all players to just scroll to do it instead of needing the keys, but i haven't been working on dayz for a few months now."

 

heres the code from the post I was diggng through: I believe this was Macas work ..

 

Scratching my head over what edits would be needed, Heres the code

 

 

I have my admin uid's defined in init.sqf
 

Code:
adminList = ["00000", "000000"];

And I have overidden selfActions

 

Code:
// Allow Owner to lock and unlock vehicle
if(_isVehicle and _isAlive and !_isMan and _ownerID != "0") then {
    if (s_player_lockUnlock_crtl < 0) then {
        _hasKey = _ownerID in _temp_keys;
        _oldOwner = (_ownerID == dayz_playerUID);
        if(locked _cursorTarget) then {
            if(_hasKey or _oldOwner) then {
                _Unlock = player addAction [format["Unlock %1",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",_cursorTarget, 2, true, true, "", ""];
                s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                s_player_lockUnlock_crtl = 1;
            } else {
                if ((getPlayerUID player) in adminList) then {
                    _Unlock = player addAction [format["<t color='#ff0000'>Unlock %1</t>",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",_cursorTarget, 2, true, true, "", ""];
                } else {
                    _Unlock = player addAction ["<t color='#ff0000'>Vehicle Locked</t>", "",_cursorTarget, 2, true, true, "", ""];
                };
                s_player_lockunlock set [count s_player_lockunlock,_Unlock];
                s_player_lockUnlock_crtl = 1;
            };
        } else {
            if(_hasKey or _oldOwner) then {
                _lock = player addAction [format["Lock %1",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
                s_player_lockunlock set [count s_player_lockunlock,_lock];
                s_player_lockUnlock_crtl = 1;
            } else {
                if ((getPlayerUID player) in adminList) then {
                    _lock = player addAction [format["<t color='#ff0000'>Lock %1</t>",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""];
                    s_player_lockunlock set [count s_player_lockunlock,_lock];
                    s_player_lockUnlock_crtl = 1;
                };
            };
        };
    };
 
} else {
    {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
    s_player_lockUnlock_crtl = -1;
};

 

 

 

 

Link to comment
Share on other sites

  • 0

They're my servers. 

 

Instead of writing the keys code to the characterid field I am writting the player uid to field so vehicles are bound to the player and not a character or key.  Keys still get generated but there paper weights.

 

Copy your (make sure to copy them all)

trade_any_bicycle.sqf

trade_any_boat.sqf

trade_any_vehicle.sqf

trade_any_backpacks.sqf

trade_any_items.sqf

trade_any_weapons.sqf

 

into a fixes folder.

 

Modify your

trade_any_bicycle.sqf

trade_any_boat.sqf

trade_any_vehicle.sqf

 

// ------------------------------------------------------------------------Player GUID instead of key Start------------------------------------------------------------------------
//                            PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
                            PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,dayz_playerUID,_activatingPlayer];
// ------------------------------------------------------------------------Player GUID instead of key End------------------------------------------------------------------------

 

Change this line in your compiles.sqf

 

_File = "\z\addons\dayz_code\actions\" + _afile + ".sqf";

 

to

 

_File = "fixes\" + _afile + ".sqf";
 

 

The fn_selfaction was all ready coded to support the player uid allowing unlocks.

Link to comment
Share on other sites

  • 0

There are some side effects to this though.  If your in a vehicle and ram into something you will get the message on your self and will flag you to AI if enabled.  Also if you get turned into a zombie then you can not attack players.  I also suspect that this helps you survive from plane and heli crashed you proably should not be able to walk away from.

 

fn_damageHandler.sqf

 

/*
if (_isPlayer) then {
    if (_damage > 0.1) then {
        dayz_canDisconnect = false;
        //["PVDZE_plr_DiscAdd",getPlayerUID player] call callRpcProcedure;
        PVDZE_plr_DiscAdd = getPlayerUID player;
        publicVariableServer "PVDZE_plr_DiscAdd";
                
        dayz_damageCounter = time;
        
        //Ensure Control is visible
        _display = uiNamespace getVariable 'DAYZ_GUI_display';
        _control =     _display displayCtrl 1204;
        _control ctrlShow true;
    };
};
*/

// Freindly Fire Messages - by piggd [email protected]
if ((_unit != _source)  and _isPlayer ) exitWith {cutText [format["%1 has tried to kill %2",_source,_unit], "PLAIN DOWN",30]};

if (_unitIsPlayer) then {
    if (_hit == "") then {
 

Link to comment
Share on other sites

  • 0

Quick question PIGGD, this bit of code here

// ------------------------------------------------------------------------Player GUID instead of key Start------------------------------------------------------------------------
//                            PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
                            PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,dayz_playerUID,_activatingPlayer];
// ------------------------------------------------------------------------Player GUID instead of key End------------------------------------------------------------------------

 

Would I put it above

//["PVDZE_veh_Publish",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure;
						PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer];
						publicVariableServer  "PVDZE_veh_Publish2";

or would I comment out my piece of code though leaving the variable there

 

soz for being a pain..I need coffee

 

Bags

Link to comment
Share on other sites

  • 0

Well I had this UID key thing working before I went to bed. Came back today with reports that it wasn't working.

 

And somehow I borked the AI from firing on players. Needless to say they had a profitable day.

 

So I reverted back to Vanilla Epoch because I couldn't figure out which mod caused the AI to go pacifist LoL.( I was on a scripting marathon on my day off haha)

 

Got most everything back in but I cant for the life of me get this UID vehicle locking to work now.

 

If anyone else gets it sorted please let us know :)

Link to comment
Share on other sites

  • 0

//["PVDZE_veh_Publish",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure;

// ------------------------------------------------------------------------Player GUID instead of key Start------------------------------------------------------------------------

// PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];

PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,dayz_playerUID,_activatingPlayer];

// ------------------------------------------------------------------------Player GUID instead of key End------------------------------------------------------------------------

publicVariableServer "PVDZE_veh_Publish2";

Still troubling why I cant get this to work again LoL... Does the above section look right ?.Late night scripting is doing my head in ! for the lose !!

Link to comment
Share on other sites

  • 0

Hey guys I'm trying this script out and I am having an issue with this bit:

 

Change this line in your compiles.sqf

 

_File = "\z\addons\dayz_code\actions\" + _afile + ".sqf";

 

to

 

_File = "fixes\" + _afile + ".sqf";
 

 

I have a overridden compiles file but do not see this in it or any of the trade_any_XXXX files.

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

×
×
  • Create New...