"Server menu" script for DayZ. Interested?

Inkko

OpenDayZ Rockstar!
Yeah, was looking for a good menu script.
Here is what I had for the player menu on my server when I had one several years ago, you can remove and adjust how you want to, its more for reference then copy paste and have it working. I had keybinds to dialogs and stuff as well.

added at bottom of fn_selfactions.sqf
Code:
if (_canDo and (speed player <= 1)) then {
        if (s_player_menu < 0) then {
            s_player_menu = player addaction [("<t color=""#0074E8"">" + ("Player Menu") +"</t>"),"player_menu.sqf","",5,false,true,"",""];
        };
    } else {
        player removeAction s_player_menu;
        s_player_menu = -1;
};

player_menu.sqf in root of mission
Code:
player_menu =
[
    ["",true],
    ["Server info", [2], "#USER:sInfo", -5, [["expression", ""]], "1", "1"],
    ["View distance", [3], "#USER:vd_menu", -5, [["expression", ""]], "1", "1"],
    ["Group Management", [4],  "", -5, [["expression","execVM 'dzgm\loadGroupManagement.sqf';"]], "1", "1"],
    ["Weather Options", [6], "#USER:vd_weather", -5, [["expression", ""]], "1", "1"],
    ["Toggle Earplugs", [7],  "", -5, [["expression","execVM 'earplugs.sqf';"]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
];

vd_menu =
[
    ["",true],
    [" 600 m", [2],  "", -5, [["expression", "setViewDistance 600"]], "1", "1"],
    [" 800 m", [3],  "", -5, [["expression", "setViewDistance 800"]], "1", "1"],
    ["1000 m", [4],  "", -5, [["expression", "setViewDistance 1000"]], "1", "1"],
    ["1250 m", [5],  "", -5, [["expression", "setViewDistance 1250"]], "1", "1"],
    ["1500 m", [6],  "", -5, [["expression", "setViewDistance 1500"]], "1", "1"],
    ["2000 m", [7],  "", -5, [["expression", "setViewDistance 2000"]], "1", "1"],
    ["3000 m", [8],  "", -5, [["expression", "setViewDistance 3000"]], "1", "1"],
    ["4000 m", [9],  "", -5, [["expression", "setViewDistance 4000"]], "1", "1"]
];

sInfo =
[
    ["",true],
    ["Contact info", [2],  "", -5, [["expression","'ContactInfo' execVM 'serverinfo.sqf';"]], "1", "1"],
    ["Rules", [3],  "", -5, [["expression","'Rules' execVM 'serverinfo.sqf';"]], "1", "1"],
    ["Server tips", [4],  "", -5, [["expression","'ServerTips' execVM 'serverinfo.sqf';"]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
];

vd_weather =
[
    ["",true],
    ["  = Weather Options =", [-1], "", -5, [], "1", "0"],
    ["Weather Info", [2],  "", -5, [["expression","'Weather' execVM 'serverinfo.sqf'"]], "1", "1"],
    ["Toggle Fog", [3],  "", -5, [["expression","['Fog'] execVM 'toggle.sqf';"]], "1", "1"],
    ["Toggle Rain", [4],  "", -5, [["expression","['Rain'] execVM 'toggle.sqf';"]], "1", "1"],
    ["Toggle Overcast", [5],  "", -5, [["expression","['Overcast'] execVM 'toggle.sqf';"]], "1", "1"],
    ["Toggle Random Weather", [6],  "", -5, [["expression","['Random'] execVM 'toggle.sqf';"]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Exit", [13], "", -3, [["expression", ""]], "1", "1"],
    ["= Atmospheric Settings =", [-1], "", -5, [], "1", "0"]
];
showCommandingMenu "#USER:player_menu";

serverinfo.sqf in root of mission
Code:
switch (_this) do {
    case 'Rules': {
        'Rules' hintC parseText format ["
            <t align='center'></t><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>No spamming side chat</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>No hacking / Glitching / Duping / Exploiting </t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>No advertising other servers</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>No demeaning races</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>No player impersonating</t><br/><br/>
        "];
        uiSleep .1;
    };
    case 'ContactInfo': {
        'Contact Info' hintC parseText format ["
            <t align='center'></t><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>Website:</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>Discord:</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>DM an admin in discord or message an admin on the website.</t><br/><br/>
        "];
        uiSleep .1;
    };
    case 'ServerTips': {
        'Server Tips' hintC parseText format ["
            <t align='center'></t><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>AI Missions are marked on map</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>Group system: Right control opens group menu</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>'I' to open crating menu.</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>Humanity now requires you to put on the civilian clothing of your choice.</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>8 key opens player menu dialog.</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>9 key opens weather menu dialog.</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>0 (zero) key opens group menu dialog.</t><br/><br/>
        "];
        uiSleep .1;
    };
    case 'Weather': {
        'Server Tips' hintC parseText format ["
            <t align='center'></t><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>Weather is completely for atmospheric purposes.</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>Any change requires a couple seconds to take effect.</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>Any changes will only show for you! No other player will be effected.</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>Fog, Rain, and Overcast are toggleable between full and none.</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>Random will randomize fog, rain, and overcast.</t><br/><br/>
            <t size='1.1' shadow='1' align='left' color='#FFFFFF'>You can toggle the other settings along side the random option to turn on or maxamize results.</t><br/><br/>
        "];
        uiSleep .1;
    };
};

playermenu.hpp dialog - https://pastebin.com/0TDvZ733
dialogs 'BR_PlayerMenu' and 'BR_PlayerMenuWeather' included
place in root and add at bottom of description.ext #include "playermenu.hpp"

in keyboard.sqf add in if (isNil "keyboard_keys") then { section
Code:
_playermenu = {
        if (!dayz_isSwimming and !dialog) then {
            closeDialog 0;createdialog 'BR_PlayerMenu';
        };
        _handled = true;
    };
    
    _playermenu2 = {
        if (!dayz_isSwimming and !dialog) then {
            closeDialog 0;createdialog 'BR_PlayerMenuWeather';
        };
        _handled = true;
    };

Code:
[[DIK_8], _playermenu] call _addArray;
    [[DIK_9], _playermenu2] call _addArray;
 
Last edited:
Top