summaryrefslogtreecommitdiff
path: root/world/map/npc/functions/motdconfig.txt
blob: 2d0ae049ac1f73aa912ff8b110ae9bfa8d1a69a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function|script|MOTDConfig
{
    mes "[MOTD]";
    mes "lines:";
    mes "---";
    set @line, 0;
    callsub S_Lines;
    mes "---";
    mes "Enabled: " + !($@MOTD_Disabled);
    next;
    menu
        "toggle|Toggle MOTD", L_Toggle;

L_Toggle:
    gmlog strcharinfo(0) + " enabled or disabled the MOTD.";
    set $@MOTD_Disabled, !$@MOTD_Disabled;
    close2;
    return;

S_Lines:
    mes @line + ": "+ $@MOTD$[@line];
    set @line, @line + 1;
    if(@line != getarraysize($@MOTD$)) goto S_Lines;
    return;
}

function|script|DisplayMOTD
{
    if($@MOTD_Disabled || $@MOTD$[0] == "") goto L_Return;
    goto L_MOTD;

L_MOTD:
    message strcharinfo(0), "Server : " + $@MOTD$[@motd_index];
    set @motd_index, @motd_index + 1;
    if($@MOTD$[@motd_index] == "") goto L_Return;
    goto L_MOTD;

L_Return:
    return;
}