Jump to content

1.6.2 [Remote Lock/Unlock Veh] USING KEYBOARD.sqf


juandayz

Recommended Posts

2 hours ago, JohnnyBravo666 said:

Anyone have this working with the Call Vehicle mod ? I've tried installing both and can only get the call vehicle option. So I tried changing up how it shows in ui_selectslot but then nothing worked lol. So I reverted back and still stuck at just call vehicle. Any help would be greatly appreciated!

Seems like you have issues with merging the changes of the two addons in your files. I suggest you take the conflicting files from both addons and difmerge them in comparison with the original epoch provided files and then you see what changes were made and these you have to add to the new file.

Link to comment
Share on other sites

9 hours ago, JohnnyBravo666 said:

Anyone have this working with the Call Vehicle mod ? I've tried installing both and can only get the call vehicle option. So I tried changing up how it shows in ui_selectslot but then nothing worked lol. So I reverted back and still stuck at just call vehicle. Any help would be greatly appreciated!

if u are talking about this mod

use tthe custom ui_selectslot.sqf (the salival mod use the ui_selctslot from deployanything so..)

find this line

Spoiler
//### BEGIN MODIFIED CODE: extra click actions
{
private["_classname","_text","_execute","_condition"];
_classname = _x select 0;
_text = _x select 1;
_execute = _x select 2;
_condition = _x select 3;
// if the clicked item matches, then assign the script call and display text
if(_item == _classname && (call compile _condition)) then {
_menu = _parent displayCtrl (1600 + _numActions);
_menu ctrlShow true;
_height = _height + (0.025 * safezoneH);
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText _text;
_menu ctrlSetEventHandler ["ButtonClick",_execute];
_numActions = _numActions + 1;
};
} forEach DZE_CLICK_ACTIONS;
//### END MODIFIED CODE: extra click actions

and just below paste:

Spoiler

/*
		Begin: Vehicle remote lock/unlock
	*/
		_itemsPlayer = items player;
		
		_temp_keys = [];
		_temp_keys_names = [];
		// find available keys
		_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
		if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
			_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
			_ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
			_temp_keys_names set [_ownerKeyId,_ownerKeyName];
			
			_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
			_i = 0;
			{
				if (alive _x) then {
					_ownerID = _x getVariable ["CharacterID", "0"];
					_hasKey = (_ownerID == str(_ownerKeyId));
					_oldOwner = (_ownerID == dayz_playerUID);

					if(_hasKey or _oldOwner) then {
						if(locked _x) then {
							//Unlock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Unlock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						} else {
							//Lock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Lock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						};
						//Engine start
						_menu =  _parent displayCtrl (1600 + _numActions + 1);
						_menu ctrlShow true;
						_text =  "Engine";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];

                        //Localize
						_menu =  _parent displayCtrl (1600 + _numActions + 2);
						_menu ctrlShow true;
						_text =  "Localize";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_finder.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
					};
					
					_i = _i + 1;
				};
			} forEach _objects;
		};
	/*
		End: Vehicle remote lock/unlock
	*/	

 

 

Link to comment
Share on other sites

4 hours ago, juandayz said:

if u are talking about this mod

use tthe custom ui_selectslot.sqf (the salival mod use the ui_selctslot from deployanything so..)

find this line

  Reveal hidden contents
//### BEGIN MODIFIED CODE: extra click actions
{
private["_classname","_text","_execute","_condition"];
_classname = _x select 0;
_text = _x select 1;
_execute = _x select 2;
_condition = _x select 3;
// if the clicked item matches, then assign the script call and display text
if(_item == _classname && (call compile _condition)) then {
_menu = _parent displayCtrl (1600 + _numActions);
_menu ctrlShow true;
_height = _height + (0.025 * safezoneH);
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText _text;
_menu ctrlSetEventHandler ["ButtonClick",_execute];
_numActions = _numActions + 1;
};
} forEach DZE_CLICK_ACTIONS;
//### END MODIFIED CODE: extra click actions

and just below paste:

  Reveal hidden contents


