summaryrefslogtreecommitdiff
path: root/world/map/npc/functions/motdconfig.txt
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2015-05-12 07:23:10 -0400
committermekolat <mekolat@users.noreply.github.com>2015-05-12 07:23:10 -0400
commit1deaa280cb8e5252d0a01534bba5097d93c09064 (patch)
treecb0f6eb12f5d8434870a693f54e0bbca83c8f68d /world/map/npc/functions/motdconfig.txt
parente0834f290b1225bc3090e3d43f18ec1047868cf9 (diff)
downloadserverdata-1deaa280cb8e5252d0a01534bba5097d93c09064.tar.gz
serverdata-1deaa280cb8e5252d0a01534bba5097d93c09064.tar.bz2
serverdata-1deaa280cb8e5252d0a01534bba5097d93c09064.tar.xz
serverdata-1deaa280cb8e5252d0a01534bba5097d93c09064.zip
add motd config
Diffstat (limited to 'world/map/npc/functions/motdconfig.txt')
-rw-r--r--world/map/npc/functions/motdconfig.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/world/map/npc/functions/motdconfig.txt b/world/map/npc/functions/motdconfig.txt
new file mode 100644
index 00000000..f2541ea6
--- /dev/null
+++ b/world/map/npc/functions/motdconfig.txt
@@ -0,0 +1,39 @@
+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:
+ 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), "##7Server : " + $@MOTD$[@motd_index];
+ set @motd_index, @motd_index + 1;
+ if($@MOTD$[@motd_index] == "") goto L_Return;
+ goto L_MOTD;
+
+L_Return:
+ return;
+}