Forum

> > CS2D > Scripts > Bad Word ( Censor System )
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Bad Word ( Censor System )

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Bad Word ( Censor System )

Jhony
User Off Offline

Zitieren
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

alt Re: Bad Word ( Censor System )

Apache uwu
User Off Offline

Zitieren
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

alt Re: Bad Word ( Censor System )

EP
User Off Offline

Zitieren
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).
1× editiert, zuletzt 21.07.12 23:25:17

alt Re: Bad Word ( Censor System )

Apache uwu
User Off Offline

Zitieren
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.

alt Re: Bad Word ( Censor System )

DarkLight66
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht