I'm writing a bunch of scripts for my server, and most of them have been working with just a little bit of time. I've made a script for muting players for my BIG script project. When I type /mute <player> <reason> it does everything it should, message wise. But when a muted player tries to speak, they can still speak. And before making changes, it would mute the whole chat with the variable {trypvp.muted.%player%}. Does anyone know how to fix this?
I would also like to know how to get a countdown timer for /tempmute.
Also, I want to know how to set chat prefixes and formats, such as "Owner Adrenaline message" but that's not my first priority.
Thanks!
Code:
command /mute [<offline player>] [<text>]:
permission: trypvp.mute
permission message: &4Permission>&9 You do not have permission!
trigger:
if arg 2 is not set:
send "&4Usage>&9 Command Usage: &c/mute <player> <reason> &4Admin"
if arg 2 is set:
set {reason} to arg 2
set {punished} to arg 1
set {player} to player
set {muted_type} to "perm"
set {trypvp::muted::%arg-1%} to "true"
send "&4Punish>&9 You muted &c%{punished}% because &e%{reason}%"
send "&4Punish>&9 You can't talk because you're muted by %{player}% because %{reason}%" to arg 1
send "&4Punish> &9&lMute Reason: %{Reason}%" to arg 1
send "&4Punish>&9 Believe this was false? Appeal at trypvp.enjin.com" to arg 1
loop all players:
if loop-player has permission "trypvp.punishments":
send "&4Punish>&9 %{player}% has issued a mute on %{punished}% because %{reason}%" to loop-player
on chat:
if {trypvp::muted::%arg-1%} is "true":
if {muted_type} is "perm":
send "&4Punish> &9You can't talk because you're muted by &c%{player}% &9because &e%{reason}% for &ePermanent" to {punished}
cancel event
stop
if {muted_type} is "temp":
set {waited} to difference between now and {trypvp::%arg-1%::muted::when}
if {waited} is less than {trypvp::%arg-1%::muted::time}:
send "&4Punish> &9You can't talk because you're muted by &c%{player}% because &e%{reason}% for &ePermanent" to {punished}
cancel event
stop
command /tempmute [<offline player>] [<text>] [<text>]:
permission: trypvp.tempmute
permission message: &4Permission>&9 You do not have permission!
trigger:
if arg 3 is not set:
send "&4Usage>&9 Command Usage:&c /tempmute <player> <time:minute/hour/day> <reason> &4Admin"
if arg 3 is set:
set {reason} to arg 3
set {punished} to arg 1
set {player} to player
set {muted_type} to "temp"
set {trypvp::%player%::muted::when} to time
set {trypvp::%player%::muted::time} to arg 2
set {trypvp::muted::%arg-1%} to "true"
send "&4Punish>&9 You muted %{punished}% because %{reason}% for &e%{trypvp.%player%.muted::time}%" to player
send "&4Punish>&9 You can't talk because you're muted by %{player}% because %{reason}%" to arg 1
send "&4Punish> &9&lMute Reason: %{reason}%" to arg 1
send "&4Punish> &9&lMute Duration: %{trypvp::%player%::muted::time}%" to arg 1
send "&4Punish>&9 Believe this was false? Appeal at trypvp.enjin.com" to arg 1
loop all players:
if loop-player has permission "trypvp.punishments":
send "&4Punish>&9 %{player}% has issued a mute on %{punished}% because %{reason}% for &e%{trypvp.%player%.muted::time}%" to loop-player
command /unmute [<offline player>] [<text>]:
permission: trypvp.unmute
permission message: &4Permission>&9 You do not have permission!
trigger:
if arg 2 is not set:
send "&4Usage>&9 Command Usage:&c /unmute <player> <reason> &bQuality Assurance"
if arg 2 is set:
set {trypvp::muted::%arg-1%} to "false"
set {player} to player
set {reason} to arg 2
set {punished} to arg 1
send "&4Punish>&9 You unmuted %{punished}% because %{reason}%" to player
send "&4Punish>&9 You have been unmuted by &c%{player}%&9 because&e %{reason}%" to {punished}
loop all players:
if loop-player has permission "trypvp.punishments":
send "&4Punish>&9 %{player}% has unmuted &e%{punished}%&9 because &e%{reason}%"
I would also like to know how to get a countdown timer for /tempmute.
Also, I want to know how to set chat prefixes and formats, such as "Owner Adrenaline message" but that's not my first priority.
Thanks!