/*
		Begin: Vehicle remote lock/unlock
	*/
		_itemsPlayer = items player;
		
		_temp_keys = [];
		_temp_keys_names = [];
		// find available keys
		_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
		if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
			_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
			_ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
			_temp_keys_names set [_ownerKeyId,_ownerKeyName];
			
			_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
			_i = 0;
			{
				if (alive _x) then {
					_ownerID = _x getVariable ["CharacterID", "0"];
					_hasKey = (_ownerID == str(_ownerKeyId));
					_oldOwner = (_ownerID == dayz_playerUID);

					if(_hasKey or _oldOwner) then {
						if(locked _x) then {
							//Unlock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Unlock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						} else {
							//Lock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Lock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						};
						//Engine start
						_menu =  _parent displayCtrl (1600 + _numActions + 1);
						_menu ctrlShow true;
						_text =  "Engine";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];

                        //Localize
						_menu =  _parent displayCtrl (1600 + _numActions + 2);
						_menu ctrlShow true;
						_text =  "Localize";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_finder.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
					};
					
					_i = _i + 1;
				};
			} forEach _objects;
		};
	/*
		End: Vehicle remote lock/unlock
	*/	

 

 

Sorry I should've linked the mod. This is the one I am talking about below. I've already added in the mod you quoted there as that was working well. I've added in the vehicle locate script as well. Just when I go to add in the call car mod, it prevents the remote unlock/lock system from displaying when I right click on the key. I have tried merging them but when I try that, then the only option that will appear is "Make Copy".

 

 

Link to comment
Share on other sites

30 minutes ago, JohnnyBravo666 said:

Sorry I should've linked the mod. This is the one I am talking about below. I've already added in the mod you quoted there as that was working well. I've added in the vehicle locate script as well. Just when I go to add in the call car mod, it prevents the remote unlock/lock system from displaying when I right click on the key. I have tried merging them but when I try that, then the only option that will appear is "Make Copy".

 

 

ui_Selectslot.sqf  delete all about this mod and the other and

find:

_pos set [3,_height];

above paste:

 

Spoiler

	Begin: Vehicle remote lock/unlock
	*/
		_itemsPlayer = items player;
		
		_temp_keys = [];
		_temp_keys_names = [];
		// find available keys
		_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
		if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
			_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
			_ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
			_temp_keys_names set [_ownerKeyId,_ownerKeyName];
			
			
			///// jahan - begin CallCar

            //Menu entry Key CallCar
            _control =  _parent displayCtrl (1600 + _numActions);
            _control ctrlShow true;
            _height = _height + (0.025 * safezoneH);
            // this needs to point the place where the script is in your mission (CallCar.sqf)
            _script =  "custom\jtools\CallCar.sqf";
            _exescript = format["_id = ['%2','%3'] execVM '%1';closeDialog 0;",_script,_keyOwner,_keyName];
            uiNamespace setVariable ['uiControl', _control];
            // sets the text in the right button menu
            _control ctrlSetText "Kitt, come here!";
            _control ctrlSetTextColor [0.3,0.4,1,1];
            _control ctrlSetTooltip "Call your car";
            _control ctrlSetTooltipColorBox [0.3,0.4,1,1];
            _control ctrlSetTooltipColorShade [0, 0, 0, 1];
            _control ctrlSetTooltipColorText [0.3,0.4,1,1];
            _control ctrlSetEventHandler ["ButtonClick",_exescript];
            _numActions = _numActions + 1; // if there are other item action after that (other mods) add 1 to _numactions
       
///// jahan - end CallCar
			
			
			
			_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
			_i = 0;
			{
				if (alive _x) then {
					_ownerID = _x getVariable ["CharacterID", "0"];
					_hasKey = (_ownerID == str(_ownerKeyId));
					_oldOwner = (_ownerID == dayz_playerUID);

					if(_hasKey or _oldOwner) then {
						if(locked _x) then {
							//Unlock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Unlock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						} else {
							//Lock
							_menu =  _parent displayCtrl (1600 + _numActions + 2);
							_menu ctrlShow true;
							_text =  "Lock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						};
						//Engine start
						_menu =  _parent displayCtrl (1600 + _numActions + 3);
						_menu ctrlShow true;
						_text =  "Engine";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];

                        //Localize
						_menu =  _parent displayCtrl (1600 + _numActions + 4);
						_menu ctrlShow true;
						_text =  "Localize";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_finder.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
					};
					
					_i = _i + 1;
				};
			} forEach _objects;
		};
	/*
		End: Vehicle remote lock/unlock
	*/	

 

 

Link to comment
Share on other sites

4 hours ago, juandayz said:

ui_Selectslot.sqf  delete all about this mod and the other and

find:


_pos set [3,_height];

