summaryrefslogtreecommitdiff
path: root/npc/commands
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-10-16 17:28:24 -0300
committerJesusaves <cpntb1@ymail.com>2018-10-16 17:28:24 -0300
commitc60dc31c74313d2de85bf88b7edb17d6f75d2fff (patch)
tree445f7bf2932531c78390bb81ae5b167255025c9b /npc/commands
parente3e4bc9d918a86c3b3699a7256fc229231c0de72 (diff)
downloadserverdata-c60dc31c74313d2de85bf88b7edb17d6f75d2fff.tar.gz
serverdata-c60dc31c74313d2de85bf88b7edb17d6f75d2fff.tar.bz2
serverdata-c60dc31c74313d2de85bf88b7edb17d6f75d2fff.tar.xz
serverdata-c60dc31c74313d2de85bf88b7edb17d6f75d2fff.zip
Put some lawn on my cables. :>
Diffstat (limited to 'npc/commands')
-rw-r--r--npc/commands/discord.txt57
1 files changed, 57 insertions, 0 deletions
diff --git a/npc/commands/discord.txt b/npc/commands/discord.txt
new file mode 100644
index 000000000..b5ab69fef
--- /dev/null
+++ b/npc/commands/discord.txt
@@ -0,0 +1,57 @@
+// TMW-2 Script.
+// Author:
+// Jesusalva
+// LawnCable
+// Notes:
+// Controls `discord` table with @discord command.
+// Only useful for TMW2-Discord integration.
+
+- script @discord 32767,{
+ end;
+
+OnCall:
+ // Anti-Flood System
+ if (@discord) {
+ mesc l("You already ran this command today. Please try again at a later time."), 1;
+ close;
+ }
+
+ if (!validatepin())
+ close;
+
+ @discord=1;
+ .@nb = query_sql("select `discord_id` from `discord` WHERE `account_id` == "+getcharid(3), .@discord$);
+
+
+ do
+ {
+ mesn "Lawn Cable";
+ mesq l("Current linked Discord account: @@", .@discord$);
+ next;
+ select
+ l("Change Linked Discord Account"),
+ l("Disconnect"),
+ l("Quit");
+
+ switch (@menu) {
+ case 1:
+ mesc l("Please insert your Discord ID, on the following format: "), 1;
+ mesc l("Usename#0000"), 2;
+ input .@discord$;
+ mes "";
+ query_sql("UPDATE `discord` SET `discord_id` = '"+.@discord$+"' WHERE `account_id` == "+getcharid(3));
+ break;
+ case 2:
+ query_sql("DELETE FROM `discord` WHERE `account_id` == "+getcharid(3));
+ .@discord$="";
+ break;
+ }
+
+ } while (@menu != 3);
+ close;
+
+OnInit:
+ bindatcmd "discord", "@discord::OnCall", 0, 0, 1;
+ end;
+}
+