Jump to content

Simple /warn script


Recommended Posts

For servers that need a simple warn script that keeps track of a player's history

(Doesn't include any automatic punishment system)

#██╗    ██╗ █████╗ ██████╗ ███╗   ██╗
#██║    ██║██╔══██╗██╔══██╗████╗  ██║
#██║ █╗ ██║███████║██████╔╝██╔██╗ ██║
#╚███╔███╔╝██║  ██║██║  ██║██║ ╚████║
# ╚══╝╚══╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝
# Made by MrTibo

# Commands
# /warn <player> [reason]
# /warns [player]
# /delwarn <player> <warn nr.>
# /clearwarns <player>

# Configuration section
	# Prefix
	prefix: &c&lWARN
	# Text color
	tc: &6
	# Highlight color
	hc: &e
	# Warn admin (/warn, /delwarn, /clearwarns)
	perm: warn.admin
	# View warns permission
	permvw: warn.viewwarns

# Script

command /warn [<offlineplayer>] [<text>]:
	permission: {@perm}
	permission message: &cNo permission
	usage: /warn <player> [reason]
		if arg 1 is set:
			if arg 2 is not set:
				add "(No reason given) &7- [%now%]" to {warns::%arg 1's uuid%::*}
				broadcast "{@prefix} {@hc}%arg 1% {@tc}was warned"
			if arg 2 is set:
				add "%colored arg 2% &7- [%now%]" to {warns::%arg 1's uuid%::*}
				broadcast "{@prefix} {@hc}%arg 1% {@tc}was warned for {@hc}%colored arg 2%"
			send "{@prefix} {@tc}Please provide a player"

command /delwarn <player> <int>:
	usage: /delwarn <player> <warn nr>
	permission: {@perm}
		if {warns::%arg 1's uuid%::%arg 2%} is set:
			delete {warns::%arg 1's uuid%::%arg 2%}
			send "{@prefix} {@tc}Warn deleted"
			loop {warns::%arg 1's uuid%::*}:
				add loop-value to {_warns::*}
			clear {warns::%arg 1's uuid%::*}
			loop {_warns::*}:
				add loop-value to {warns::%arg 1's uuid%::*}
			send "{@prefix} {@tc}This warn number wasn't found"

command /clearwarns <player>:
	permission: {@perm}
		delete {warns::%arg's uuid%::*}
		send "{@prefix} {@tc}Warns deleted"
		send "{@prefix} {@tc}Your warns were cleared" to arg

command /warns [<offlineplayer>]:
	permission: {@permvw}
	usage: /warns [player]
		if arg is set:
			send "{@prefix} {@hc}%arg% {@tc}has {@hc}%size of {warns::%arg's uuid%::*}% {@tc}warns"
			loop {warns::%arg's uuid%::*}:
				send "{@hc}%loop-index% &7- {@tc}%loop-value%"
			send "{@prefix} {@tc}Checking warns of all online players"
			loop all players:
				if size of {warns::%loop-player's uuid%::*} >= 1:
					send "{@prefix} {@hc}%loop-player% {@tc}has {@hc}%size of {warns::%loop-player's uuid%::*}% {@tc}warns"
					loop {warns::%loop-player's uuid%::*}:
						send "{@hc}%loop-index-1% &7- {@tc}%loop-value-2%"



DMs open - Discord » mrtibo | or send a forum message

Link to comment
Share on other sites

Cool Skript!

  • Like 1

Discord - tarna256

In-game name - _Tarna_

Website - https://tarna.dev
Paste Site: https://paste.tarna.dev


[VIP] - 7/27/2020

Support - 7/8/20 | 11/3/20

Helper  - 11/3/20 - 2/21/21

Moderator - 2/21/21 - 5/17/21

❤️ - 5/17/21 - now

Moderator - 12/20/22 - now



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...