above paste:

 

  Hide contents


	Begin: Vehicle remote lock/unlock
	*/
		_itemsPlayer = items player;
		
		_temp_keys = [];
		_temp_keys_names = [];
		// find available keys
		_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
		if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
			_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
			_ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
			_temp_keys_names set [_ownerKeyId,_ownerKeyName];
			
			
			///// jahan - begin CallCar

            //Menu entry Key CallCar
            _control =  _parent displayCtrl (1600 + _numActions);
            _control ctrlShow true;
            _height = _height + (0.025 * safezoneH);
            // this needs to point the place where the script is in your mission (CallCar.sqf)
            _script =  "custom\jtools\CallCar.sqf";
            _exescript = format["_id = ['%2','%3'] execVM '%1';closeDialog 0;",_script,_keyOwner,_keyName];
            uiNamespace setVariable ['uiControl', _control];
            // sets the text in the right button menu
            _control ctrlSetText "Kitt, come here!";
            _control ctrlSetTextColor [0.3,0.4,1,1];
            _control ctrlSetTooltip "Call your car";
            _control ctrlSetTooltipColorBox [0.3,0.4,1,1];
            _control ctrlSetTooltipColorShade [0, 0, 0, 1];
            _control ctrlSetTooltipColorText [0.3,0.4,1,1];
            _control ctrlSetEventHandler ["ButtonClick",_exescript];
            _numActions = _numActions + 1; // if there are other item action after that (other mods) add 1 to _numactions
       
///// jahan - end CallCar
			
			
			
			_objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
			_i = 0;
			{
				if (alive _x) then {
					_ownerID = _x getVariable ["CharacterID", "0"];
					_hasKey = (_ownerID == str(_ownerKeyId));
					_oldOwner = (_ownerID == dayz_playerUID);

					if(_hasKey or _oldOwner) then {
						if(locked _x) then {
							//Unlock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Unlock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						} else {
							//Lock
							_menu =  _parent displayCtrl (1600 + _numActions);
							_menu ctrlShow true;
							_text =  "Lock";
							_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
							_height = _height + (0.025 * safezoneH);
							uiNamespace setVariable ['uiControl', _control];
							_menu ctrlSetText _text;
							_menu ctrlSetEventHandler ["ButtonClick",_script];
						};
						//Engine start
						_menu =  _parent displayCtrl (1600 + _numActions + 1);
						_menu ctrlShow true;
						_text =  "Engine";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];

                        //Localize
						_menu =  _parent displayCtrl (1600 + _numActions + 2);
						_menu ctrlShow true;
						_text =  "Localize";
						_script =  "[""" + _ownerID + """] execVM ""remote_key\remote_finder.sqf""";
						_height = _height + (0.025 * safezoneH);
						uiNamespace setVariable ['uiControl', _control];
						_menu ctrlSetText _text;
						_menu ctrlSetEventHandler ["ButtonClick",_script];
					};
					
					_i = _i + 1;
				};
			} forEach _objects;
		};
	/*
		End: Vehicle remote lock/unlock
	*/	

 

 

So I tried this. At first I managed to break it and no right click worked at all lol. So I removed it all. Loaded and noticed right click was working again. So I re-added this code and all the right clicks still work, but I only get the "Call Vehicle" option, none of the remote unlock/lock options...

Link to comment
Share on other sites

ui_Selectslot.sqf  abvove _posset

well heres another try @JohnnyBravo666

Spoiler

