Forum

> > CS2D > Scripts > Tibia Beg Kick!
Forums overviewCS2D overview Scripts overviewLog in to reply

English Tibia Beg Kick!

8 replies
To the start Previous 1 Next To the start

old Tibia Beg Kick!

loik
User Off Offline

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

old Re: Tibia Beg Kick!

Yates
Reviewer Off Offline

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

old Re: Tibia Beg Kick!

EP
User Off Offline

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

old Re: Tibia Beg Kick!

EndDead
User Off Offline

Quote
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

old Re: Tibia Beg Kick!

sheeL
User Off Offline

Quote
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 !
edited 1×, last 19.11.12 07:44:27 pm

old Re: Tibia Beg Kick!

Suprise
BANNED Off Offline

Quote
Blairstring has written
1
addhook("say","canihaz",-999)


SheeL has written
1
addhook("say","bed",9)


Why should be there a number?
1
-999

or
1
9
?

old Re: Tibia Beg Kick!

Trotskygrad
User Off Offline

Quote
user sheeL has written
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)

old Re: Tibia Beg Kick!

sheeL
User Off Offline

Quote
user Trotskygrad has written
user sheeL has written
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

old Re: Tibia Beg Kick!

EP
User Off Offline

Quote
user Suprise has written
Blairstring has written
1
addhook("say","canihaz",-999)


SheeL has written
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
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview