Jump to content

Custom debug monitor


Rules

Recommended Posts

  • 1 month later...

make a sqf file called "debug_init.sqf" and paste this inside:

Spoiler

if (isnil "debuginit") then {debuginit = true;};

    if (debuginit) then
    {
        []spawn
        {
            private["_veh", "_idb", "_idb2"];
            _idb = -1;
            while {alive player} do
            {
                if (_idb == -1) then
                {
                    _idb = (vehicle player) addaction [("<t color=""#08088A"">" + ("Monitor On/Off") +"</t>"),"custom\debug\custom_monitor.sqf","",0,false,true,"",""];
                    _veh = vehicle player;
                };
                if (_veh != vehicle player) then
                {
                    _veh removeAction _idb;
                    _idb = -1;      
                };
                Sleep 2;
            };
        };
        debuginit = false;
    };
    waituntil {!alive player ; sleep 2;};
    debuginit = true;

Now make another sqf file called "custom_monitor.sqf" and paste this inside:

Spoiler

if (isNil "debugMonitor") then { debugMonitor = false; };
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {
    debugMonitor = true;
    while {debugMonitor} do
    {
    
    
     hintSilent parseText format ["
    <t size='0.75' font='Bitstream' align='left' color='#6476ff'>survivors: </t><t size='0.95' font='Bitstream' align='left'color='#FF0000'>%7</t>
    <t size='0.75' font='Bitstream' align='right' color='#6476ff'>Restart: </t><t size='0.95' font='Bitstream' align='right'color='#FF0000'>%9 mins.</t><br/>
    
    <t size='0.75' font='Bitstream' align='left' color='#FFBF00'>Zombies: </t><t size='0.95' font='Bitstream' align='right'color='#FFBF00'>%2</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#ee6023'>Murders: </t><t size='0.95' font='Bitstream' align='right'color='#ee6023'>%4</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#ee6023'>Bandits kills: </t><t size='0.95' font='Bitstream' align='right'color='#ee6023'>%5</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#ee6023'>Shoots at brain: </t><t size='0.95' font='Bitstream' align='right'color='#ee6023'>%3</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#a3ff00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'color='#a3ff00'>%6</t><br/>
    <t size='0.75' font='Bitstream' align='left' color='#ff0000'>Blood: </t><t size='0.95' font='Bitstream' align='right'color='#FF0000'>%8</t><br/>
    <t size='0.95' font='Bitstream' align='center' color='#2d3469'>server name</t><br/>
    <t size='0.65' font='Bitstream' align='center'>toggle whit mousewheel</t>

    ",
    (name player), //1
    (player getVariable['zombieKills', 0]), //2
    (player getVariable['headShots', 0]),  //3
    (player getVariable['humanKills', 0]), //4
    (player getVariable['banditKills', 0]), //5
    (player getVariable['humanity', 0]), //6
    (playersNumber west), //(count playableUnits), //7
    r_player_blood, //8
    (180-(round(serverTime/60))) //9
    
    

];
sleep 2;
};
};

*** here make a folder called "custom" and inside make another folder called "debug" then paste the 2 sqf inside custom\debug\

***at last go to your init.sqf open it and paste this at very botton :

Spoiler

//debug
[] execVM "custom\debug\debug_init.sqf";
[] execVM "custom\debug\custom_monitor.sqf";

.now go to your game and use mousewheel to toggle the debug monitor.

Link to comment
Share on other sites

if u have one..rename it ass custom_debug.sqf  and  just remove all about dik code..  just leave while debug monitor do...  and add at top 

Spoiler

if (isNil "debugMonitor") then { debugMonitor = false; };
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {
    debugMonitor = true;
    while {debugMonitor} do
    {

and in bottom .. remove all about sleep.. and paste

Spoiler

sleep 2;
};
};

here an example whit noxsicarius debug monitor.

ORIGINAL CODE.

Spoiler

private["_serverTitle","_serverSubtitle","_teamspeak","_time","_hours","_minutes","_restartTime"];

/************************* CONFIG *************************/

    _serverTitle = "SERVER NAME HERE";
    _serverSubtitle = "WEBSITE/MESSAGE HERE"; // DELETE line 40 if you don't want this to show
    _teamspeak = "Teamspeak: TEAMSPEAK IP HERE"; // DELETE line 50 if you don't want this to show
    _restartTime = 180; //total time before server restart (3hrs = 180 minutes)
    
/************************* CONFIG *************************/