/*
        Begin: Vehicle remote lock/unlock
    */
        _itemsPlayer = items player;
        
        _temp_keys = [];
        _temp_keys_names = [];
        // find available keys
        _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
        if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
            _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
            _ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
            _temp_keys_names set [_ownerKeyId,_ownerKeyName];
            
             //Menu entry Key CallCar
            _menu =  _parent displayCtrl (1600 + _numActions);
            _menu ctrlShow true;
            _height = _height + (0.025 * safezoneH);
            // this needs to point the place where the script is in your mission (CallCar.sqf)
            _script =  "custom\jtools\CallCar.sqf";
            _exescript = format["_id = ['%2','%3'] execVM '%1';closeDialog 0;",_script,_ownerKeyId,_ownerKeyName];
            uiNamespace setVariable ['uiControl', _control];
            // sets the text in the right button menu
            _menu ctrlSetText "Kitt, come here!";
            _menu ctrlSetTextColor [0.3,0.4,1,1];
            _menu ctrlSetTooltip "Call your car";
            _menu ctrlSetTooltipColorBox [0.3,0.4,1,1];
            _menu ctrlSetTooltipColorShade [0, 0, 0, 1];
            _menu ctrlSetTooltipColorText [0.3,0.4,1,1];
            _menu ctrlSetEventHandler ["ButtonClick",_exescript];

            
            
            
            _objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
            _i = 0;
            {
                if (alive _x) then {
                    _ownerID = _x getVariable ["CharacterID", "0"];
                    _hasKey = (_ownerID == str(_ownerKeyId));
                    _oldOwner = (_ownerID == dayz_playerUID);

                    if(_hasKey or _oldOwner) then {
                        if(locked _x) then {
                            //Unlock
                            _menu =  _parent displayCtrl (1600 + _numActions + 1);
                            _menu ctrlShow true;
                            _text =  "Unlock";
                            _script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
                            _height = _height + (0.025 * safezoneH);
                            uiNamespace setVariable ['uiControl', _control];
                            _menu ctrlSetText _text;
                            _menu ctrlSetEventHandler ["ButtonClick",_script];
                        } else {
                            //Lock
                            _menu =  _parent displayCtrl (1600 + _numActions + 1);
                            _menu ctrlShow true;
                            _text =  "Lock";
                            _script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
                            _height = _height + (0.025 * safezoneH);
                            uiNamespace setVariable ['uiControl', _control];
                            _menu ctrlSetText _text;
                            _menu ctrlSetEventHandler ["ButtonClick",_script];
                        };
                        //Engine start
                        _menu =  _parent displayCtrl (1600 + _numActions + 2);
                        _menu ctrlShow true;
                        _text =  "Engine";
                        _script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
                        _height = _height + (0.025 * safezoneH);
                        uiNamespace setVariable ['uiControl', _control];
                        _menu ctrlSetText _text;
                        _menu ctrlSetEventHandler ["ButtonClick",_script];

                        //Localize
                        _menu =  _parent displayCtrl (1600 + _numActions + 3);
                        _menu ctrlShow true;
                        _text =  "Localize";
                        _script =  "[""" + _ownerID + """] execVM ""remote_key\remote_finder.sqf""";
                        _height = _height + (0.025 * safezoneH);
                        uiNamespace setVariable ['uiControl', _control];
                        _menu ctrlSetText _text;
                        _menu ctrlSetEventHandler ["ButtonClick",_script];
                    };
                    
                    _i = _i + 1;
                };
            } forEach _objects;
        };
    /*
        End: Vehicle remote lock/unlock
    */    

 

 

 

Link to comment
Share on other sites

6 minutes ago, juandayz said:

ui_Selectslot.sqf  abvove _posset

well heres another try @JohnnyBravo666

  Reveal hidden contents

