Jump to content
  • 0

Scroll Wheel Toggle Debug


prominentalex

Question

8 answers to this question

Recommended Posts

  • 0

I'm not sure but, you'll have to do a local compile of the dayz_spaceInterrupt.sqf on your server.

 

Then open that file and around line 118 comment this out:

//if (_dikCode == 210) then {
//		_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
//};

Then make a new file called whatever, this is the file you're pointing at with your scoll wheel menu.

In this add:

if (publicvariabletoexecute) then {
	if (isNil 'debugMonitor') then  // not a big fan of this function :/
	{
		debugMonitor = true;
		[] execvm "custom\debug.sqf";
	}
	else
	{
		debugMonitor = !debugMonitor;
		hintSilent '';
		[] execvm "custom\debug.sqf";
	};
};

I believe you need a publicvariable here since you're accessing the file from another file.
This requires you to rename your debug monitor to debug.sqf and put it in the custom folders though.

This is some of the script I use to toggle my menu, however I use this instead.

if (_dikCode == 0x44) then { //F10

If you want to do a publicvariable, add this in your fn_selectactions.sqf scroll menu script.

publicvariabletoexecute = _yourothervariable; // the your other variable you use is the one mentioned in the fn_selfactions.
publicVariable "publicvariabletoexecute";
[] execVM "custom\toggledatmonitor.sqf"; 

and then open togglethatdatmonitor.sqf and use the previous mentioned publicvariable.


Edit: you might not even need a publicvariable since you're alreadying giving the execute from fn_selfactions a variable. Instead try using the name you put in there inside the if tag I mentioned earlier.

s_player_debugmonitor

or whatever you used in your code.

 

 

Not sure if this works 100%, try it out.

Link to comment
Share on other sites

  • 0

I'm not sure but, you'll have to do a local compile of the dayz_spaceInterrupt.sqf on your server.

 

Then open that file and around line 118 comment this out:

//if (_dikCode == 210) then {
//		_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
//};

Then make a new file called whatever, this is the file you're pointing at with your scoll wheel menu.

In this add:

if (publicvariabletoexecute) then {
	if (isNil 'debugMonitor') then  // not a big fan of this function :/
	{
		debugMonitor = true;
		[] execvm "custom\debug.sqf";
	}
	else
	{
		debugMonitor = !debugMonitor;
		hintSilent '';
		[] execvm "custom\debug.sqf";
	};
};

I believe you need a publicvariable here since you're accessing the file from another file.

This requires you to rename your debug monitor to debug.sqf and put it in the custom folders though.

This is some of the script I use to toggle my menu, however I use this instead.

if (_dikCode == 0x44) then { //F10

If you want to do a publicvariable, add this in your fn_selectactions.sqf scroll menu script.

publicvariabletoexecute = _yourothervariable; // the your other variable you use is the one mentioned in the fn_selfactions.
publicVariable "publicvariabletoexecute";
[] execVM "custom\toggledatmonitor.sqf"; 

and then open togglethatdatmonitor.sqf and use the previous mentioned publicvariable.

Edit: you might not even need a publicvariable since you're alreadying giving the execute from fn_selfactions a variable. Instead try using the name you put in there inside the if tag I mentioned earlier.

s_player_debugmonitor

or whatever you used in your code.

 

 

Not sure if this works 100%, try it out.

Thank you! But how can I do it without the fn_selfactions. I have a scroll wheel menu existing already. In it I want to create a part called debug, so people can scroll wheel, click the menu debug, then click activate debug. I have the scroll wheel all worked out, I just dont know what script to use for debug deactivate.

Link to comment
Share on other sites

  • 0

Are you using fn_selfactions for your menu? Also, I posted the code needed to turn the debug monitor on or off. Just remove the first if tag if you don't want the code to depend on any other variable or syntax. You can just put the line of code in a new sqf file and call it from your menu script.

Link to comment
Share on other sites

  • 0

 

fnc_debug = {

    j0k3r5_stats = true;
    while {j0k3r5_stats} do
{
_logo = "scripts\stats_logo.paa";
_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
 
_nearestCity = nearestLocations [getPos player, ["NameCityCapital","NameCity","NameVillage","NameLocal"],750];
_textCity = "Wilderness";
if (count _nearestCity > 0) then {_textCity = text (_nearestCity select 0)};
 
if (player == vehicle player) then
{
_pic = (gettext (configFile >> 'cfgWeapons' >> (currentWeapon player) >> 'picture'));
}
else
{
_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
};
 
_timeleft= _combattimeout-time;
_kills = player getVariable["zombieKills",0];
_killsH = player getVariable["humanKills",0];
_killsB = player getVariable["banditKills",0];
_humanity = player getVariable["humanity",0];
_headShots = player getVariable["headShots",0];
_zombies =              count entities "zZombie_Base";
_zombiesA =     {alive _x} count entities "zZombie_Base";
 
 
hintSilent parseText format 
[
"
<img size='6' image='%10'/>
<br/>
<t size='1' font='Bitstream'align='center'>TS52.gameservers.com:9314</t><br/>
<t size='1' font='Bitstream'align='center'>wolfpackdayz.enjin.com</t>
<br/>
<br/>
<t size='1' font='Bitstream'align='left'>Location:</t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%11</t><br/>
<t size='1' font='Bitstream'align='left'>Blood:</t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%1</t><br/>
<t size='1' font='Bitstream'align='left'>Humanity:</t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%2</t><br/>
<t size='1' font='Bitstream'align='left'>Headshots:</t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%6</t><br/>
<t size='1' font='Bitstream'align='left'>Friendlies Killed:</t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%3</t><br/>
<t size='1' font='Bitstream'align='left'>Assholes Killed:</t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%4</t><br/>
<t size='1' font='Bitstream'align='left'>Zombies Killed:</t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%5</t><br/>
<t size='1' font='Bitstream'align='left'>Zeds (alive/total): </t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%13/%12</t><br/>
<t size='1' font='Bitstream'align='left'>FPS: </t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%14</t><br/>
<t size='1' font='Bitstream'align='left'>Survived:</t><t size='1' font='Bitstream'align='right'color='#00FFFF'>%7 Dayz</t>
<br/>
<br/>
<t size='1' font='Bitstream'align='center'color='#FFFFFF'>Restart in %8 minutes!</t>
<br/>
<img size='6' image='%9'/>
<br/>
 
 
 
",
r_player_blood, //1
round _humanity, //2
_killsH, //3
_killsB, //4
_kills, //5
_headShots, //6
(dayz_Survived), //7
(180-(round(serverTime/60))), //8 change the 180 to suit your server mins for restarts
_pic, //9
_logo, //10
_textCity, //11
count entities "zZombie_Base", //12
{alive _x} count entities "zZombie_Base", //13
diag_fps //14
 
]; 
sleep 5;
};
};
 
[] spawn fnc_debug;
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...