· 9 years ago · Jul 24, 2017, 03:16 PM
1#-----------------------------------------------
2#SELCT SERVER (FOR BEDWARS) + GET ONLINE PLAYERS
3#-----------------------------------------------
4script options:
5 $ db url jdbc:mysql://mysql.mc-host24.de:3306/db_41537
6 $ db username db_41537
7 $ db password 8c58d8641e
8 $ use permissions
9
10options:
11 Prefix:&8» &eCloud &8â—
12
13on load:
14 broadcast "{@Prefix} &7Alle BEDWARS Server wurden neu geladen."
15 update "CREATE TABLE IF NOT EXISTS `bedwars` ( `id` INT NULL DEFAULT NULL AUTO_INCREMENT , `server` VARCHAR(30) NOT NULL , `mode` VARCHAR(30) NOT NULL , `players` VARCHAR(30) NOT NULL , `online` VARCHAR(30) NOT NULL , UNIQUE (`id`)) ENGINE = InnoDB;"
16
17command /serverjoin:
18 permission: cloud.use
19 permission message: {@Prefix} &cDu hast keinen Zugriff auf die Cloud!
20 trigger:
21 send "{@Prefix} &cYou can join a round, with the teleporter."
22
23command /fwgfviwf:
24 trigger:
25 send "{@Prefix} &cThis server is currently offline."
26
27command /cloud [<text>] [<text>] [<text>]:
28 permission: cloud.use
29 usage: &7/cloud help
30 permission message: {@Prefix} &cDu hast keinen Zugriff auf die Cloud!
31 trigger:
32 if player is op:
33 send "{@Prefix} &4Du kannst die Cloud nicht mit OP &4benutzen!"
34 stop trigger
35 if arg-1 is not set:
36 send ""
37 send "{@Prefix} &7Commands:"
38 send "{@Prefix} "
39 send "{@Prefix} &7/cloud list [<Modus>]"
40 send "{@Prefix} &7/cloud create [<Modus>] [<Name>]"
41 send "{@Prefix} &7/cloud remove [<Modus>] [<Name>]"
42 send "{@Prefix} &7/cloud stop [<Modus>] [<Name>]"
43 send "{@Prefix} &7/cloud start [<Modus>] [<Name>]"
44 send ""
45 stop
46 if arg-1 is not "create" or "remove" or "stop" or "start" or "reload" or "list":
47 send ""
48 send "{@Prefix} &7Commands:"
49 send "{@Prefix} "
50 send "{@Prefix} &7/cloud list [<Modus>]"
51 send "{@Prefix} &7/cloud create [<Modus>] [<Name>]"
52 send "{@Prefix} &7/cloud remove [<Modus>] [<Name>]"
53 send "{@Prefix} &7/cloud stop [<Modus>] [<Name>]"
54 send "{@Prefix} &7/cloud start [<Modus>] [<Name>]"
55 send "{@Prefix} &7/cloud reload [<Modus>] [<Name>]"
56 send ""
57 if arg 1 is "create":
58 if arg 2 is set:
59 if arg 3 is set:
60 send "{@Prefix} &7Create a new Server... &8(&6%arg-2%&8) &8(&6%arg-3%&8)"
61 wait 2 seconds
62 set {_servermode} to arg 2
63 set {_servername} to arg 3
64 set {_players} to "0"
65 set {_online} to "true"
66 update "INSERT INTO `bedwars` (`server`, `mode`, `players`, `online`) VALUES ('%{_servername}%', '%{_servermode}%', '%{_players}%', '%{_online}%')"
67 send "{@Prefix} &7Server &8(&6%{_servername}%&8) &7are now registered."
68 else:
69 send "{@Prefix} &cTry this command: /cloud"
70 if arg 1 is "remove":
71 if arg 2 is "1x1":
72 if arg 3 is set:
73 update "DELETE FROM `bedwars` WHERE `bedwars`.`server` = '%arg-3%'"
74 send "{@Prefix} &cYou have successfully deleted this server"
75 if arg-1 is "list":
76 if arg 2 is not "1x1":
77 send "{@Prefix} &cCurrently, there are only 1x1!"
78 else if arg-2 is "1x1":
79 set {_servern::*} to objects in column "server" from result of query "SELECT * FROM `bedwars`"
80 set {_onlinen::*} to objects in column "online" from result of query "SELECT * FROM `bedwars`"
81 set {_players::*} to objects in column "players" from result of query "SELECT * FROM `bedwars`"
82 set {_slot} to 10
83 set {_offlineslot} to 28
84 open chest with 5 rows named "&b&lCloud" to player
85 format slot 0 of player with black stained glass pane named " " to be unstealable
86 format slot 1 of player with black stained glass pane named " " to be unstealable
87 format slot 2 of player with black stained glass pane named " " to be unstealable
88 format slot 3 of player with black stained glass pane named " " to be unstealable
89 format slot 4 of player with black stained glass pane named " " to be unstealable
90 format slot 5 of player with black stained glass pane named " " to be unstealable
91 format slot 6 of player with black stained glass pane named " " to be unstealable
92 format slot 7 of player with black stained glass pane named " " to be unstealable
93 format slot 8 of player with black stained glass pane named " " to be unstealable
94 format slot 9 of player with black stained glass pane named " " to be unstealable
95 format slot 17 of player with black stained glass pane named " " to be unstealable
96 format slot 18 of player with black stained glass pane named " " to be unstealable
97 format slot 19 of player with black stained glass pane named " " to be unstealable
98 format slot 20 of player with black stained glass pane named " " to be unstealable
99 format slot 21 of player with black stained glass pane named " " to be unstealable
100 format slot 22 of player with black stained glass pane named " " to be unstealable
101 format slot 23 of player with black stained glass pane named " " to be unstealable
102 format slot 24 of player with black stained glass pane named " " to be unstealable
103 format slot 25 of player with black stained glass pane named " " to be unstealable
104 format slot 26 of player with black stained glass pane named " " to be unstealable
105 format slot 27 of player with black stained glass pane named " " to be unstealable
106 format slot 35 of player with black stained glass pane named " " to be unstealable
107 format slot 36 of player with black stained glass pane named " " to be unstealable
108 format slot 37 of player with black stained glass pane named " " to be unstealable
109 format slot 38 of player with black stained glass pane named " " to be unstealable
110 format slot 39 of player with black stained glass pane named " " to be unstealable
111 format slot 40 of player with black stained glass pane named " " to be unstealable
112 format slot 41 of player with black stained glass pane named " " to be unstealable
113 format slot 42 of player with black stained glass pane named " " to be unstealable
114 format slot 43 of player with black stained glass pane named " " to be unstealable
115 format slot 44 of player with black stained glass pane named " " to be unstealable
116 format slot 10 of player with blue stained clay named "&cCurrently, no server is online!" to be unstealable
117 format slot 28 of player with blue stained clay named "&cCurrently, no server is offline!" to be unstealable
118 loop {_servern::*}:
119 loop {_onlinen::*}:
120 if loop-value-2 is "true":
121 loop {_players::*}:
122 if {_done.%loop-index-1%} is not set:
123 if {_done.%loop-index-2%} is not set:
124 if {_done.%loop-index-3%} is not set:
125 format slot {_slot} of player with lime stained clay named "&bBedwars" with lore "&7Server: &b%loop-value-1%||&7Online: &aonline||&7Mode: &a1x1||&7Spieler: &a%loop-value-3%" to run [execute player command "serverjoin"]
126 add 1 to {_slot}
127 set {_done.%loop-index-1%} to true
128 set {_done.%loop-index-2%} to true
129 set {_done.%loop-index-3%} to true
130 else if loop-value-2 is "false":
131 loop {_players::*}:
132 if {_done.%loop-index-1%} is not set:
133 if {_done.%loop-index-2%} is not set:
134 if {_done.%loop-index-3%} is not set:
135 format slot {_offlineslot} of player with red stained clay named "&bBedwars" with lore "&7Server: &b%loop-value-1%||&7Online: &coffline||&7Mode: &a1x1||&7Spieler: &a%loop-value-3%" to run [execute player command "fwgfviwf"]
136 add 1 to {_offlineslot}
137 set {_done.%loop-index-1%} to true
138 set {_done.%loop-index-2%} to true
139 set {_done.%loop-index-3%} to true
140 else if arg 2 is not set:
141 send "{@Prefix} &cYou forgot something. &8(&61x1&8)"
142 if arg 1 is "start":
143 if arg 2 is set:
144 if arg 3 is set:
145 set {_online} to "true"
146 send "{@Prefix} &7Starting..."
147 update "UPDATE bedwars SET `online` = '%{_online}%' WHERE server = '%arg-3%'"
148 update "INSERT INTO `bedwars` (`online`) VALUES ('%{_online}%')"
149 send "{@Prefix} &7This server are now online! &8(&6%arg 3%&8)"
150 stop
151 else:
152 send "{@Prefix} &cThis server doesn't exist."
153 stop
154 else if arg 2 is not set:
155 send "{@Prefix} &cYou forgot something. &8(&61x1&8)"
156 if arg 1 is "stop":
157 if arg 2 is set:
158 if arg 3 is set:
159 set {_online} to "false"
160 send "{@Prefix} &cThe cloud now stop this server.. &8(&6%arg-3%&8)"
161 update "UPDATE bedwars SET `online` = '%{_online}%' WHERE server = '%arg-3%'"
162 update "INSERT INTO `bedwars` (`online`) VALUES ('%{_online}%')"
163 send "{@Prefix} &7You stoped this server! &8(&6%arg 3%&8)"
164 stop
165 else:
166 send "{@Prefix} &cThis server doesn't exist."
167 stop
168 else if arg 2 is not set:
169 send "{@Prefix} &cYou forgot something. &8(&61x1&8)"