/*
        Begin: Vehicle remote lock/unlock
    */
        _itemsPlayer = items player;
        
        _temp_keys = [];
        _temp_keys_names = [];
        // find available keys
        _key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
        if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _item)) in _key_colors) then {
            _ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _item >> "keyid");
            _ownerKeyName = getText(configFile >> "CfgWeapons" >> _item >> "displayName");
            _temp_keys_names set [_ownerKeyId,_ownerKeyName];
            
             //Menu entry Key CallCar
            _menu =  _parent displayCtrl (1600 + _numActions);
            _menu ctrlShow true;
            _height = _height + (0.025 * safezoneH);
            // this needs to point the place where the script is in your mission (CallCar.sqf)
            _script =  "custom\jtools\CallCar.sqf";
            _exescript = format["_id = ['%2','%3'] execVM '%1';closeDialog 0;",_script,_ownerKeyId,_ownerKeyName];
            uiNamespace setVariable ['uiControl', _control];
            // sets the text in the right button menu
            _menu ctrlSetText "Kitt, come here!";
            _menu ctrlSetTextColor [0.3,0.4,1,1];
            _menu ctrlSetTooltip "Call your car";
            _menu ctrlSetTooltipColorBox [0.3,0.4,1,1];
            _menu ctrlSetTooltipColorShade [0, 0, 0, 1];
            _menu ctrlSetTooltipColorText [0.3,0.4,1,1];
            _menu ctrlSetEventHandler ["ButtonClick",_exescript];

            
            
            
            _objects = nearestObjects [getPos player, ["LandVehicle","Helicopter","Plane","Ship"], 50];
            _i = 0;
            {
                if (alive _x) then {
                    _ownerID = _x getVariable ["CharacterID", "0"];
                    _hasKey = (_ownerID == str(_ownerKeyId));
                    _oldOwner = (_ownerID == dayz_playerUID);

                    if(_hasKey or _oldOwner) then {
                        if(locked _x) then {
                            //Unlock
                            _menu =  _parent displayCtrl (1600 + _numActions + 1);
                            _menu ctrlShow true;
                            _text =  "Unlock";
                            _script =  "[""" + _ownerID + """] execVM ""remote_key\remote_unlock.sqf""";
                            _height = _height + (0.025 * safezoneH);
                            uiNamespace setVariable ['uiControl', _control];
                            _menu ctrlSetText _text;
                            _menu ctrlSetEventHandler ["ButtonClick",_script];
                        } else {
                            //Lock
                            _menu =  _parent displayCtrl (1600 + _numActions + 1);
                            _menu ctrlShow true;
                            _text =  "Lock";
                            _script =  "[""" + _ownerID + """] execVM ""remote_key\remote_lock.sqf""";
                            _height = _height + (0.025 * safezoneH);
                            uiNamespace setVariable ['uiControl', _control];
                            _menu ctrlSetText _text;
                            _menu ctrlSetEventHandler ["ButtonClick",_script];
                        };
                        //Engine start
                        _menu =  _parent displayCtrl (1600 + _numActions + 2);
                        _menu ctrlShow true;
                        _text =  "Engine";
                        _script =  "[""" + _ownerID + """] execVM ""remote_key\remote_engine.sqf""";
                        _height = _height + (0.025 * safezoneH);
                        uiNamespace setVariable ['uiControl', _control];
                        _menu ctrlSetText _text;
                        _menu ctrlSetEventHandler ["ButtonClick",_script];

                        //Localize
                        _menu =  _parent displayCtrl (1600 + _numActions + 3);
                        _menu ctrlShow true;
                        _text =  "Localize";
                        _script =  "[""" + _ownerID + """] execVM ""remote_key\remote_finder.sqf""";
                        _height = _height + (0.025 * safezoneH);
                        uiNamespace setVariable ['uiControl', _control];
                        _menu ctrlSetText _text;
                        _menu ctrlSetEventHandler ["ButtonClick",_script];
                    };
                    
                    _i = _i + 1;
                };
            } forEach _objects;
        };
    /*
        End: Vehicle remote lock/unlock
    */    

 

 

 

So this time I was able to call my vehicle, but still no options for remote lock/unlock.

Link to comment
Share on other sites

  • 4 weeks later...
Just now, ViktorReznov said:

helicopters wont start (i think this is probably the best reason for remote start!) and the cars do but almost immediately shut off again(and yes, i unlocked them both first). Otherwise it is another excellent addition @juandayz!

i mate.. i think you need recognize as owner of the vehicle first.. something like.. you get inside of the vehicle ... turn on... and them should  be work

Link to comment
Share on other sites

Just now, ViktorReznov said:

will test and verify, ty for your input boss, I use so many of your scripts!

maybe i gonna made an update of it.. without right click... just pressing a Key to make more easier.. and to let free  ui_selectSlot.sqf

Link to comment
Share on other sites

@JohnnyBravo666 @Hooty @ViktorReznov@WLF @gernika @Cherdenko @S4M @kingpapawawa  Here you got guys the last remake.. just use one single file, and not need right click actions.. just keyboard. The engine start and shutdown alone.. If vehicle locked then unlock and start engine... if is unlocked and engine is working.. then shutdown the engine and lock the veh automatically.

VIDEO:

Spoiler

 

1-In your CUSTOM!!! keyboard.sqf at bottom but before the last "_handled" paste:

Spoiler

if (_dikCode == 0x12) then {[]execVM "scripts\remote_key.sqf";}; //#E KEY //remote  Change by another if u want 

 

 

2-Create remote_key.sqf  (mpmissions\your instance\scripts\ )

Spoiler


