Forum

> > CS2D > Scripts > Tibia Beg Kick!
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Tibia Beg Kick!

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Tibia Beg Kick!

loik
User Off Offline

Zitieren
Dear CS2D Players. I want to know if somebody can make a command for a Tibia server for me, all I just want is a function that as soon as they say "Can I have.../ Please give me..." they automatically get kicked? Please post the function A.S.A.P; I want this code because their is too many beggers in my tibia server, but also i cant kick them because i dont have the function to do it please help...

alt Re: Tibia Beg Kick!

Yates
Reviewer Off Offline

Zitieren
Mak adimn plis.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
elseif command =='y' then
	local target = tonumber(words:sub(4))
	local ip = player(target,"ip")
	local usgn = player(target,"usgn")
	if target then
		if player(target,'exists') then
			if target == id then
				msg2(id,'You may not temp. ban yourself!')
			end
			parse("banip "..ip.." 1440")
			parse("banusgn "..usgn.." 1440")
			return 1
		end
	end
	msg2(id,'Temp. ban IP and U.S.G.N.: "!y <targetid>"')
	return 1
end
Because kick is useless.

alt Re: Tibia Beg Kick!

EP
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("say","canihaz",-999)
function canihaz(id,t)
	begs = {"can i have","can i haz","can you give me","can you giv me","can you fuck me","please give me","pls giv me","no kill pls","be frends k?","open dor"}
	t = t:lower()
	for _,o in pairs(begs) do
		if string.find(t,o) then
			msg(player(id,"name").." got kicked for begging!");
			parse("kick "..id.." \"Don't beg\"");
			break;
		end
	end
	return 1;
end

This one works, add more sentences (if you want) in the begs table.

alt Re: Tibia Beg Kick!

EndDead
User Off Offline

Zitieren
LUA can't detect if a player is begging, and if you add a list of words, it would be bypasses easily.
Just check it manualy, and ban/kick/temp.ban them

alt Re: Tibia Beg Kick!

sheeL
User Off Offline

Zitieren
Like This?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
beg={
"fuck",
"gay",
"nb"}

addhook("say","bed",9)
function bed(id,t)
     for _,word in pairs(beg) do
          if t:lower():match(word) then
               parse("kick '..id..' "Don't Beg Please!")
               msg("©255000000 "..player(id,"name").." got Kicked for Begging !!!")
               return 1
          end
     end
end

Fine Works !
1× editiert, zuletzt 19.11.12 19:44:27

alt Re: Tibia Beg Kick!

Suprise
BANNED Off Offline

Zitieren
Blairstring hat geschrieben
1
addhook("say","canihaz",-999)


SheeL hat geschrieben
1
addhook("say","bed",9)


Why should be there a number?
1
-999

or
1
9
?

alt Re: Tibia Beg Kick!

Trotskygrad
User Off Offline

Zitieren
user sheeL hat geschrieben
Like This?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
beg={
"fuck",
"gay",
"nb"}

addhook("say","bed",9)
function bed(id,t)
     for _,word in pairs(begl) do
          if t:lower():match(word) then
               parse("kick '..id..' "Don't Beg Please!")
               msg("©255000000 "..player(id,"name").." got Kicked for Begging !!!")
               return 1
          end
     end
end

Fine Works !


you made a typo

1
for _,word in pairs(begl) do

shouldn't it be

pairs(beg)

alt Re: Tibia Beg Kick!

sheeL
User Off Offline

Zitieren
user Trotskygrad hat geschrieben
user sheeL hat geschrieben
Like This?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
beg={
"fuck",
"gay",
"nb"}

addhook("say","bed",9)
function bed(id,t)
     for _,word in pairs(begl) do
          if t:lower():match(word) then
               parse("kick '..id..' "Don't Beg Please!")
               msg("©255000000 "..player(id,"name").." got Kicked for Begging !!!")
               return 1
          end
     end
end

Fine Works !


you made a typo

1
for _,word in pairs(begl) do

shouldn't it be

pairs(beg)



sorry, my mistake

alt Re: Tibia Beg Kick!

EP
User Off Offline

Zitieren
user Suprise hat geschrieben
Blairstring hat geschrieben
1
addhook("say","canihaz",-999)


SheeL hat geschrieben
1
addhook("say","bed",9)


Why should be there a number?
1
-999

or
1
9
?

It's the priority the hook uses to react in the case of a message from a player (means it will be the last hook 'say' (if there are others) to execute). I've put to it -999 because it's not that important, so everybody can see what he wrote to check why he got kicked. If my hook had a high priority it will kick before everyone see the message of the kicked player. If you don't understand PM me and I'll explain you with more details
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht