· 8 years ago · May 21, 2018, 01:26 AM
1script options:
2
3 $ db url jdbc:mysql://193.70.81.37/mc3184
4
5 $ db username mc3184
6
7 $ db password 168a46ac61
8
9options:
10
11 Logo: &6&lIgnis&7 »
12
13 BanHeader: &4✖ &6&lIgnis &4✖
14
15 KickHeader: &4✖ &6&lIgnis &4✖
16
17 Activated: &fLoaded punishment system.
18
19
20
21 Format_Days: days
22
23 Format_Day: day
24
25 Format_Hours: hours
26
27 Format_Hour: hour
28
29 Format_Minutes: minutes
30
31 Format_Minute: minute
32
33 Format_Seconds: seconds
34
35 Format_Second: second
36
37
38
39 Ban_Perm_Line1: &7You've been banned from &6Ignis &4PERMANENTLY&c.
40
41 Ban_Perm_Line2: &7Reason: &c%{_getReason}%
42
43 Ban_Perm_Line3: &6» &7Appeal at @IgnisUHC &6«
44
45
46
47 Ban_Temp_Line1: &7You've been banned from &6Ignis&c for &c%{_parameter}%&c.
48
49 Ban_Temp_Line2: &7Reason: &c%{_getReason}%
50
51 Ban_Temp_Line3: %nl%&7Remaining time: &a%{_getUNIXTime}%
52
53 Ban_Temp_Line4: %nl%&6» &7Appeal at @IgnisUHC &6«
54
55
56
57 Kick_Line1: &cYou've been kicked by &a%player%&c.
58
59 Kick_Line2: &cYou've been kicked by &aCONSOLE&c.
60
61 Kick_Reason: &7Reason: &c%arg-2%
62
63
64
65 Mute_Perm: &6» &cYou've been muted &4PERMANENTLY&c.
66
67 Mute_Reason: &6» &7Reason: &c%{_getReason}%
68
69
70
71 Mute_Temp: &6» &cYou've been muted for &e%{_parameter}%&c.
72
73 Mute_Reason: &6» &7Reason: &c%{_getReason}%
74
75 Mute_TimeEnd: &6» &7Remaining time: &a%{_getUNIXTime}%
76
77
78
79 ConsoleName: CONSOLE
80
81 NoPermission: &fYou do not have permissions to use this command!
82
83 NoName: &cPlease enter a vaild player name
84
85 NotAllowedSize: &cPlease select an integer between 1 and 12
86
87 NoSelfKick: &cYou can't kick yourself
88
89 NoSelfBan: &cYou can't ban yourself
90
91 NoSelfMute: &cYou can't mute yourself
92
93 AlreadyBanned: &cThis player has been already banned
94
95 AlreadyMuted: &cThis player has been already muted
96
97 PlayerNotBanned: &cThis player isn't banned
98
99 PlayerNotMuted: &cThis player isn't muted
100
101 NoInteger: &cPlease enter an integer
102
103 NoTime: &cPlease enter a vaild parameter (seconds, minutes, hours, days)
104
105 NoReason: &cPlease enter a reason
106
107 PlayerNotFound: &cThat player couldn't be found
108
109 IPNotFound: &cThat IP address couldn't be found
110
111 PlayerWasUnbanned: &aThe player has been unbanned
112
113 PlayerWasUnmuted: &aThe player has been unmuted
114
115
116
117 NoHistory: &7No logs were found from that player
118
119
120
121# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
122
123
124
125on load:
126
127 $ thread
128
129 update "CREATE TABLE if NOT EXISTS `Ban` (`Player` varchar(255),`Time` varchar(255),`Executed` varchar(255),`Reason` varchar(255),`FromPlayer` varchar(255))"
130
131 $ thread
132
133 update "CREATE TABLE if NOT EXISTS `Mute` (`Player` varchar(255),`Time` varchar(255),`Executed` varchar(255),`Reason` varchar(255),`FromPlayer` varchar(255))"
134
135 $ thread
136
137 update "CREATE TABLE if NOT EXISTS `IP` (`Player` varchar(255),`IP` varchar(255),`UUID` varchar(255))"
138
139 $ thread
140
141 update "CREATE TABLE if NOT EXISTS `History` (`Player` varchar(255),`Log` varchar(255))"
142
143 $ thread
144
145 update "CREATE TABLE if NOT EXISTS `Presets` (`Name` varchar(255),`Command` varchar(255))"
146
147 if {Bans.Tables.Alter} is not set:
148
149 set {Bans.Tables.Alter} to true
150
151 $ thread
152
153 update "ALTER TABLE Ban ADD UNIQUE (Player, Time, Executed, Reason, FromPlayer)"
154
155 $ thread
156
157 update "ALTER TABLE Mute ADD UNIQUE (Player, Time, Executed, Reason, FromPlayer)"
158
159 $ thread
160
161 update "ALTER TABLE IP ADD UNIQUE (Player, UUID)"
162
163 $ thread
164
165 update "ALTER TABLE History ADD UNIQUE (Player, Log)"
166
167 $ thread
168
169 update "ALTER TABLE Presets ADD UNIQUE (Name, Command)"
170
171 broadcast "{@Logo} {@Activated}"
172
173
174
175function getIP(p_name:text) :: text:
176
177 set {_SetResult::*} to objects in column "IP" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
178
179 set {_getResult} to false
180
181 loop {_SetResult::*}:
182
183 set {_getResult} to true
184
185 if {_getResult} is true:
186
187 return "%{_SetResult::*}%"
188
189 else:
190
191 return "false"
192
193
194
195function getUUID(p_name:text) :: text:
196
197 set {_SetResult::*} to objects in column "UUID" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
198
199 set {_getResult} to false
200
201 loop {_SetResult::*}:
202
203 set {_getResult} to true
204
205 if {_getResult} is true:
206
207 return "%{_SetResult::*}%"
208
209 else:
210
211 return "false"
212
213
214
215function getAccounts(p_name: text) :: text:
216
217 if {_p_name} does not contain ".":
218
219 set {_ip} to getIP({_p_name})
220
221 else:
222
223 set {_ip} to {_p_name}
224
225 set {_SetResult::*} to objects in column "Player" from result of query "SELECT Player FROM IP WHERE IP = '%{_ip}%'"
226
227 return "%{_SetResult::*}%"
228
229
230
231function getPlayers(p_name: text = "") :: texts:
232
233 set {_SetResult::*} to objects in column "Player" from result of query "SELECT Player FROM IP WHERE Player LIKE '%%%{_p_name}%%%'"
234
235 if {_SetResult::*} is set:
236
237 return {_SetResult::*}
238
239
240
241function RemoveBannedPlayer(p_name:text):
242
243 set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM Ban WHERE Player = '%{_p_name}%'"
244
245 set {_getResult} to false
246
247 loop {_SetResult::*}:
248
249 if loop-value is {_p_name}:
250
251 set {_getResult} to true
252
253 if {_getResult} is true:
254
255 update "DELETE FROM Ban WHERE Player = '%{_p_name}%'"
256
257
258
259function getBannedPlayer(p_name:text, column:text) :: text:
260
261 set {_SetResult::*} to objects in column "%{_column}%" from result of query "SELECT * FROM Ban WHERE Player = '%{_p_name}%'"
262
263 if {_column} is not "Player":
264
265 return "%{_SetResult::*}%"
266
267 else:
268
269 set {_getResult} to false
270
271 loop {_SetResult::*}:
272
273 if loop-value is {_p_name}:
274
275 set {_getResult} to true
276
277 if {_getResult} is true:
278
279 return "true"
280
281 else:
282
283 return "false"
284
285
286
287function MutePlayer(p_name:text, p_time:text, p_reason:text, from:text):
288
289 set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM Mute WHERE Player = '%{_p_name}%'"
290
291 set {_getResult} to false
292
293 loop {_SetResult::*}:
294
295 if loop-value is {_p_name}:
296
297 set {_getResult} to true
298
299 if {_getResult} is false:
300
301 update "INSERT INTO `Mute` (`Player`,`Time`,`Executed`,`Reason`,`FromPlayer`) VALUES ('%{_p_name}%', '%{_p_time}%', '%unix time%', '%{_p_reason}%', '%{_from}%')"
302
303
304
305function getMutedPlayer(p_name:text, column:text) :: text:
306
307 set {_SetResult::*} to objects in column "%{_column}%" from result of query "SELECT * FROM Mute WHERE Player = '%{_p_name}%'"
308
309 if {_column} is not "Player":
310
311 return "%{_SetResult::*}%"
312
313 else:
314
315 set {_getResult} to false
316
317 loop {_SetResult::*}:
318
319 if loop-value is {_p_name}:
320
321 set {_getResult} to true
322
323 if {_getResult} is true:
324
325 return "true"
326
327 else:
328
329 return "false"
330
331
332
333function RemoveMutedPlayer(p_name:text):
334
335 set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM Mute WHERE Player = '%{_p_name}%'"
336
337 set {_getResult} to false
338
339 loop {_SetResult::*}:
340
341 if loop-value is {_p_name}:
342
343 set {_getResult} to true
344
345 if {_getResult} is true:
346
347 update "DELETE FROM Mute WHERE Player = '%{_p_name}%'"
348
349
350
351# UNIX algorithm calculation in Skript - isn't it awesome? ã‚·
352
353# This calculation method may take some performance while calculating big numbers but it's the easiest way.
354
355# I've already used this method in an Java algorithm.
356
357function UNIX_Algorithm(executed:text, time:text, parameter:text) :: text:
358
359 set {_executed} to {_executed} parsed as number
360
361 if {_parameter} contains "second":
362
363 set {_time} to {_time} parsed as number
364
365 else:
366
367 if {_parameter} contains "minute":
368
369 set {_time} to {_time} parsed as number
370
371 set {_time} to ({_time}*60)
372
373 else:
374
375 if {_parameter} contains "hour":
376
377 set {_time} to {_time} parsed as number
378
379 set {_time} to ((({_time}*60)*60))
380
381 else:
382
383 if {_parameter} contains "day":
384
385 set {_time} to {_time} parsed as number
386
387 set {_time} to (((({_time}*24)*60)*60))
388
389 set {_Calculate.UNIX} to ({_executed}+{_time})
390
391 set {_Calculate.Now.UNIX} to unix time
392
393 set {_Calculate.Result} to ({_Calculate.UNIX}-{_Calculate.Now.UNIX})
394
395 set {_UNIX.DAYS} to 0
396
397 set {_UNIX.HOURS} to 0
398
399 set {_UNIX.MINUTES} to 0
400
401 set {_UNIX.SECONDS} to 0
402
403 while {_Calculate.Result} is bigger or equal to 86400:
404
405 set {_UNIX.DAYS} to ({_UNIX.DAYS}+1)
406
407 set {_Calculate.Result} to ({_Calculate.Result}-86400)
408
409 if {_Calculate.Result} is smaller than 86400:
410
411 while {_Calculate.Result} is bigger or equal to 3600:
412
413 set {_UNIX.HOURS} to ({_UNIX.HOURS}+1)
414
415 set {_Calculate.Result} to ({_Calculate.Result}-3600)
416
417 if {_Calculate.Result} is smaller than 3600:
418
419 while {_Calculate.Result} is bigger or equal to 60:
420
421 set {_UNIX.MINUTES} to ({_UNIX.MINUTES}+1)
422
423 set {_Calculate.Result} to ({_Calculate.Result}-60)
424
425 if {_Calculate.Result} is smaller than 60:
426
427 set {_UNIX.SECONDS} to {_Calculate.Result}
428
429 if "%{_UNIX.DAYS}%", "%{_UNIX.HOURS}%", "%{_UNIX.MINUTES}%" or "%{_UNIX.SECONDS}%" contains "-":
430
431 return "false"
432
433 else:
434
435 return "%{_UNIX.DAYS}%'d %{_UNIX.HOURS}%'h %{_UNIX.MINUTES}%'m %{_UNIX.SECONDS}%'s"
436
437
438
439function CheckMutedPlayer(p_name:text) :: text:
440
441 set {_uuid} to getUUID("%{_p_name}%")
442
443 set {_getReason} to getMutedPlayer("%{_uuid}%", "Reason")
444
445 set {_getMuteState} to getMutedPlayer("%{_uuid}%", "Time")
446
447 if {_getMuteState} is "permanently":
448
449 set {_p_name} to "%{_p_name}%" parsed as player
450
451 send "" to {_p_name}
452
453 send " {@Mute_Perm}" to {_p_name}
454
455 send " {@Mute_Reason}" to {_p_name}
456
457 send "" to {_p_name}
458
459 return "true"
460
461 else:
462
463 add {_getMuteState} split at " " to {_Cache::*}
464
465 set {_Cache::1} to "%{_Cache::1}%" parsed as number
466
467 set {_Cache::2} to "%{_Cache::2}%" parsed as text
468
469 if {_Cache::2} contains "day":
470
471 if {_Cache::1} is bigger than 1:
472
473 set {_parameter} to "%{_Cache::1}% {@Format_Days}"
474
475 else:
476
477 set {_parameter} to "%{_Cache::1}% {@Format_Day}"
478
479 if {_Cache::2} contains "hour":
480
481 if {_Cache::1} is bigger than 1:
482
483 set {_parameter} to "%{_Cache::1}% {@Format_Hours}"
484
485 else:
486
487 set {_parameter} to "%{_Cache::1}% {@Format_Hour}"
488
489 if {_Cache::2} contains "minute":
490
491 if {_Cache::1} is bigger than 1:
492
493 set {_parameter} to "%{_Cache::1}% {@Format_Minutes}"
494
495 else:
496
497 set {_parameter} to "%{_Cache::1}% {@Format_Minute}"
498
499 if {_Cache::2} contains "second":
500
501 if {_Cache::1} is bigger than 1:
502
503 set {_parameter} to "%{_Cache::1}% {@Format_Seconds}"
504
505 else:
506
507 set {_parameter} to "%{_Cache::1}% {@Format_Second}"
508
509 set {_uuid} to getUUID("%{_p_name}%")
510
511 set {_getExecuted} to getMutedPlayer("%{_uuid}%", "Executed")
512
513 set {_getTime} to getMutedPlayer("%{_uuid}%", "Time")
514
515 add {_getTime} split at " " to {_Parameter::*}
516
517 set {_getUNIXTime} to UNIX_Algorithm({_getExecuted}, {_Parameter::1}, {_Parameter::2})
518
519 if {_getUNIXTime} is "false":
520
521 set {_uuid} to getUUID("%{_p_name}%")
522
523 RemoveMutedPlayer("%{_uuid}%")
524
525 else:
526
527 set {_p_name} to "%{_p_name}%" parsed as player
528
529 send "" to {_p_name}
530
531 send " {@Mute_Temp}" to {_p_name}
532
533 send " {@Mute_Reason}" to {_p_name}
534
535 send " {@Mute_TimeEnd}" to {_p_name}
536
537 send "" to {_p_name}
538
539 return "true"
540
541
542
543function KickPlayer(p_name:text):
544
545 set {_uuid} to getUUID("%{_p_name}%")
546
547 set {_getReason} to getBannedPlayer("%{_uuid}%", "Reason")
548
549 set {_getBanState} to getBannedPlayer("%{_uuid}%", "Time")
550
551 if {_getBanState} is "permanently":
552
553 set {_p_name} to {_p_name} parsed as player
554
555 kick {_p_name} due to "{@BanHeader}%nl%&f%nl%{@Ban_Perm_Line1}%nl%{@Ban_Perm_Line2}%nl%&f%nl%{@Ban_Perm_Line3}"
556
557 else:
558
559 add {_getBanState} split at " " to {_Cache::*}
560
561 set {_Cache::1} to "%{_Cache::1}%" parsed as number
562
563 set {_Cache::2} to "%{_Cache::2}%" parsed as text
564
565 if {_Cache::2} contains "day":
566
567 if {_Cache::1} is bigger than 1:
568
569 set {_parameter} to "%{_Cache::1}% {@Format_Days}"
570
571 else:
572
573 set {_parameter} to "%{_Cache::1}% {@Format_Day}"
574
575 if {_Cache::2} contains "hour":
576
577 if {_Cache::1} is bigger than 1:
578
579 set {_parameter} to "%{_Cache::1}% {@Format_Hours}"
580
581 else:
582
583 set {_parameter} to "%{_Cache::1}% {@Format_Hour}"
584
585 if {_Cache::2} contains "minute":
586
587 if {_Cache::1} is bigger than 1:
588
589 set {_parameter} to "%{_Cache::1}% {@Format_Minutes}"
590
591 else:
592
593 set {_parameter} to "%{_Cache::1}% {@Format_Minute}"
594
595 if {_Cache::2} contains "second":
596
597 if {_Cache::1} is bigger than 1:
598
599 set {_parameter} to "%{_Cache::1}% {@Format_Seconds}"
600
601 else:
602
603 set {_parameter} to "%{_Cache::1}% {@Format_Second}"
604
605 set {_uuid} to getUUID("%{_p_name}%")
606
607 set {_getExecuted} to getBannedPlayer("%{_uuid}%", "Executed")
608
609 set {_getTime} to getBannedPlayer("%{_uuid}%", "Time")
610
611 add {_getTime} split at " " to {_Parameter::*}
612
613 set {_getUNIXTime} to UNIX_Algorithm({_getExecuted}, {_Parameter::1}, {_Parameter::2})
614
615 if {_getUNIXTime} is "false":
616
617 set {_uuid} to getUUID("%{_p_name}%")
618
619 RemoveBannedPlayer("%{_uuid}%")
620
621 else:
622
623 set {_p_name} to {_p_name} parsed as player
624
625 kick {_p_name} due to "{@BanHeader}%nl%&f%nl%{@Ban_Temp_Line1}%nl%{@Ban_Temp_Line2}%nl%{@Ban_Temp_Line3}%nl%&f%nl%{@Ban_Temp_Line4}"
626
627
628
629function BanPlayer(p_name:text, p_time:text, p_reason:text, from:text):
630
631 set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM Ban WHERE Player = '%{_p_name}%'"
632
633 set {_getResult} to false
634
635 loop {_SetResult::*}:
636
637 if loop-value is {_p_name}:
638
639 set {_getResult} to true
640
641 if {_getResult} is false:
642
643 update "INSERT INTO `Ban` (`Player`,`Time`,`Executed`,`Reason`,`FromPlayer`) VALUES ('%{_p_name}%', '%{_p_time}%', '%unix time%', '%{_p_reason}%', '%{_from}%')"
644
645 $ thread
646
647 set {_player} to value of sql var "pn::%{_p_name}%"
648
649 set {_player} to {_player} parsed as offlineplayer
650
651 {_player} is online
652
653 KickPlayer("%{_player}%")
654
655
656
657function AddHistoryLog(p_name:text, p_log:text):
658
659 update "INSERT INTO `History` (`Player`,`Log`) VALUES ('%{_p_name}%', '%{_p_log}%')"
660
661
662
663function setIPofPlayer(p_name:text, ip:text, uuid:text):
664
665 if {_uuid} is not "-":
666
667 set {_SetResult::*} to objects in column "UUID" from result of query "SELECT * FROM IP WHERE UUID = '%{_uuid}%'"
668
669 set {_GetResult} to false
670
671 loop {_SetResult::*}:
672
673 set {_GetResult} to true
674
675 if {_GetResult} is true:
676
677 update "UPDATE `IP` SET `IP` = '%{_ip}%' WHERE `IP`.`UUID` = '%{_uuid}%'"
678
679 update "UPDATE `IP` SET `Player` = '%{_p_name}%' WHERE `IP`.`UUID` = '%{_uuid}%'"
680
681 else:
682
683 set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
684
685 set {_GetResult} to false
686
687 loop {_SetResult::*}:
688
689 set {_GetResult} to true
690
691 if {_GetResult} is true:
692
693 update "UPDATE `IP` SET `IP` = '%{_ip}%' WHERE `IP`.`Player` = '%{_p_name}%'"
694
695 update "UPDATE `IP` SET `UUID` = '-' WHERE `IP`.`Player` = '%{_p_name}%'"
696
697 set {_SetResult2::*} to objects in column "IP" from result of query "SELECT * FROM IP WHERE IP = '%{_ip}%'"
698
699 set {_GetResult2} to false
700
701 loop {_SetResult2::*}:
702
703 set {_GetResult2} to true
704
705 if {_GetResult2} is false:
706
707 update "INSERT INTO `IP` (`IP`,`Player`,`UUID`) VALUES ('%{_ip}%', '%{_p_name}%', '%{_uuid}%')"
708
709 else:
710
711 if {_uuid} is not "-":
712
713 $ thread
714
715 set {_SetResult2::*} to objects in column "UUID" from result of query "SELECT * FROM IP WHERE UUID = '%{_uuid}%'"
716
717 set {_GetResult2} to false
718
719 loop {_SetResult2::*}:
720
721 if loop-value is {_uuid}:
722
723 set {_GetResult2} to true
724
725 else:
726
727 set {_SetResult2::*} to objects in column "Player" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
728
729 set {_GetResult2} to false
730
731 loop {_SetResult2::*}:
732
733 if loop-value is {_p_name}:
734
735 set {_GetResult2} to true
736
737 if {_GetResult2} is false:
738
739 update "INSERT INTO `IP` (`IP`,`Player`,`UUID`) VALUES ('%{_ip}%', '%{_p_name}%', '%{_uuid}%')"
740
741
742
743function ipExists(ip:text) :: boolean:
744
745 set {_SetResult::*} to objects in column "IP" from result of query "SELECT * FROM IP WHERE IP = '%{_ip}%'"
746
747 set {_getResult} to false
748
749 loop {_SetResult::*}:
750
751 if loop-value is "%{_ip}%":
752
753 set {_getResult} to true
754
755 return {_getResult}
756
757
758
759function WasPlayerAlreadyOnline(p_name:text) :: text:
760
761 set {_SetResult::*} to objects in column "Player" from result of query "SELECT * FROM IP WHERE Player = '%{_p_name}%'"
762
763 set {_getResult} to false
764
765 loop {_SetResult::*}:
766
767 if loop-value is "%{_p_name}%":
768
769 set {_getResult} to true
770
771 if {_getResult} is true:
772
773 return "true"
774
775 else:
776
777 return "false"
778
779
780
781function getPreset(name: text) :: text:
782
783 set {_SetResult::*} to objects in column "Name" from result of query "SELECT * FROM Presets WHERE Name = '%{_name}%'"
784
785 set {_getResult} to false
786
787 loop {_SetResult::*}:
788
789 if loop-value is "%{_name}%":
790
791 set {_getResult} to true
792
793 if {_getResult} is true:
794
795 return "true"
796
797 else:
798
799 return "false"
800
801
802
803function addPreset(name: text, cmd: text):
804
805 update "INSERT INTO `Presets` (`Name`,`Command`) VALUES ('%{_name}%', '%{_cmd}%')"
806
807
808
809function deletePreset(name: text):
810
811 update "DELETE FROM Presets WHERE Name = '%{_name}%'"
812
813
814
815command /punish [<text>]:
816
817 executable by: players
818
819 trigger:
820
821 if player does not have permission "punishments.punish":
822
823 send "{@Logo} {@NoPermission}"
824
825 else:
826
827 if arg-1 is not set:
828
829 send "{@Logo} {@NoName}"
830
831 send "{@Logo} &a/punish &c<player>"
832
833 else:
834
835 if arg-1 is player:
836
837 send "{@Logo} &cYou can't punish yourself!"
838
839 else:
840
841 $ thread
842
843 set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
844
845 if {_getIP} is "false":
846
847 send "{@Logo} {@PlayerNotFound}"
848
849 else:
850
851 $ thread
852
853 set {_punishmentnames::*} to objects in column "Name" from result of query "SELECT * FROM Presets"
854
855 $ thread
856
857 set {_punishmentcommands::*} to objects in column "Command" from result of query "SELECT * FROM Presets"
858
859 if size of {_punishmentnames::*} is 0:
860
861 send "{@Logo} &cThere are currently no presets made!"
862
863 else:
864
865 open chest with ceil(size of {_punishmentnames::*}/9) rows named "&aPreset Punishments" to sender
866
867 loop {_punishmentnames::*}:
868
869 set {_cmd} to {_punishmentcommands::%loop-index%}
870
871 set {_name} to "%loop-value%"
872
873 replace all "_" with " " in {_name}
874
875 replace all "%%player%%" with "%arg-1%" in {_cmd}
876
877 add 1 to {_slot}
878
879 evaluate "format slot {_slot} - 1 of sender with a redstone block named ""&a%{_name}%"" with lore ""&7&o%{_cmd}%"" to close then run [sender command ""%{_cmd}%""]"
880
881
882
883command /presets [<text>] [<text>] [<text>]:
884
885 aliases: /preset
886
887 trigger:
888
889 if player does not have permission "punishments.presets":
890
891 send "{@Logo} {@NoPermission}"
892
893 else if arg-1 is "add":
894
895 if arg-2 is not set:
896
897 send "{@Logo} &cYou are missing a punishment name!"
898
899 else if arg-3 is not set:
900
901 send "{@Logo} &cYou are missing a command!"
902
903 else if getPreset(arg-2) is "true":
904
905 send "{@Logo} &cThe preset punishment &a%arg-2%&7 is already made! Do /preset delete %arg-2% then remake it."
906
907 else:
908
909 $ thread
910
911 addPreset(arg-2, arg-3)
912
913 send "{@Logo} &7Added punishment &a%arg-2%&7 to run &a%arg-3%"
914
915 else if arg-1 is "delete":
916
917 if arg-2 is not set:
918
919 send "{@Logo} &cYou are missing a punishment name!"
920
921 else if arg-3 is set:
922
923 send "{@Logo} &cUnexpected argument: &a%arg-3%"
924
925 else if getPreset(arg-2) is "false":
926
927 send "{@Logo} &cThere is no preset punishment named &a%arg-2%"
928
929 else:
930
931 $ thread
932
933 deletePreset(arg-2)
934
935 send "{@Logo} &7Deleted preset punishment &a%arg-2%"
936
937 else:
938
939 send "{@Logo} &7/presets add &c<punishment name> <command>"
940
941 send "{@Logo} &7/presets delete &c<punishment name>"
942
943 send "{@Logo} &7&oUse %%player%% to represent a player in the command."
944
945 send "{@Logo} &7&oUse a _ to represent a space in a punishment name."
946
947
948
949on connect:
950
951 set {_ban} to getBannedPlayer("%player's uuid%", "Player")
952
953 if {_ban} is not "true":
954
955 $ thread
956
957 set {_ip} to getIP("%player%")
958
959 if {_ip} is not set:
960
961 wait 1 second
962
963 $ thread
964
965 set {_accounts} to getAccounts("%player%")
966
967 replace all " and " with ", " in {_accounts}
968
969 set {_accounts::*} to {_accounts} split at ", "
970
971 size of {_accounts::*} is greater than 1
972
973 loop {_accounts::*}:
974
975 "%loop-value%" is not "%player%"
976
977 if {ubldata::playertouuid::%loop-value%} is set:
978
979 set {_uuid} to {ubldata::playertouuid::%loop-value%}
980
981 {ubl::exempt::%{_uuid}%} is not set
982
983 send "&a%player%&7 is a alt of &a%loop-value%&7 who is UBLed!" to all ops
984
985 $ thread
986
987 set {_ip} to getIP("%loop-value%")
988
989 send "&7IP:&a %{_ip}%%nl%&7&oScreenshot this and send it to the courtroom to get their alt UBLed for alting!" to all ops
990
991 command "/tempban %player% 7 days UBL Evasion of %loop-value%"
992
993 stop loop
994
995 set {_ban::%loop-value%} to getBannedPlayer("%{_uuid}%", "Player")
996
997 {_ban::%loop-value%} is "true"
998
999 $ thread
1000
1001 set {_type} to getBannedPlayer("%{_uuid}%", "Time")
1002
1003 $ thread
1004
1005 set {_reason} to getBannedPlayer("%{_uuid}%", "Reason")
1006
1007 $ thread
1008
1009 set {_executor} to getBannedPlayer("%{_uuid}%", "Executed")
1010
1011 if {_type} is "permanently":
1012
1013 $ thread
1014
1015 BanPlayer("%player's uuid%", "%{_type}%", "%{_reason}%" , "%{_executor}%")
1016
1017 $ thread
1018
1019 AddHistoryLog("%player's uuid%", "&c[%now%] %player% has been banned by %{_executor}% due to ""%{_reason}%"". He is also a alt of %loop-value% who is banned.")
1020
1021 else:
1022
1023 set {_time} to getBannedPlayer("%{_uuid}%", "Time")
1024
1025 $ thread
1026
1027 BanPlayer("%player's uuid%", "%{_time}%", "%{_reason}%" , "%{_executor}%")
1028
1029 $ thread
1030
1031 AddHistoryLog("%player's uuid%", "&c[%now%] %player% has been tempbanned by %{_executor}% due to ""%{_reason}%"" for %{_time}%. He is also a alt of %loop-value% who is banned.")
1032
1033 set {_player} to "%loop-value%"
1034
1035 set {_ban} to true
1036
1037 stop loop
1038
1039 else:
1040
1041 set {_uuid} to player's uuid
1042
1043 if {_ban} is "true":
1044
1045 set {_getReason} to getBannedPlayer("%{_uuid}%", "Reason")
1046
1047 set {_getBanState} to getBannedPlayer("%{_uuid}%", "Time")
1048
1049 if {_getBanState} is "permanently":
1050
1051 kick player due to "{@BanHeader}%nl%&f%nl%{@Ban_Perm_Line1}%nl%{@Ban_Perm_Line2}%nl%&f%nl%{@Ban_Perm_Line3}"
1052
1053 else:
1054
1055 add {_getBanState} split at " " to {_Cache::*}
1056
1057 set {_Cache::1} to "%{_Cache::1}%" parsed as number
1058
1059 set {_Cache::2} to "%{_Cache::2}%" parsed as text
1060
1061 if {_Cache::2} contains "day":
1062
1063 if {_Cache::1} is bigger than 1:
1064
1065 set {_parameter} to "%{_Cache::1}% {@Format_Days}"
1066
1067 else:
1068
1069 set {_parameter} to "%{_Cache::1}% {@Format_Day}"
1070
1071 if {_Cache::2} contains "hour":
1072
1073 if {_Cache::1} is bigger than 1:
1074
1075 set {_parameter} to "%{_Cache::1}% {@Format_Hours}"
1076
1077 else:
1078
1079 set {_parameter} to "%{_Cache::1}% {@Format_Hour}"
1080
1081 if {_Cache::2} contains "minute":
1082
1083 if {_Cache::1} is bigger than 1:
1084
1085 set {_parameter} to "%{_Cache::1}% {@Format_Minutes}"
1086
1087 else:
1088
1089 set {_parameter} to "%{_Cache::1}% {@Format_Minute}"
1090
1091 if {_Cache::2} contains "second":
1092
1093 if {_Cache::1} is bigger than 1:
1094
1095 set {_parameter} to "%{_Cache::1}% {@Format_Seconds}"
1096
1097 else:
1098
1099 set {_parameter} to "%{_Cache::1}% {@Format_Second}"
1100
1101 set {_getExecuted} to getBannedPlayer("%{_uuid}%", "Executed")
1102
1103 set {_getTime} to getBannedPlayer("%{_uuid}%", "Time")
1104
1105 add {_getTime} split at " " to {_Parameter::*}
1106
1107 set {_getUNIXTime} to UNIX_Algorithm({_getExecuted}, {_Parameter::1}, {_Parameter::2})
1108
1109 if {_getUNIXTime} is "false":
1110
1111 RemoveBannedPlayer("%{_uuid}%")
1112
1113 else:
1114
1115 kick player due to "{@BanHeader}%nl%&f%nl%{@Ban_Temp_Line1}%nl%{@Ban_Temp_Line2}%nl%{@Ban_Temp_Line3}%nl%&f%nl%{@Ban_Temp_Line4}"
1116
1117
1118
1119on join:
1120
1121 $ thread
1122
1123 setIPofPlayer("%player%", "%player's ip%", "%player's uuid%")
1124
1125 if "%ip of player%" contains "151.80.11.", "164.132.80.", "176.31.75.", "178.33.27.", "91.121.231.", "69.130." or "82.31.16":
1126
1127 kick player due to "&cCompromised account detected.%nl%&c&oIf you believe this is in error, contact a staff member."
1128
1129 $ thread
1130
1131 set {_text} to text from "https://api.mojang.com/users/profiles/minecraft/%player%"
1132
1133 if {_text} does not contain "id":
1134
1135 kick player due to "&cCompromised account detected.%nl%&c&oIf you believe this is in error, contact a staff member."
1136
1137
1138
1139command /history [<text>]:
1140
1141 aliases: lookup
1142
1143 trigger:
1144
1145 if player does not have permission "punishments.history":
1146 send "{@Logo} {@NoPermission}"
1147
1148 else:
1149
1150 if arg-1 is not set:
1151
1152 send "{@Logo} {@NoName}"
1153
1154 send "{@Logo} &a/history &c<player>"
1155
1156 else:
1157
1158 $ thread
1159
1160 set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
1161
1162 if {_getIP} is "false":
1163
1164 send "{@Logo} {@PlayerNotFound}"
1165
1166 else:
1167
1168 set {_BannedMoreInfo} to ""
1169
1170 set {_MutedMoreInfo} to ""
1171
1172 $ thread
1173
1174 set {_uuid} to getUUID("%arg-1%")
1175
1176 $ thread
1177
1178 set {_Banned?} to getBannedPlayer("%{_uuid}%", "Player")
1179
1180 if {_Banned?} is "true":
1181
1182 set {_Banned?} to "&a&lâœâ€"
1183
1184 else:
1185
1186 set {_Banned?} to "&c&l✖"
1187
1188 $ thread
1189
1190 set {_uuid} to getUUID(arg-1)
1191
1192 $ thread
1193
1194 set {_Muted?} to getMutedPlayer("%{_uuid}%", "Player")
1195
1196 if {_Muted?} is "true":
1197
1198 set {_Muted?} to "&a&lâœâ€"
1199
1200 else:
1201
1202 set {_Muted?} to "&c&l✖"
1203
1204 $ thread
1205
1206 set {_uuid} to getUUID(arg-1)
1207
1208 $ thread
1209
1210 set {_SetResult::*} to objects in column "Log" from result of query "SELECT * FROM History WHERE Player = '%{_uuid}%'"
1211
1212 set {_getResult} to false
1213
1214 loop {_SetResult::*}:
1215
1216 set {_getResult} to true
1217
1218 send ""
1219
1220 if {_getResult} is true:
1221
1222 loop 150 times:
1223
1224 if {_SetResult::%loop-number%} is set:
1225
1226 send "%{_SetResult::%loop-number%}%"
1227
1228 else:
1229
1230 stop loop
1231
1232 else:
1233
1234 send "{@NoHistory}"
1235
1236 $ thread
1237
1238 set {_ip} to getIP("%arg-1%")
1239
1240 send "&f&m=====================&6&l HISTORY &f&m====================="
1241
1242 send " &eCurrently banned: %{_Banned?}% &7|| &eCurrently muted: %{_Muted?}%"
1243
1244 send " &7IP: &a%{_ip}%"
1245
1246 send ""
1247
1248
1249
1250command /accounts [<text>]:
1251
1252 aliases: whois
1253
1254 trigger:
1255
1256 if player does not have permission "punishments.accounts":
1257
1258 send "{@Logo} {@NoPermission}"
1259
1260 else:
1261
1262 if arg-1 is not set:
1263
1264 send "{@Logo} {@NoName}"
1265
1266 send "{@Logo} &a/accounts &c<player/ip>"
1267
1268 else if arg-1 contains ".":
1269
1270 $ thread
1271
1272 set {_getIP} to ipExists(arg-1)
1273
1274 if {_getIP} is false:
1275
1276 send "{@Logo} {@IPNotFound}"
1277
1278 else:
1279
1280 $ thread
1281
1282 set {_accounts} to getAccounts("%arg-1%")
1283
1284 send "{@Logo} &7Accounts under the IP &a%arg-1%&7: &c%{_accounts}%"
1285
1286 else:
1287
1288 $ thread
1289
1290 set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
1291
1292 if {_getIP} is "false":
1293
1294 send "{@Logo} {@PlayerNotFound}"
1295
1296 else:
1297
1298 $ thread
1299
1300 set {_accounts} to getAccounts("%arg-1%")
1301
1302 send "{@Logo} &a%arg-1%'s&7 accounts: &c%{_accounts}%"
1303
1304
1305
1306command /players [<text>]:
1307
1308 trigger:
1309
1310 if player does not have permission "punishments.players":
1311
1312 send "{@Logo} {@NoPermission}"
1313
1314 else:
1315
1316 if arg-1 is not set:
1317
1318 $ thread
1319
1320 set {_players::*} to getPlayers()
1321
1322 else if arg-1 is set:
1323
1324 $ thread
1325
1326 set {_players::*} to getPlayers("%arg-1%")
1327
1328 if {_players::*} is not set:
1329
1330 send "{@Logo} &cNo players were found containing %arg-1%"
1331
1332 else:
1333
1334 if arg-1 is set:
1335
1336 send "{@Logo} &7Accounts containg &a%arg-1%&7: &c%{_players::*}% &7&o(%size of {_players::*}%&7 accounts)"
1337
1338 else:
1339
1340 send "{@Logo} &a%size of {_players::*}%&7 total accounts"
1341
1342
1343
1344command /mute [<text>] [<text>]:
1345
1346 aliases: mute
1347
1348 trigger:
1349
1350 if player does not have permission "punishments.mute":
1351
1352 send "{@Logo} {@NoPermission}"
1353
1354 else:
1355
1356 if arg-1 is not set:
1357
1358 send "{@Logo} {@NoName}"
1359
1360 send "{@Logo} &a/mute &c<player> <reason>"
1361
1362 else:
1363
1364 if arg-1 is player:
1365
1366 send "{@Logo} {@NoSelfMute}"
1367
1368 else:
1369
1370 $ thread
1371
1372 set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
1373
1374 if {_getIP} is "false":
1375
1376 send "{@Logo} {@PlayerNotFound}"
1377
1378 else:
1379
1380 $ thread
1381
1382 set {_uuid} to getUUID("%arg-1%")
1383
1384 $ thread
1385
1386 set {_getResult} to getMutedPlayer("%{_uuid}%", "Player")
1387
1388 if {_getResult} is "true":
1389
1390 send "{@Logo} {@AlreadyMuted}"
1391
1392 else:
1393
1394 if arg 2 is not set:
1395
1396 send "{@Logo} {@NoReason}"
1397
1398 send "{@Logo} &a/mute &e%arg-1% &c<reason>"
1399
1400 else:
1401
1402 if sender is player:
1403
1404 set {_String.From} to "%player%"
1405
1406 else:
1407
1408 set {_String.From} to "{@ConsoleName}"
1409
1410 $ thread
1411
1412 set {_uuid} to getUUID("%arg-1%")
1413
1414 $ thread
1415
1416 MutePlayer("%{_uuid}%", "permanently", arg-2, {_String.From})
1417
1418 $ thread
1419
1420 AddHistoryLog("%{_uuid}%", "&e[%now%] %arg-1% has been muted by %{_String.From}% due to ""%arg-2%"".")
1421
1422 broadcast "{@Logo} &a%arg-1%&7 was muted by &a%{_String.From}% &7due to &c%arg-2%"
1423
1424
1425
1426command /tempmute [<text>] [<integer>] [<text>] [<text>]:
1427
1428 aliases: tempmute
1429
1430 trigger:
1431
1432 if player does not have permission "punishments.tempmute":
1433
1434 send "{@Logo} {@NoPermission}"
1435
1436 else:
1437
1438 if arg-1 is not set:
1439
1440 send "{@Logo} {@NoName}"
1441
1442 send "{@Logo} &a/tempmute &c<player> <integer> <parameter> <reason>"
1443
1444 else:
1445
1446 if arg-1 is player:
1447
1448 send "{@Logo} {@NoSelfMute}"
1449
1450 else:
1451
1452 $ thread
1453
1454 set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
1455
1456 if {_getIP} is "false":
1457
1458 send "{@Logo} {@PlayerNotFound}"
1459
1460 else:
1461
1462 $ thread
1463
1464 set {_uuid} to getUUID("%arg-1%")
1465
1466 $ thread
1467
1468 set {_getResult} to getMutedPlayer("%{_uuid}%", "Player")
1469
1470 if {_getResult} is "true":
1471
1472 send "{@Logo} {@AlreadyMuted}"
1473
1474 else:
1475
1476 if arg-2 is not set:
1477
1478 send "{@Logo} {@NoInteger}"
1479
1480 send "{@Logo} &a/tempmute &e%arg-1% &c<integer> <parameter> <reason>"
1481
1482 else:
1483
1484 if arg-2 is bigger than 12000:
1485
1486 send "{@Logo} {@NotAllowedSize}"
1487
1488 else:
1489
1490 if arg-2 is smaller than 1:
1491
1492 send "{@Logo} {@NotAllowedSize}"
1493
1494 else:
1495
1496 if arg-3 is not set:
1497
1498 send "{@Logo} {@NoTime}"
1499
1500 send "{@Logo} &a/tempmute &e%arg-1% %arg-2% &c<parameter> <reason>"
1501
1502 else:
1503
1504 if arg-3 is not "second", "seconds", "minute", "minutes", "hour", "hours", "day" or "days":
1505
1506 send "{@Logo} {@NoTime}"
1507
1508 send "{@Logo} &a/tempmute &e%arg-1% %arg-2% &c<parameter> <reason>"
1509
1510 else:
1511
1512 if arg-4 is not set:
1513
1514 send "{@Logo} {@NoReason}"
1515
1516 send "{@Logo} &a/tempmute &e%arg-1% %arg-2% %arg-3% &c<reason>"
1517
1518 else:
1519
1520 if sender is player:
1521
1522 set {_String.From} to "%player%"
1523
1524 else:
1525
1526 set {_String.From} to "{@ConsoleName}"
1527
1528 $ thread
1529
1530 set {_uuid} to getUUID("%arg-1%")
1531
1532 $ thread
1533
1534 MutePlayer("%{_uuid}%", "%arg-2% %arg-3%", arg-4, {_String.From})
1535
1536 $ thread
1537
1538 AddHistoryLog("%{_uuid}%", "&e[%now%] %arg-1% has been tempmuted by %{_String.From}% due to ""%arg-4%"" for %arg-2% %arg-3%.")
1539
1540 broadcast "{@Logo} &a%arg-1%&7 has been tempmuted by &a%{_String.From}%&7 due to &c%arg-4%&7 for &a%arg-2% %arg-3%"
1541
1542
1543
1544command /kick [<player>] [<text>]:
1545
1546 aliases: kick
1547
1548 trigger:
1549
1550 if player does not have permission "punishments.kick":
1551
1552 send "{@Logo} {@NoPermission}"
1553
1554 else:
1555
1556 if arg-1 is not set:
1557
1558 send "{@Logo} {@NoName}"
1559
1560 send "{@Logo} &a/kick &c<player> <reason>"
1561
1562 else:
1563
1564 if arg-player is player:
1565
1566 send "{@Logo} {@NoSelfKick}"
1567
1568 else:
1569
1570 if arg-2 is not set:
1571
1572 send "{@Logo} {@NoReason}"
1573
1574 send "{@Logo} &a/kick &e%arg-1% &c<reason>"
1575
1576 else:
1577
1578 if sender is player:
1579
1580 kick arg-player due to "{@KickHeader}%nl%&f%nl%{@Kick_Line1}%nl%{@Kick_Reason}"
1581
1582 $ thread
1583
1584 set {_uuid} to getUUID("%arg-1%")
1585
1586 $ thread
1587
1588 AddHistoryLog("%{_uuid}%", "&b[%now%] %arg-player% has been kicked by %player% due to ""%arg-2%"".")
1589
1590 broadcast "{@Logo} &a%arg-1%&7 was kicked by &a%player%&7 due to &c%arg-2%"
1591
1592 else:
1593
1594 kick arg-player due to "{@KickHeader}%nl%&f%nl%{@Kick_Line2}%nl%{@Kick_Reason}"
1595
1596 $ thread
1597
1598 set {_uuid} to getUUID("%arg-1%")
1599
1600 $ thread
1601
1602 AddHistoryLog("%{_uuid}%", "&b[%now%] %arg-player% has been kicked by {@ConsoleName} due to ""%arg-2%"".")
1603
1604 broadcast "{@Logo} &a%arg-1%&7 was kicked by &a{@ConsoleName}&7 due to &c%arg-2%"
1605
1606
1607
1608command /ban [<text>] [<text>]:
1609
1610 aliases: ban
1611
1612 trigger:
1613
1614 if player does not have permission "punishments.ban":
1615
1616 send "{@Logo} {@NoPermission}"
1617
1618 else:
1619
1620 if arg-1 is not set:
1621
1622 send "{@Logo} {@NoName}"
1623
1624 send "{@Logo} &a/ban &c<player> <reason>"
1625
1626 else:
1627
1628 if arg-1 is player:
1629
1630 send "{@Logo} {@NoSelfBan}"
1631
1632 else:
1633
1634 $ thread
1635
1636 set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
1637
1638 if {_getIP} is "false":
1639
1640 send "{@Logo} {@PlayerNotFound}"
1641
1642 else:
1643
1644 $ thread
1645
1646 set {_uuid} to getUUID("%arg-1%")
1647
1648 $ thread
1649
1650 set {_getResult} to getBannedPlayer("%{_uuid}%", "Player")
1651
1652 if {_getResult} is "true":
1653
1654 send "{@Logo} {@AlreadyBanned}"
1655
1656 else:
1657
1658 if arg-2 is not set:
1659
1660 send "{@Logo} {@NoReason}"
1661
1662 send "{@Logo} &a/ban &e%arg-1% &c<reason>"
1663
1664 else:
1665
1666 if sender is player:
1667
1668 set {_String.From} to "%player%"
1669
1670 else:
1671
1672 set {_String.From} to "{@ConsoleName}"
1673
1674 BanPlayer("%{_uuid}%", "permanently", arg-2, {_String.From})
1675
1676 $ thread
1677
1678 AddHistoryLog("%{_uuid}%", "&c[%now%] %arg-1% has been banned by %{_String.From}% due to ""%arg-2%"".")
1679
1680 broadcast "{@Logo} &a%arg-1%&7 has been banned permanently by &a%{_String.From}%&7 due to&c %arg-2%"
1681
1682
1683
1684command /tempban [<text>] [<integer>] [<text>] [<text>]:
1685
1686 aliases: tempban
1687
1688 trigger:
1689
1690 if player does not have permission "punishments.tempban":
1691
1692 send "{@Logo} {@NoPermission}"
1693
1694 else:
1695
1696 if arg-1 is not set:
1697
1698 send "{@Logo} {@NoName}"
1699
1700 send "{@Logo} &a/tempban &c<player> <integer> <parameter> <reason>"
1701
1702 else:
1703
1704 if arg-1 is player:
1705
1706 send "{@Logo} {@NoSelfBan}"
1707
1708 else:
1709
1710 $ thread
1711
1712 set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
1713
1714 if {_getIP} is "false":
1715
1716 send "{@Logo} {@PlayerNotFound}"
1717
1718 else:
1719
1720 $ thread
1721
1722 set {_uuid} to getUUID("%arg-1%")
1723
1724 $ thread
1725
1726 set {_getResult} to getBannedPlayer("%{_uuid}%", "Player")
1727
1728 if {_getResult} is "true":
1729
1730 send "{@Logo} {@AlreadyBanned}"
1731
1732 else:
1733
1734 if arg-2 is not set:
1735
1736 send "{@Logo} {@NoInteger}"
1737
1738 send "{@Logo} &a/tempban &e%arg-1% &c<integer> <parameter> <reason>"
1739
1740 else:
1741
1742 if arg-2 is bigger than 12000:
1743
1744 send "{@Logo} {@NotAllowedSize}"
1745
1746 else:
1747
1748 if arg-2 is smaller than 1:
1749
1750 send "{@Logo} {@NotAllowedSize}"
1751
1752 else:
1753
1754 if arg-3 is not set:
1755
1756 send "{@Logo} {@NoTime}"
1757
1758 send "{@Logo} &a/tempban &e%arg-1% %arg-2% &c<parameter> <reason>"
1759
1760 else:
1761
1762 if arg-3 is not "second", "seconds", "minute", "minutes", "hour", "hours", "day" or "days":
1763
1764 send "{@Logo} {@NoTime}"
1765
1766 send "{@Logo} &a/tempban &e%arg-1% %arg-2% &c<parameter> <reason>"
1767
1768 else:
1769
1770 if arg-4 is not set:
1771
1772 send "{@Logo} {@NoReason}"
1773
1774 send "{@Logo} &a/tempban &e%arg-1% %arg-2% %arg-3% &c<reason>"
1775
1776 else:
1777
1778 if sender is player:
1779
1780 set {_String.From} to "%player%"
1781
1782 else:
1783
1784 set {_String.From} to "{@ConsoleName}"
1785
1786 $ thread
1787
1788 set {_uuid} to getUUID("%arg-1%")
1789
1790 $ thread
1791
1792 BanPlayer("%{_uuid}%", "%arg-2% %arg-3%", "%arg-4%", {_String.From})
1793
1794 $ thread
1795
1796 AddHistoryLog("%{_uuid}%", "&c[%now%] %arg-1% has been tempbanned by %{_String.From}% due to ""%arg-4%"" for %arg-2% %arg-3%.")
1797
1798 broadcast "{@Logo} &a%arg-1%&7 has been tempbanned by &a%{_String.From}%&7 due to&c %arg-4%&7 for &a%arg-2% %arg-3%"
1799
1800
1801
1802command /pardon [<text>]:
1803
1804 aliases: unban, pardon
1805
1806 trigger:
1807
1808 if player does not have permission "punishments.unban":
1809
1810 send "{@Logo} {@NoPermission}"
1811
1812 else:
1813
1814 if arg-1 is not set:
1815
1816 send "{@Logo} {@NoName}"
1817
1818 send "{@Logo} &a/unban &c<player>"
1819
1820 else:
1821
1822 set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
1823
1824 if {_getIP} is "false":
1825
1826 send "{@Logo} {@PlayerNotFound}"
1827
1828 else:
1829
1830 set {_accounts} to getAccounts("%arg-1%")
1831
1832 replace all " and " with ", " in {_accounts}
1833
1834 set {_accounts::*} to {_accounts} split at ", "
1835
1836 loop {_accounts::*}:
1837
1838 set {_uuid} to getUUID("%loop-value%")
1839
1840 set {_ban} to getBannedPlayer("%{_uuid}%", "Player")
1841
1842 {_ban} is "true"
1843
1844 set {_ban::%loop-value%} to {_uuid}
1845
1846 if {_ban::*} is not set:
1847
1848 send "{@Logo} {@PlayerNotBanned}"
1849
1850 else:
1851
1852 if sender is player:
1853
1854 set {_String.From} to "%player%"
1855
1856 else:
1857
1858 set {_String.From} to "{@ConsoleName}"
1859
1860 loop {_ban::*}:
1861
1862 $ thread
1863
1864 RemoveBannedPlayer("%loop-value%")
1865
1866 $ thread
1867
1868 AddHistoryLog("%loop-value%", "&c[%now%] %loop-index% has been unbanned by %{_String.From}%.")
1869
1870 broadcast "{@Logo} &a%arg-1%&7&o (and all accounts under their ip)&7 were unbanned by &7%{_String.From}%"
1871
1872
1873
1874command /unmute [<text>]:
1875
1876 aliases: unmute
1877
1878 trigger:
1879
1880 if player does not have permission "punishments.unmute":
1881
1882 send "{@Logo} {@NoPermission}"
1883
1884 else:
1885
1886 if arg-1 is not set:
1887
1888 send "{@Logo} {@NoName}"
1889
1890 send "{@Logo} &a/unmute &c<player>"
1891
1892 else:
1893
1894 $ thread
1895
1896 set {_getIP} to WasPlayerAlreadyOnline("%arg-1%")
1897
1898 if {_getIP} is "false":
1899
1900 send "{@Logo} {@PlayerNotFound}"
1901
1902 else:
1903
1904 $ thread
1905
1906 set {_uuid} to getUUID("%arg-1%")
1907
1908 $ thread
1909
1910 set {_getResult} to getMutedPlayer("%{_uuid}%", "Player")
1911
1912 if {_getResult} is "false":
1913
1914 send "{@Logo} {@PlayerNotMuted}"
1915
1916 else:
1917
1918 if sender is player:
1919
1920 set {_String.From} to "%player%"
1921
1922 else:
1923
1924 set {_String.From} to "{@ConsoleName}"
1925
1926 $ thread
1927
1928 set {_uuid} to getUUID("%arg-1%")
1929
1930 $ thread
1931
1932 RemoveMutedPlayer("%{_uuid}%")
1933
1934 $ thread
1935
1936 AddHistoryLog("%{_uuid}%", "&e[%now%] %arg-1% has been unmuted by %{_String.From}%.")
1937
1938 broadcast "{@Logo} &a%arg-1%&7 was unmuted by &a%{_String.From}%"
1939
1940
1941
1942on chat:
1943
1944 set {_getResult} to getMutedPlayer("%player's uuid%", "Player")
1945
1946 if {_getResult} is "true":
1947
1948 set {_CheckMuteState} to CheckMutedPlayer("%player%")
1949
1950 if {_CheckMuteState} is "true":
1951
1952 set {nochat::%player%} to true
1953
1954 else:
1955
1956 #{dead::%player%} is true
1957
1958 #set {nochat::%player%} to true
1959
1960 #loop all players:
1961
1962 # if {spec::%loop-player%} is true:
1963
1964 # send "&5[Dead] &8%player%&7:&3 %message%" to loop-player
1965
1966 # else if {dead::%loop-player%} is true:
1967
1968 # send "&5[Dead] &8%player%&7:&3 %message%" to loop-player