Shrimps.Admin.Tools.sk

Created by Shrimps

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

# Shrimpy's Staff Commands
#
# Version 1.0
# Website: shrimpsroll.github.io


# important infomation:
# The xray detector uses a counter in which every hour it adds to. if someone mines a diamond ore the counter goes down until 0 where the mods are notified and the ore will no longer mine.
# The xray detector isnt perfect and will not stop a player from xraying, thats your job! 
# If the detector is wrong about a player do /resetdiamonds [player]. This will set their timer to something higher.


# About Editing
# If your going to edit something please, make a back up of this!

options:
	# prefix for permission messages and staff chats
	prefix.admin: [§7Admin§r]
	# amount of warnings for a mute to be given
	amount.mute: 3
	# amount of warnings for a ban to be given
	amount.ban: 5
	# the cooldown for the /report command so it cant be spammed.
	report.cooldown: 120



















# command Perms
# Mute - skript.mute
# Ban - skript.ban
# Mutechat - skript.mutechat
# staffchat - sc.staffchat (DO NOT CHANGE)
# warn - skript.warn
# warnings - skript.warnings
# remove warning - skript.remove.warnings
# Set new join/leave message - skript.set.join_message
# show join/leave message - all
# broadcast - skript.broadcast
# vanish - skript.vanish
# reset diamond counter - skript.xray.reset

