English Tibia Beg Kick!

8 replies
Goto Page
To the start Previous 1 Next To the start
18.11.12 07:19:13 pm
Up
loik
User
Offline Off
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...
18.11.12 07:27:08 pm
Up
Yates
Reviewer
Offline Off
Mak adimn plis.
Code:
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.
18.11.12 10:01:38 pm
Up
EP
User
Offline Off
Code:
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.
19.11.12 10:50:31 am
Up
EndDead
User
Offline Off
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
19.11.12 06:44:14 pm
Up
sheeL
User
Offline Off
Like This?

Code:
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
19.11.12 06:50:27 pm
Up
Suprise
BANNED
Offline Off
Blairstring has written:
Code:
1
addhook("say","canihaz",-999)


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


Why should be there a number?
Code:
1
-999

or
Code:
1
9

?
19.11.12 06:51:26 pm
Up
Trotskygrad
User
Offline Off
user sheeL has written:
Like This?

Code:
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

Code:
1
for _,word in pairs(begl) do


shouldn't it be

pairs(beg)
19.11.12 07:06:55 pm
Up
sheeL
User
Offline Off
user Trotskygrad has written:
user sheeL has written:
Like This?

Code:
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

Code:
1
for _,word in pairs(begl) do


shouldn't it be

pairs(beg)



sorry, my mistake
19.11.12 08:27:32 pm
Up
EP
User
Offline Off
user Suprise has written:
Blairstring has written:
Code:
1
addhook("say","canihaz",-999)


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


Why should be there a number?
Code:
1
-999

or
Code:
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