summaryrefslogtreecommitdiff
path: root/npc/functions/motdconfig.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/motdconfig.txt')
-rw-r--r--npc/functions/motdconfig.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/npc/functions/motdconfig.txt b/npc/functions/motdconfig.txt
new file mode 100644
index 00000000..dcb54dcc
--- /dev/null
+++ b/npc/functions/motdconfig.txt
@@ -0,0 +1,38 @@
+function script MOTDConfig {
+ mes "[MOTD]";
+ mes "lines:";
+ mes "---";
+ @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.";
+ $@MOTD_Disabled = !$@MOTD_Disabled;
+ close2;
+ return;
+
+S_Lines:
+ mes @line + ": "+ $@MOTD$[@line];
+ @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];
+ @motd_index = @motd_index + 1;
+ if($@MOTD$[@motd_index] == "") goto L_Return;
+ goto L_MOTD;
+
+L_Return:
+ return;
+}