Can't mute / don't know about temp timers

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Adrenaline

Member
May 17, 2020
2
0
1
19
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?

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!
 
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::%arg-1%} to arg 2
            set {punished::%arg-1%} to arg 1
            set {player::%player%} to player
            set {muted_type::%arg-1%} to "perm"
            set {trypvp::muted::%arg-1%} to true
            send "&4Punish>&9 You muted &c%{punished::%arg-1%}% because &e%{reason::%arg-1%}%"
            send "&4Punish>&9 You can't talk because you're muted by %player% because %{reason::%arg-1%}%" to arg 1
            send "&4Punish> &9&lMute Reason: %{Reason::%arg-1%}%" 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::%arg-1%}% because %{reason::%arg-1%}%" to loop-player                     
on chat:
    if {trypvp::muted::%player%} is true:
        if {muted_type::%player%} is "perm":
            send "&4Punish> &9You can't talk because you're muted by &c%{player}% &9because &e%{reason}% for &ePermanent" to player
            cancel event
            stop
on chat:
    if {uaremuted::%player%} is true:
        send "&4Punish> &cYou can't talk because you're muted by &3&l%{punisher::%player%}% &cbecause &3&l%{mutereason::%player%}% &cfor &3&l%{timetype::%player%}% %{timetype2::%player%}%" to player
        cancel event
        stop       
command /tempmute [<offline player>] [<text>] [<text>] [<text>]:
    permission: trypvp.tempmute
    permission message: &4Permission>&9 You do not have permission!
    trigger:
        if arg 4 is not set:
            send "&4Usage>&9 Command Usage:&c /tempmute <player> <time> <minute/hour/day> <reason> &4Admin"
        if arg 4 is set:
            broadcast "&4Punish> &c%arg-1% &3muted by &c%player%&3."
            broadcast "&4Punish> Mute Reason: &c%arg-4%"
            broadcast "&4Punish> Mute Duration: &c%arg-2% %arg-3%."
            send "&4Punish> &cYou are muted by &3%player%. &cYou can't speak from now on" to arg-1
            send "&4Punish> &aPlayer successfully muted."
            set {timetype::%arg-1%} to arg-2
            set {timetype2::%arg-1%} to arg-3
            set {mutereason::%arg-1%} to arg-4
            set {punisher::%arg-1%} to player
            set {uaremuted::%arg-1%} to true
            if arg-3 is "second" or "seconds":
                wait "%{timetype::%arg-1%}% seconds" parsed as timespan
                set {uaremuted::%arg-1%} to false
            else if arg-3 is "minute" or "minutes":
                wait "%{timetype::%arg-1%}% minutes" parsed as timespan
                set {uaremuted::%arg-1%} to false
            else if arg-3 is "hour" or "hours":
                wait "%{timetype::%arg-1%}% hours" parsed as timespan
                set {uaremuted::%arg-1%} to false
            else if arg-3 is "day" or "days":
                wait "%{timetype::%arg-1%}% days" parsed as timespan
                set {uaremuted::%arg-1%} to false       
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::%arg-1%} to arg 2
            set {uaremuted::%player%} to false
            set {punished::%arg-1%} to arg 1
            send "&4Punish>&9 You unmuted %{punished::%arg-1%}% because %{reason::%arg-1%}%" to player
            send "&4Punish>&9 You have been unmuted by &c%player%&9 because&e %{reason::%arg-1%}%" to arg-1
            loop all players:
                if loop-player has permission "trypvp.punishments":
                    if loop-player is player:
                        stop
                    else:
                        send "&4Punish>&9 %player% has unmuted &e%{punished::%arg-1%}%&9 because &e%{reason::%arg-1%}%"

Temporary mute is all different. I rewrote it from the beginning (but system is same, just little bit different)
If you read 1-2 times, you will understand what is different.
If you don't understand something, you can ask me.

Even so, it is better to use plugins in such classic systems. :emoji_slight_smile:
 
Status
Not open for further replies.