View difference between Paste ID: MXBGr6ML and 57h5eDKe
SHOW: | | - or go back to the newest paste.
1
#-----------------------------#
2
#	   Anti-Adv.sk	      #
3
#	Code by mathhulk      #
4
#    Upload by BrettPlayMC    #
5
#-----------------------------#
6
7
options:
8
9
	# Use \nl  to specify a new line.
10-
	prefix: &c[ANTI-ADV] &7#This is the Skript prefix#
10+
	prefix: &c[TNTANTI-ADV] &7#This is the Skript prefix#
11
	adminperm: anti-adv.admin #This is the permission for all admin commands/args.#
12
	adminmsg: Possible advertising from &4%player%&c &8(&4%player's world%&8) &8: &c%{_msg}% #This is the message sent to staff if a player is caught advertising.#
13-
	warnmsg: &4Advertising &7is not allowed. #This is the message sent to the player if they advertise.#
13+
	warnmsg: &4Advertising &7is not allowed, Please stop or further action will be taken #This is the message sent to the player if they advertise.#
14-
	cmd: anti-adv #This is the main Skript command.#
14+
	cmd: aa #This is the main Skript command.#
15
	cmdperm: anti-adv.check #This is the main command permission#
16-
	cmdaliases: /antiadv, /aa, /antiad #This is the list of main command aliases that you can edit.#
16+
	cmdaliases: /antiad #This is the list of main command aliases that you can edit.#
17
	permmsg: &cYou cannot use that. #This is the message sent to people if they don't have permission.#
18
	argnotset: Please specify an &4argument&7. #This is sent if an argument in a command is NOT set.#
19
	checkmsg: &8&m----------------------&f \nl &4Warnings &8: &c%arg 2% \nl &4Amount &8: &c%{advertisement.warnings::%uuid of arg 2%}% \nl &4UUID &8: &c%uuid of arg 2% \nl &8&m----------------------&f #This is the message sent for checking.#
20
	resetmsg: The warning amount of &4%arg 2% &7have been reset. #This is sent when someone's warnings are reset.#
21
	resetallmsg: The warning amounts of &4all players &7have been reset. #This is sent if ALL player's warnings have been reset.#
22-
	fillmessage: I love this server! #This is the message that the advertisement is replaced with in chat.#
22+
	fillmessage: I just tried to advertised an unsafe IP but got blocked! #This is the message that the advertisement is replaced with in chat.#
23
	wordadded: &4%arg 2% &7has been added to the list of blocked words. #This is sent when a domain has been successfully added to the list of blocked domains in game.#
24
#	helpmessage: &8&m----------------------&f %nl% &4Check &8: &c/{@cmd} check [player] \nl &4Reset &8: &c/{@cmd} [resetall|reset] [player] \nl &4Add Words &8: &c/anti-adv add [word] \nl &8&m----------------------&f ##This is the help message.#
25
	helpmessage: &8&m----------------------&f \nl &4Check &8: &c/{@cmd} check [player] 
26
	notfound: &4%arg 1% &7is not a command. #This is sent if someone enters an invalid argument.#
27
	
28
#---------------------------#
29
#          NOTICE!          #
30
#     ^^^^        ^^^^      #
31
# IF YOU DO NOT KNOW WHAT   #
32
# YOU ARE DOING THEN DO NOT #
33
# EDIT THE SKRIPT BEYOND    #
34
#        THIS POINT!        #
35
#---------------------------#
36
37
on join:
38
	if {advertisement.warnings::%uuid of player%} is not set:
39
		set {advertisement.warnings::%uuid of player%} to 0
40
	
41
on chat:
42
	if message contains "%{blocked.words::*}%":
43
		set {_msg} to the message
44
		set message to "{@fillmessage}"
45
		add 1 to {advertisement.warnings::%uuid of player%} 
46
		loop all players:
47
			if loop-player has permission "{@adminperm}":
48
				send "{@prefix}{@adminmsg}" to loop-player
49
				stop
50
		send "{@prefix}{@warnmsg}"
51
					
52
command /{@cmd} [<text>] [<offlineplayer>]:
53
	permission: {@cmdperm}
54
	permission message: {@permmsg}
55
	aliases: {@cmdaliases}
56
	trigger:
57
		if arg 1 is not set:
58
			send "{@helpmessage}"
59
		else:
60
			if arg 1 is set:
61
				if arg 1 is "check":
62
					if arg 2 is not set:
63
						send "{@prefix}{@argnotset}"
64
					else:
65
						send "{@checkmsg}"
66
				if arg 1 is "reset":
67
					if player has permission "{@adminperm}":
68
						if arg 2 is not set:
69
							send "{@prefix}{@argnotset}"
70
						if arg 2 is set:
71
							set {advertisement.warnings::%uuid of arg 2%} to 0
72
							send "{@prefix}{@resetmsg}"
73
					else:
74
						send "{@permmsg}"
75
				if arg 1 is "resetall":
76
					if player has permission "{@adminperm}":
77
						set {advertisement.warnings::*} to 0
78
						send "{@prefix}{@resetallmsg}"
79
					else:
80
						send "{@permmsg}"
81
				if arg 1 is "add":
82
					if player has permission "{@adminperm}":
83
						if arg 2 is not set:
84
							send "{@prefix}{@argnotset}"
85
						if arg 2 is set:
86
							add arg 2 to {blocked.words::*}
87
							send "{@prefix}{@wordadded}"
88
					else:
89
						send "{@permmsg}"
90
				else if arg 1 is not "add" or "resetall" or "reset" or "check":
91
					send "{@prefix}{@notfound}"
92
on load:
93
	set {version} to "2.5"
94
	message "&c[ANTI-ADV] &7Successfully loaded &4Anti Advertisement V2 &8v&a%{version}%&7." to console
95
	set {antiadv2::running} to true
96
	if {antiask::running} is not set:
97-
		message "&c[ANTI-ADV] &7We couldn't find &4AntiAsk&7!" to console
97+
		message "&c[TNTANTI-ADV] &7We couldn't find &4AntiAsk&7!" to console
98-
		message "&c[ANTI-ADV] &7Make sure to download it on Spigot or by going here: &7&ohttps://www.spigotmc.org/resources/anti-ask-anti-ad-v1-hook-skript.32955/" to console
98+
		message "&c[TNTANTI-ADV] &7Make sure to download it on Spigot or by going here: &7&ohttps://www.spigotmc.org/resources/anti-ask-anti-ad-v1-hook-skript.32955/" to console
99
100
on unload:
101-
	message "&c[ANTI-ADV] &7Successfully unloaded &fAnti Advertisement V2 &8v&a%{version}%&7.  Goodbye!" to console
101+
	message "&c[TNTANTI-ADV] &7Successfully unloaded &fAnti Advertisement V2 &8v&a%{version}%&7.  Goodbye!" to console
102
	delete {antiadv2::running}