# Table of contents:
# Mute - Line 14
# Ban - Line 39
# Mute chat - line 59
# staffchat - line 75
# warn - line 91
# warnings - 126
# remove warning - line 141
# welcome/leave message - line 156
# show welcome/leave message - line 169
# broadcast - line 191
# vanish - line 202
# xray detector - line 226
# reset diamond counter - line 256
# report command - line 310
	
	
# Mute Command
# Usage: /mute [Player]
# Use again to toggle
command /mute <offline player>:
	permission: skript.mute
	permission message: You are not an admin
	trigger:
		if {mute::%arg-1's uuid%} is set:
			delete {mute::%arg-1's uuid%}
			send "{@prefix.admin}: Unmuted player %arg-1%"
		else:
			set {mute::%arg-1's uuid%} to true
			send "{@prefix.admin}: Muted player %arg-1%"

# Stops players if they are muted or if the chat is muted
on chat:
	cancel event
	if {mutechat} = true:
		send "Chat is currently Muted"
	else if {mute::%player's uuid%} = true:
		send "{@prefix.admin}: You're currently muted"
	else: 
		broadcast "%player%: %message%"

# Ban command
# Usage: /ban [Player]
# Use again to toggle
command /ban <offline player>:
	permission: skript.ban
	permission message: You are not an admin
	trigger:
		if {ban::%arg-1's uuid%} is set:
			delete {ban::%arg-1's uuid%}
			send "{@prefix.admin}: Unbanned player %arg-1%"
		else:
			set {ban::%arg-1's uuid%} to true
			send "{@prefix.admin}: Banned player %arg-1%"
			kick arg-1 because "You have Been Banned"

# stops players if they are banned
on join:
	if {ban::%player's uuid%} is set:
		kick player because "You have been Banned"

# Mute chat Command
# look above for how it stops chat
# Usage: /mutechat
# Use again to toggle
command /mutechat:
	permission: skript.mutechat
	permission message: [§7Console§r]: You are not admin.
	aliases: /mc
	trigger:
		if {mutechat} is set:
			delete {mutechat}
			broadcast "{@prefix.admin}: Chat has been unmuted by %player%"
		else:
			set {mutechat} to true
			broadcast "{@prefix.admin}: Chat has been muted by %player%"

# staffchat command
# Usage: /staffchat [message]
command /staffchat [<text>]:
    aliases: /sc, /a
    permission: sc.staffchat
    permission message: {@prefix.admin}: You do not have that permission
    trigger:
        if arg-1 is set:
            loop all players:
                if loop-player has permission "sc.staffchat":
                    send "{@prefix.admin} %player's display name%&7: %arg 1%" to loop-player
        else:
            message "{@prefix.admin}: Make sure to put text after the /sc"

# warn command
# Usage: /warn [player]
command /warn <offline player> [<text>]:
	permission: skript.warn
	permission message: [§7Console§r]: You are not admin.
	trigger:
		if arg-1 is not set:
			send "{@prefix.admin}: You cant warn nobody"
		else:
			if arg-2 is set:
				add 1 to {warn::%arg-1's uuid%}
				send ""
				send "{@prefix.admin}: %arg-1% has been warned for: %arg-2%"
				send "They now have %{warn::%arg-1's uuid%}% warnings."
				if {warn::%arg-1's uuid%} is {@amount.mute}:
					make console execute "mute %arg-1%"
					send "{@prefix.admin}: %arg-1% is now muted for having too many warnings"
				else if {warn::%arg-1%'s uuid} is {@amount.ban}:
					make console execute "ban %arg-1%"
					send "{@prefix.admin}: %arg-1% is now banned for having too many warnings"
			else:
				add 1 to {warn::%arg-1's uuid%}
				send ""
				send "{@prefix.admin}: %arg-1% has been warned for: Unspecified"
				send "{@prefix.admin}: They now have %{warn::%arg-1's uuid%}% warnings."
				#change how many warnings are needed for a mute below
				if {warn::%arg-1's uuid%} is {amount.mute}:
					make console execute "mute %arg-1%"
					send ""
					send "{@prefix.admin}: %arg-1% is now muted for having too many warnings"
					#change how many warnings are needed for a ban below
				if {warn::%arg-1's uuid%} is {amount.ban}:
					make console execute "ban %arg-1%"
					send ""
					send "{@prefix.admin}: %arg-1% is now banned for having too many warnings"
					remove 5 from {warn::%arg-1's uuid%}

# warnings command
# checks how many warnings a player has
# Usage: /warnings [player]
command /warnings <offline player>:
	permission: skript.warnings
	permission message: [§7Console§r]: You are not admin.
	aliases: /warns
	trigger:
		if arg-1 is not set:
			send "{@prefix.admin}: Please enter a players name to check their warnings"
		else:
			send ""
			send "{@prefix.admin}: %arg-1% has %{warn::%arg-1's uuid%}% warnings"

# remove a warning command
# removes a warnings
# Usage: /removewarnings [player] 
command /removewarning <offline player>:
	permission: skript.remove.warning
	permission message: [§7Console§r]: You are not admin.
	aliases: /rwarning, /rwarnings, rwarn, rwarns
	trigger:
		if arg-1 is not set:
			send "{@prefix.admin}: Please enter a player name to remove a warning"
		else:
			remove 1 from {warn::%arg-1's uuid%}
			send "{@prefix.admin}: They now have %{warn::%arg-1's uuid%}% warnings."

# Set a new welcome message or leave message command
# usage: /set [join|leave] message [text]
command /set <string> message <string>:
	permission: skript.set.join_message
	description: Sets message when player joins
	trigger:
		if argument-1 is "join" or "leave":
			set {custom messages::%argument-1%} to argument-2
			message "Set the %argument-1% message to '%argument-2%<reset>'"
		else:
			message "Only 'join' and 'leave' messages are available here."

# Show current join/leave message
# usage: /show [join|leave] message
command /show <string> message:
	description: Displays the message of the day
	trigger:
		if {custom messages::%argument%} is set:
			message {custom messages::%argument%}
		else:
			message "Only 'join' and 'leave' messages are available here."

# displays join message in chat
on join:
	set join message to {custom messages::join}

# displays leave message in chat
on quit:
	set leave message to {custom messages::leave}

# chat logger
on chat:
	log "%player%: %message%" to "chatlogs.log"

# broadcast command
# usage: /broadcast [text]
command /broadcast <text>:
	aliases: /bc
	permission: skript.broadcast
	permission message: {@prefix.admin}: Your Not An Admin
	trigger:
		broadcast "[§7Console§r] %arg-1%"

# vanish command
# usage: /v
# use again for toggle
#. not even gonna cap, this works rlly badly...
command /vanish:
	aliases: /v
	permission: skript.vanish
	permission message: {@prefix.admin}: Your Not An Admin
	trigger:
		if {vanish.%player%} is set:
			delete {vanish.%player%}
			remove invisibility from the player
			make console execute "gamemode survival %player%"
			loop all players:
				if loop-player has permission "sc.staffchat":
					send "{@prefix.admin} %player's display name%&7: has gone visible" to loop-player
		else:
			set {vanish.%player%} to true
			apply invisibility 2 to the player
			make console execute "gamemode creative %player%"
			loop all players:
				if loop-player has permission "sc.staffchat":
					send "{@prefix.admin} %player's display name%&7: has gone invisible" to loop-player




# xray detector
on join:
	set {xray.%player%} to 16
	
every 1 hour:
	loop all players:
		add 8 to {xray.%loop-player%}

on mine of diamond ore:
	if {xray.%player%} is not 0:
		remove 1 from {xray.%player%}
	else:
		send "Please wait for mods to help you."
		loop all players:
			if loop-player has permission "sc.staffchat":
				send "{@prefix.admin}: %player's display name%&7 is likely to be hacking" to loop-player

on mine of diamond ore:
	if {xray.%player%} is 0:
		cancel event
		wait 0.5 seconds
		set {xray.%player%} to 0

# testing command
command /d:
	permission: skript.testing.diamonds
	trigger:
		send "%{xray.%player%}%"

# reset players diamond counter
# usage: /resetdiamonds [player]
command /resetdiamonds <player>:
	permission: skript.xray.reset
	aliases: /resetdiamond
	permission message: [§7Console§r]: You are not admin.
	trigger:
		set {xray.%arg-1%} to 15
		send "[§7admin§r]: Counter Reset"
			




# report command allows players to report other players.
# usage: /report <player> <reason>
command /report <player> [<text>]:
	cooldown: {@report.cooldown} seconds
	trigger:
		if arg 1 is not set:
			send "Please enter a player"
		else:
			if arg 2 is not set:
				loop all players:
					if loop-player has permission "sc.staffchat":
						send "{@prefix.admin}: %player% has reported %arg-1% for unspecified" to loop-player
			else:	
				loop all players:
					if loop-player has permission "sc.staffchat":
						send "{@prefix.admin}: %player% has reported %arg-1% for %arg-2%" to loop-player

# end commands

# to add list:
# admin mode with gui
# toggleable staff chat