while {debugMonitor} do {

    _time = (round(_restartTime-(serverTime)/60));     //Want it to count up instead of down? use _time = (round serverTime)/60;
    _hours = (floor(_time/60));
    _minutes = (_time - (_hours * 60));
    
    switch(_minutes) do
    {
        case 9: {_minutes = "09"};
        case 8: {_minutes = "08"};
        case 7: {_minutes = "07"};
        case 6: {_minutes = "06"};
        case 5: {_minutes = "05"};
        case 4: {_minutes = "04"};
        case 3: {_minutes = "03"};
        case 2: {_minutes = "02"};
        case 1: {_minutes = "01"};
        case 0: {_minutes = "00"};
    };
    
    // Want to change the colors? http://www.w3schools.com/colors/colors_picker.asp
    // Use the #xxxxxx color code you get on that website and place it with any of the
    //<t size..... lines below format: color='#xxxxxx'
    
    // You can delete any of the <t size..... lines that you do not want
    // THE LAST LINE MUST HAVE A ",
    hintSilent parseText format ["
        <t size='1.25' font='Bitstream' align='center' color='#5882FA'>%1</t><br/>
        <t size='1.05' font='Bitstream' align='center' color='#5882FA'>%2</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'></t><t size='0.95 'font='Bitstream' align='right'></t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='0.95 'font='Bitstream' align='right'>%3</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'></t><t size='0.95 'font='Bitstream' align='right'></t><br/>
        <t size='1.15' font='Bitstream'align='center' color='#5882FA'>%10</t><br/>
        <t size='1.15' font='Bitstream'align='center' color='#5882FA'>Server restart in %11:%12</t><br/>", //ONLY last line needs the ",
            
        _serverTitle, // Used on line 40 for server title
        _serverSubtitle, // Used on line 41 for server subtitle
        (count playableUnits), // Used on line 43 for player count
        (player getVariable['humanKills', 0]), // Used on line 44 for murder count
        (player getVariable['banditKills', 0]), // Used on line 45 for bandit kill count
        (player getVariable['zombieKills', 0]), // Used on line 46 for zombie kill count
        (player getVariable['humanity', 0]), // Used on line 47 for humanity count
        (player getVariable['USEC_BloodQty', r_player_blood]), // Used on line 48 for player blood amount
        (round diag_fps), // Used on line 49 for frames per second
        _teamspeak, // Used on line 51 for frames per second
        _hours, // Used on line 52 to display hours
        _minutes // Used on line 52 to display minutes
    ];
    
    //Don't modify this part
    sleep 0.5;
};

CUSTOM CODE TO TOGGLE WHIT MOUSEWHEEL

Spoiler

if (isNil "debugMonitor") then { debugMonitor = false; };
        if (debugMonitor) then {
            debugMonitor = false;
            hintSilent "";
        } else {
    debugMonitor = true;

private["_serverTitle","_serverSubtitle","_teamspeak","_time","_hours","_minutes","_restartTime"];

/************************* CONFIG *************************/

    _serverTitle = "SERVER NAME HERE";
    _serverSubtitle = "WEBSITE/MESSAGE HERE"; // DELETE line 40 if you don't want this to show
    _teamspeak = "Teamspeak: TEAMSPEAK IP HERE"; // DELETE line 50 if you don't want this to show
    _restartTime = 180; //total time before server restart (3hrs = 180 minutes)
    
/************************* CONFIG *************************/

while {debugMonitor} do {

    _time = (round(_restartTime-(serverTime)/60));     //Want it to count up instead of down? use _time = (round serverTime)/60;
    _hours = (floor(_time/60));
    _minutes = (_time - (_hours * 60));
    
    switch(_minutes) do
    {
        case 9: {_minutes = "09"};
        case 8: {_minutes = "08"};
        case 7: {_minutes = "07"};
        case 6: {_minutes = "06"};
        case 5: {_minutes = "05"};
        case 4: {_minutes = "04"};
        case 3: {_minutes = "03"};
        case 2: {_minutes = "02"};
        case 1: {_minutes = "01"};
        case 0: {_minutes = "00"};
    };
    
    // Want to change the colors? http://www.w3schools.com/colors/colors_picker.asp
    // Use the #xxxxxx color code you get on that website and place it with any of the
    //<t size..... lines below format: color='#xxxxxx'
    
    // You can delete any of the <t size..... lines that you do not want
    // THE LAST LINE MUST HAVE A ",
    hintSilent parseText format ["
        <t size='1.25' font='Bitstream' align='center' color='#5882FA'>%1</t><br/>
        <t size='1.05' font='Bitstream' align='center' color='#5882FA'>%2</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'></t><t size='0.95 'font='Bitstream' align='right'></t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='0.95 'font='Bitstream' align='right'>%3</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
        <t size='0.95' font='Bitstream' align='left' color='#FFBF00'></t><t size='0.95 'font='Bitstream' align='right'></t><br/>
        <t size='1.15' font='Bitstream'align='center' color='#5882FA'>%10</t><br/>
        <t size='1.15' font='Bitstream'align='center' color='#5882FA'>Server restart in %11:%12</t><br/>", //ONLY last line needs the ",
            
        _serverTitle, // Used on line 40 for server title
        _serverSubtitle, // Used on line 41 for server subtitle
        (count playableUnits), // Used on line 43 for player count
        (player getVariable['humanKills', 0]), // Used on line 44 for murder count
        (player getVariable['banditKills', 0]), // Used on line 45 for bandit kill count
        (player getVariable['zombieKills', 0]), // Used on line 46 for zombie kill count
        (player getVariable['humanity', 0]), // Used on line 47 for humanity count
        (player getVariable['USEC_BloodQty', r_player_blood]), // Used on line 48 for player blood amount
        (round diag_fps), // Used on line 49 for frames per second
        _teamspeak, // Used on line 51 for frames per second
        _hours, // Used on line 52 to display hours
        _minutes // Used on line 52 to display minutes
    ];
    
    
sleep 2;
};
};

remember use it whit "debug_init.sqf"  and the call in init.sqf 

//debug
[] execVM "custom\debug\debug_init.sqf";
[] execVM "custom\debug\custom_monitor.sqf";

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...