private ["_onLadder","_vehicle","_canDo","_vehicleOwnerID","_totalKeys","_temp_keys","_temp_keys_names","_hasKey","_oldOwner","_uid"];
_vehicle = cursorTarget;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; 
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
_vehicleOwnerID = _vehicle getVariable ["CharacterID","0"];
if !(_vehicle isKindOf "AllVehicles" && {player distance _vehicle < 50}) exitWith {};
if (!alive _vehicle) exitWith {systemchat "<REMOTE_KEY>:THIS VEHICLE IS DAMAGED DO YOU SEE";};
if !(_vehicleOwnerID != "0" && _canDo) exitWith {systemchat "<REMOTE_KEY>:SOMETHING WRONG WITH YOU OR YOU VEHICLE";};
//update by juandayz for free :D
_totalKeys = call epoch_tempKeys;
_temp_keys = _totalKeys select 0;
_temp_keys_names = _totalKeys select 1;	
_hasKey = _vehicleOwnerID in _temp_keys;
_uid = getPlayerUID player;
_oldOwner = (_vehicleOwnerID == _uid);
if !(_hasKey or _oldOwner) exitWith {systemchat "<REMOTE_KEY>:THIS IS NOT YOUR VEHICLE";};
//if is locked
player playActionNow "GesturePoint";
if(locked _vehicle) then {
PVDZE_veh_Lock = [_vehicle,false];
if (local _vehicle) then {
PVDZE_veh_Lock spawn local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
};
null = [objNull,_vehicle,rSAY,"carLock",80] call RE;
systemChat("<REMOTE_KEY>:Vehicle has been unlocked");
if (!isEngineOn _vehicle) then {_vehicle engineOn true;};
}else{ 
//If is unlocked
PVDZE_veh_Lock = [_vehicle,true];
if (local _vehicle) then {
PVDZE_veh_Lock spawn local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
};
null = [objNull,_vehicle,rSAY,"carLock",80] call RE;
systemChat("<REMOTE_KEY>:Vehicle has been locked");
if (isEngineOn _vehicle) then {
if !(_vehicle isKindOf "Helicopter") then {_vehicle engineOn false;
}else{_hf = fuel _vehicle;_vehicle setFuel 0;_vehicle engineOn false;uiSleep 5; _vehicle setFuel _hf;};
};
};

 

 

 

Link to comment
Share on other sites

Hey @juandayz really love this one with keyboard!! Pretty easy, Pretty clean but i have a problem... Want to use yours but also like the option that have the one of where you can eject players from vehicles

but  i dont like the right click actions and touch all that files that the other needs. Yours is more faster and comfortable for players and you use one single file. Is possible merge yours with the option to eject players?

Link to comment
Share on other sites

@gernika  ok here you got.. dont have players to test.. but i do it with a BOT.

remote_key.sqf  (with the eject players adition)

Spoiler

private ["_onLadder","_vehicle","_canDo","_vehicleOwnerID","_totalKeys","_temp_keys","_temp_keys_names","_hasKey","_oldOwner","_uid"];
_vehicle = cursorTarget;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; 
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
_vehicleOwnerID = _vehicle getVariable ["CharacterID","0"];
if !(_vehicle isKindOf "AllVehicles" && {player distance _vehicle < 50}) exitWith {};
if (!alive _vehicle) exitWith {systemchat "<REMOTE_KEY>:THIS VEHICLE IS DAMAGED DO YOU SEE";};
if !(_vehicleOwnerID != "0" && _canDo) exitWith {systemchat "<REMOTE_KEY>:SOMETHING WRONG WITH YOU OR YOU VEHICLE";};
//update by juandayz for free :D
_totalKeys = call epoch_tempKeys;
_temp_keys = _totalKeys select 0;
_temp_keys_names = _totalKeys select 1;	
_hasKey = _vehicleOwnerID in _temp_keys;
_uid = getPlayerUID player;
_oldOwner = (_vehicleOwnerID == _uid);
if !(_hasKey or _oldOwner) exitWith {systemchat "<REMOTE_KEY>:THIS IS NOT YOUR VEHICLE";};
//if is locked
player playActionNow "GesturePoint";
if(locked _vehicle) then {
PVDZE_veh_Lock = [_vehicle,false];
if (local _vehicle) then {
PVDZE_veh_Lock spawn local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
};
null = [objNull,_vehicle,rSAY,"carLock",80] call RE;
systemChat("<REMOTE_KEY>:Vehicle has been unlocked");
if (!isEngineOn _vehicle) then {_vehicle engineOn true;};
}else{ 
//If is unlocked
PVDZE_veh_Lock = [_vehicle,true];
if (local _vehicle) then {
PVDZE_veh_Lock spawn local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
};
null = [objNull,_vehicle,rSAY,"carLock",80] call RE;


_vehicleType = typeOf _vehicle;

	_group = units group player;

	systemChat format ["Ejecting all players not in your group from: %1",_vehicleType];

	{
		if !(_x in _group) then {
			_x action ["eject",_vehicle];
			systemChat format ["Ejecting %1, they are NOT in your group.",name _x];
		};
	} forEach (crew _vehicle);
};
sleep 1;
systemChat("<REMOTE_KEY>:Vehicle has been locked");
if (isEngineOn _vehicle) then {
if !(_vehicle isKindOf "Helicopter") then {
_vehicle engineOn false;
}else{
_hf = fuel _vehicle;
_vehicle setFuel 0;
_vehicle engineOn false;
uiSleep 5; 
_vehicle setFuel _hf;
};
};
};

 

