Jump to content
  • 0

[BASIC GUIDE] 4 ways to add scroll menu options


juandayz

Question

This is a very simple and basic guide to make your own scroll menu options and execute your scripts.

Please fell free to put other ways or whatever do you want about it :) hope help you with it.

Execute an script through fn_selfactions.sqf  Using nearest players from objet or AI

*If u wanna execute an script using an objet or AI as a trigger then at buttom of your custom fn_selfactions  use this structure:

 

  Reveal hidden contents


    
So to complete the structure from above  we gonna use a "TK_CIV_Woman01_EP1" AI id to get the option:

Structure: (at bottom of your fn_selfactions.sqf)

  Reveal hidden contents


//In this case u dont need add nothing more.    

Using cursor target on specific AI/Objet to launch the script. (aim the objet/AI and get a scroll menu option)

First you will need find this in your custom selfactions.sqf

if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {

//the line above says if _canDo variable is present and if the speed player is less or equal to 1 and if cursor target is on the plot pole then { then blabla
you can use the same syntax to make your own scroll menu option... for example if u wanna execute an script each time you put your cursor on a medical tent..("GUE_WarfareBFieldhHospital")


above of

if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {

put:

 

  Reveal hidden contents


    
so each time you aim to GUE_WarfareBFieldhHospital you will got a "HEAL ME" option in your scroll menu.

//In this case you will need add yours
player removeAction s_player_actiontent;
s_player_actiontent = -1;

near the end of fn_selfactions.sqf  so find this lines:

  Reveal hidden contents


  And add above put:

  Reveal hidden contents

this two ways are easy and you can create a new stuff using it.


GET A NEW SCROLL MENU OPTION IF URE INTO A VEHICLE

Well first you will need find it in your custom fn_selfActions.sqf
 

  Reveal hidden contents

bellow it add this structure:
 

  Reveal hidden contents

 


Other way to get a scroll menu option, for example if u wanna get the option all time to use for show rules or something:

create a new sqf.  (name it as you want.. for example  no_use_for_a_name.sqf) and paste inside:

  Reveal hidden contents

now go to your init.sqf and in very bottom paste:

[] execVM "path\to\no_use_for_a_name.sqf";

Now all players get the "RULE" option all time.

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Any idea how to remove the scroll option?
 

Trying to remove get in as pilot if the vehicle is MH6J_DZ. I added this into server_monitor.sqf and it creates another "Get in as pilot" dialog.

 

My code...
    

			while {(alive player) and (typeOf(vehicle player) == "MH6J_DZ")} do {
_vehicle removeAction [localize "str_actions_helipilotseat", "\z\addons\dayz_code\actions\veh_seatActions.sqf",["MoveToPilot",_driver], 0, false, true];
	}; 

 

Link to comment
Share on other sites

  • 0

In your custom self actions file  around line 250, put this:

if (_typeOfCursorTarget == "MH6J_DZ") then {_cursorTarget lockDriver true;}; // Remove the "get in pilot" option.

This will probably not work if the server spawned the vehicle because it says. "This command must be executed where vehicle is local " in the wiki. Then use this:

if (_typeOfCursorTarget == "MH6J_DZ") then {
		if (local _cursorTarget) then {
			PVDZE_veh_Lock spawn local_lockUnlock
		} else {
			publicVariable "PVDZE_veh_Lock";
		};
	};

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...