-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstaffchat.sk
71 lines (69 loc) · 2.61 KB
/
staffchat.sk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#If you are getting an error regarding player's prefix, you can either remove it if you don't have ranks
#or install vault and a rank granting plugin, such as luckperms.
options:
prefix: "$"
name: "Event" #This will be displayed in every message, it's a bit useless, but I kinda like it
on chat:
if first character of message = {@prefix}:
if player has permission "staff.chat":
set {_sc} to message
replace {@prefix} in {_sc} with ""
if {_sc} is not "":
cancel event
loop all players:
replace {@prefix} in message with ""
if loop-player has permission "staff.chat":
if {scd.%loop-player's uuid%} is not true:
send "&b&l[S]&r&3 [%{@name}%]&r %player's prefix%%player%&r&7:&b %message%" to loop-player
if {scd::*} contains player's uuid:
send "&cWarn &8| &cYou have staff chat &4disabled&c however your message was still sent!"
else:
cancel event
send "&cError &8| &cYour message is &4Undefined&c!"
on chat:
if {autosc.%player's uuid%} is true:
if player has permission "staff.chat":
set {_sc} to message
replace {@prefix} in {_sc} with ""
if {_sc} is not "":
cancel event
loop all players:
replace {@prefix} in message with ""
if loop-player has permission "staff.chat":
if {scd.%loop-player's uuid%} is not true:
send "&b&l[S]&r&3 [%{@name}%]&r %player's prefix%%player%&r&7:&b %message%" to loop-player
if {scd::*} contains player's uuid:
send "&cWarn &8| &cYou have staff chat &4disabled&c however your message was still sent!"
else:
cancel event
send "&cError &8| &cYour message is &4Undefined&c!"
command togglestaffchat:
aliases: tsc
permission: staff.chat
trigger:
if {scd.%player's uuid%} is not true:
send "&cDisabled &8| &cDisabled your &4staff chat&c!"
set {scd.%player's uuid%} to true
else:
send "&aEnabled &8| &aEnabled your &2staff chat&a!"
set {scd.%player's uuid%} to false
command staffchat <text>:
permission: staff.chat
aliases: /sc
trigger:
loop all players:
if loop-player has permission "staff.chat":
if {scd::*} doesn't contain player's uuid:
send "&b&l[S]&r&3 [%{@name}%]&r &4%player%&r&7:&b %arg-1%" to loop-player
if {scd::*} contains player's uuid:
send "&cWarn &8| &cYou have staff chat &4disabled&c however your message was still sent!"
command autostaffchat:
permission: staff.chat
aliases: autosc, asc
trigger:
if {autosc.%player's uuid%} is true:
send "&cDisabled &8| &cDisabed your &4auto staff chat&c!"
set {autosc.%player's uuid%} to false
else:
send "&aEnabled &8| &aEnabled your &2auto staff chat&a!"
set {autosc.%player's uuid%} to true