video: (the bot is stupid and get into the car ..he dosnt matter if is locked or not.. but players cant made it.)

Spoiler

 

 

Link to comment
Share on other sites

9 hours ago, juandayz said:

@gernika  ok here you got.. dont have players to test.. but i do it with a BOT.

remote_key.sqf  (with the eject players adition)

  Hide contents


private ["_onLadder","_vehicle","_canDo","_vehicleOwnerID","_totalKeys","_temp_keys","_temp_keys_names","_hasKey","_oldOwner","_uid"];
_vehicle = cursorTarget;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; 
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
_vehicleOwnerID = _vehicle getVariable ["CharacterID","0"];
if !(_vehicle isKindOf "AllVehicles" && {player distance _vehicle < 50}) exitWith {};
if (!alive _vehicle) exitWith {systemchat "<REMOTE_KEY>:THIS VEHICLE IS DAMAGED DO YOU SEE";};
if !(_vehicleOwnerID != "0" && _canDo) exitWith {systemchat "<REMOTE_KEY>:SOMETHING WRONG WITH YOU OR YOU VEHICLE";};
//update by juandayz for free :D
_totalKeys = call epoch_tempKeys;
_temp_keys = _totalKeys select 0;
_temp_keys_names = _totalKeys select 1;	
_hasKey = _vehicleOwnerID in _temp_keys;
_uid = getPlayerUID player;
_oldOwner = (_vehicleOwnerID == _uid);
if !(_hasKey or _oldOwner) exitWith {systemchat "<REMOTE_KEY>:THIS IS NOT YOUR VEHICLE";};
//if is locked
player playActionNow "GesturePoint";
if(locked _vehicle) then {
PVDZE_veh_Lock = [_vehicle,false];
if (local _vehicle) then {
PVDZE_veh_Lock spawn local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
};
null = [objNull,_vehicle,rSAY,"carLock",80] call RE;
systemChat("<REMOTE_KEY>:Vehicle has been unlocked");
if (!isEngineOn _vehicle) then {_vehicle engineOn true;};
}else{ 
//If is unlocked
PVDZE_veh_Lock = [_vehicle,true];
if (local _vehicle) then {
PVDZE_veh_Lock spawn local_lockUnlock;
} else {
publicVariable "PVDZE_veh_Lock";
};
null = [objNull,_vehicle,rSAY,"carLock",80] call RE;


_vehicleType = typeOf _vehicle;

	_group = units group player;

	systemChat format ["Ejecting all players not in your group from: %1",_vehicleType];

	{
		if !(_x in _group) then {
			_x action ["eject",_vehicle];
			systemChat format ["Ejecting %1, they are NOT in your group.",name _x];
		};
	} forEach (crew _vehicle);
};
sleep 1;
systemChat("<REMOTE_KEY>:Vehicle has been locked");
if (isEngineOn _vehicle) then {
if !(_vehicle isKindOf "Helicopter") then {
_vehicle engineOn false;
}else{
_hf = fuel _vehicle;
_vehicle setFuel 0;
_vehicle engineOn false;
uiSleep 5; 
_vehicle setFuel _hf;
};
};
};

 

video: (the bot is stupid and get into the car ..he dosnt matter if is locked or not.. but players cant made it.)

  Reveal hidden contents

 

 

Just a note here,

If you're going to take code from someone elses script, please give them credits

Link to comment
Share on other sites

Quote

Just a note here,

If you're going to take code from someone elses script, please give them credits

sory but this guy comes asking for a merge my code with your option to eject (and he put your link).

 

