Forum

> > CS2D > Scripts > Bad Word ( Censor System )
Forums overviewCS2D overview Scripts overviewLog in to reply

English Bad Word ( Censor System )

7 replies
To the start Previous 1 Next To the start

old Bad Word ( Censor System )

Jhony
User Off Offline

Quote
How to Script Word Inappropriate?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
badtal={
lixo,
bin,
fuck,
puta,
Desgracado,
desgracado,
cotoco,
cotocos,
merda,
Merda,
Cotoco,
Cotocos,
Lixo,
Gay,
gay,
viado,
Viado,
bixa,
Bicha,
Bixa,
bicha,
Nerd,
nerd,
NERD}

addhook("say","ina")
function ina(id,t)
if t == "..badtal.." then
parse("kick "..id)
msg2(id,"©255255255VAZA SEU MERDA")
msg("©255000000 "..player(id,"name").." Usou umas Palavras Inapropriadas no Servidor e Foi Kickado !")
return 1
end
end

old Re: Bad Word ( Censor System )

Apache uwu
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("say","ina")
function ina(id,t)
	local kick=false
	for _,word in pairs(badtal) do
		if string.find(string.lower(t),string.lower(word))~=nil then
			kick=true
			break
		end
	end
	if kick==true then
		parse("kick "..id)
		msg2(id,"©255255255VAZA SEU MERDA")
		msg("©255000000 "..player(id,"name").." Usou umas Palavras Inapropriadas no Servidor e Foi Kickado !")
		return 1
	end
end

old Re: Bad Word ( Censor System )

EP
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
badtal={
"lixo",
"bin",
"fuck",
"puta",
"caralho",
"desgracado",
"cotoco",
"merda",
"gay",
"viado",
"bixa",
"bicha",
"nerd"}

addhook("say","ina")
function ina(id,t)
	for _,word in pairs(badtal) do
		if t:lower():match(word) then
			msg2(id,"©255255255VAZA SEU MERDA")
			parse("kick "..id)
			msg("©255000000 "..player(id,"name").." Usou umas Palavras Inapropriadas no Servidor e Foi Kickado !")
			return 1
		end
	end
end
Remember that you want to know strings, not variables (They will give error cause they have no value).
edited 1×, last 21.07.12 11:25:17 pm

old Re: Bad Word ( Censor System )

Apache uwu
User Off Offline

Quote
You should get into the habit of using pairs for everything and ipairs only if you want to sort a table by index.

As a table such as:

1
2
3
4
5
6
battal={
	["index"]="word",
	[function() msg("hello") end]="word",
	[true]="word",
	[1]="word"
}

Are all valid, and he might want to add something like that if he wishes to add a punishment level for different types of words.

old Re: Bad Word ( Censor System )

DarkLight66
User Off Offline

Quote
It's strange that noone noticed that he's kicking the player before showing the message to him, and even if it showed it before, the player won't read it before the server kicks him.

About the script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
badtal={
"lixo",
"bin",
"fuck",
"puta",
"caralho",
"desgracado",
"cotoco",
"merda",
"gay",
"viado",
"bixa",
"bicha",
"nerd"}

addhook("say","ina")
function ina(id,t)
     for _,word in pairs(badtal) do
          if t:lower():match(word:lower()) then
               msg("©255000000 "..player(id,"name").." Usou umas Palavras Inapropriadas no Servidor e Foi Kickado !")
               parse("kick "..id.." \"©255255255VAZA SEU MERDA\"")
               return 1
          end
     end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview