

#mute + clear



command /slowmode [<text>] [<text>]:
	trigger:
		if player doesn't have permission "chat.mute":
			message "&7[&c&lErreur&7] &4Tu n'as pas accés à la commande !" to player
			stop trigger
		if arg 1 is not set:
			message "&7[&c&lErreur&7] &4Mauvaise cammande !" to player
			stop trigger
		if arg 2 is not set:
			message "&7[&c&lErreur&7] &4Corect usage (/slowmode mute on/off) !" to player
		if arg 1 is "clear":
			loop 200 times:
				broadcast ""
			broadcast "&a&oChat a ete clear !"
		if arg 1 is "mute":
			if arg 2 is "on":
				set {muteall.on} to true
				broadcast "&c[&4KriipTionCraft&c] &aLe chat a temporerment ete mute !"
			if arg 2 is "off":
				set {muteall.on} to false
				broadcast "&c[&4KriipTionCraft&c] &aLe chat a ete reactive !"
		 
on chat:
	if {muteall.on} is true:
		if player doesn't have permission "chat.mute.use":
			cancel event
			message "&c[&4KriipTionCraft&c] &aLe chat est mute" to player

			


#antispam

			
command /timerchat [<text>]:
	aliases: tc, antispam
	permission: timerchat.use
	permission message: &c&l[Erreur] > &cTu n'as pas accès a cette commande !
	trigger:
		if arg 1 is not set:
			message "&7/timerchat off/delais"
		if arg 1 is "off":
			clear {timerchat.delai}
			broadcast "&4[AntiSpam] > &c Delai desactive !"
		if arg 1 is "faible":
			set {timerchat.delai} to false
			broadcast "&4[AntiSpam] > &c Délai regle à 2 secondes !"
		if arg 1 is "normal":
			set {timerchat.delai} to true
			broadcast "&4[AntiSpam] > &c Délai regle à 10 secondes !"
		if arg 1 is "fort":
			set {timerchat.delai} to 3
			broadcast "&c[&4AntiSpam&c] &4> &c Délai réglé à 30 secondes !"
			
			
on chat:
	if player doesn't have permission "chat.spam":
		if {timerchat.delai} is not set:
			stop
		if {timerchat.delai} is false:
			set {_diff} to difference between {Chat.%player%} and now
			if {_diff} is smaller than 2 seconds:
				message "&4&lAntiSpam > &cne spam pas !"
				cancel event
				stop
			set {Chat.%player%} to now
		if {timerchat.delai} is true:
			set {_diff} to difference between {Chat.%player%} and now
			if {_diff} is smaller than 10 seconds:
				message "&4&lAntiSpam > &cne spawn pas"
				cancel event
				stop
			set {Chat.%player%} to now
		if {timerchat.delai} is 3:
			set {_diff} to difference between {Chat.%player%} and now
			if {_diff} is smaller than 30 seconds:
				message "&c[&4&lAntiSpam&c] > &cne spam pas !"
				cancel event
				stop
			set {Chat.%player%} to now
			




			
#anti insulte	
			
command /insulte [<text>]:
	permission: insulte.use
	permission message: &c&l[Erreur] > &cTu n'as pas accès a cette command !!
	trigger:
		if arg 1 is not set:
			message "&7/insulte off/on"
		if arg 1 is "off":
			clear {insulte.on}
			message "&4[AntiSpam] > &c  AntiInsulte desactive !"
		if arg 1 is "on":
			set {insulte.on} to true
			message "&4[AntiSpam] > &c AntiInsulte active !"

on chat:
	if player doesn't have permission "insulte.use":
		if {insulte.on} is not set:
			stop
		if {insulte.on} is true:
			replace all "fdp", "ntm", and "ptn" with "***" in the message
			
			
command /ms [<text>]:
	trigger:
		if player doesn't have permission "ms.use":
			message "&7[&c&lErreur&7] &4Tu n'as pas accés à la command !" to player
			stop trigger
		if arg 1 is not set:
			message "&7[&c&lErreur&7] &4Corect usage :  /ms <message>" to player
			stop trigger
		if arg 1 is set:
			broadcast "%arg 1%"
			
command /join [<text>]:
	trigger:
		if player doesn't have permission "join.use":
			message "&7[&c&lErreur&7] &4Tu n'as pas accés à la command !" to player
			stop trigger
		if arg 1 is not set:
			message "&7[&c&lErreur&7] &4Corect usage :  /join <player>" to player
			stop trigger
		if arg 1 is set:
			broadcast "&4[+]&e%arg 1% vient de se connecter !"
			
command quit [<text>]:
	trigger:
		if player doesn't have permission "quit.use":
			message "&7[&c&lErreur&7] &4Tu n'as pas accés à la command !" to player
			stop trigger
		if arg 1 is not set:
			message "&7[&c&lErreur&7] &4Corect usage :  /quit <player>" to player
			stop trigger
		if arg 1 is set:
			broadcast "&4[-]&e%arg 1% vient de se deconnecter !"

		
		
		