Just now, gernika said:

Hey @juandayz really love this one with keyboard!! Pretty easy, Pretty clean but i have a problem... Want to use yours but also like the option that have the one of where you can eject players from vehicles

but  i dont like the right click actions and touch all that files that the other needs. Yours is more faster and comfortable for players and you use one single file. Is possible merge yours with the option to eject players?

I dont need give you credits for nothing its more than obvoius that bunch of code its yours:

Spoiler

_vehicleType = typeOf _vehicle;

	_group = units group player;

	systemChat format ["Ejecting all players not in your group from: %1",_vehicleType];

	{
		if !(_x in _group) then {
			_x action ["eject",_vehicle];
			systemChat format ["Ejecting %1, they are NOT in your group.",name _x];
		};
	} forEach (crew _vehicle);
};

 

and im not selling nothing here.. and i dont have this part im my main post, and i post this update with keyboard before yours, and I when i saw your update i had the descency to delete my old right click action and redirect to yours. So dont know what more you want.. And this is not all i want say you,.. but is all i can say in english... so whish u can speack spanish. So i think the best thing for us .. is jsut keep ignoring me as i ignore you. 

 

Here you got the original post ...the guy who have the idea of it. if u want give some credits in your post:

And about main post take a look on the hours

Sin_t_tulo.jpg

and after all of thhis sh***  .. more of the tasted of each one.. great work with the new right click. But i still think you were bad comes here to leve me notes.

Link to comment
Share on other sites

1 hour ago, juandayz said:

sory but this guy comes asking for a merge my code with your option to eject (and he put your link).

 

I dont need give you credits for nothing its more than obvoius that bunch of code its yours:

  Reveal hidden contents


_vehicleType = typeOf _vehicle;

	_group = units group player;

	systemChat format ["Ejecting all players not in your group from: %1",_vehicleType];

	{
		if !(_x in _group) then {
			_x action ["eject",_vehicle];
			systemChat format ["Ejecting %1, they are NOT in your group.",name _x];
		};
	} forEach (crew _vehicle);
};

 

and im not selling nothing here.. and i dont have this part im my main post, and i post this update with keyboard before yours, and I when i saw your update i had the descency to delete my old right click action and redirect to yours. So dont know what more you want.. And this is not all i want say you,.. but is all i can say in english... so whish u can speack spanish. So i think the best thing for us .. is jsut keep ignoring me as i ignore you. 

 

Here you got the original post ...the guy who have the idea of it. if u want give some credits in your post:

And about main post take a look on the hours

Sin_t_tulo.jpg

and after all of thhis sh***  .. more of the tasted of each one.. great work with the new right click. But i still think you were bad comes here to leve me notes.

moved to PM.

Link to comment
Share on other sites

  • 4 weeks later...

Where are you putting the keyboard.sqf

And I'm assuming when you mean custom you mean, copied from dayz_code into my mpmissions somewhere.

I tried to activate it through my custom compiles.sqf but not sure on what to do or how to get it to work.

Spoiler

DZ_KeyDown_EH = compile preprocessFileLineNumbers "dayz_code\compile\keyboard.sqf";

Thanks.

Link to comment
Share on other sites

Just now, jjsnacks77 said:

Where are you putting the keyboard.sqf

And I'm assuming when you mean custom you mean, copied from dayz_code into my mpmissions somewhere.

I tried to activate it through my custom compiles.sqf but not sure on what to do or how to get it to work.

  Hide contents

DZ_KeyDown_EH = compile preprocessFileLineNumbers "dayz_code\compile\keyboard.sqf";

Thanks.

this is exactly what you need to do.

Example  custom compiles.sqf

if (!isDedicated) then {
	diag_log "Loading custom client compiles";
	
	fnc_usec_selfactions = compile preprocessFileLineNumbers "dayz_code\compile\fn_selfActions.sqf";
	DZ_KeyDown_EH = compile preprocessFileLineNumbers "dayz_code\compile\keyboard.sqf";	
};

 

Link to comment
Share on other sites

7 minutes ago, juandayz said:

this is exactly what you need to do.

I thought as much. But in game i get nothing and nothing in logs to say there are any errors. Maybe I'll try again tomorrow! Thanks for the reply.

 

EDIT - Noted, I will see if I have placed this code in the correct location. I'm pretty sure its under the last };

I had read somewhere that it needed to load both dedicated and server.

Cheers!

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