PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: angelsanges on 22 February, 2004, 22:56:26

Title: timeban after 3 kicks with reason...
Post by: angelsanges on 22 February, 2004, 22:56:26
it is possible a script that timebans a user after 3 kick?...

example: You're banned for 48 hours reason: 3kicks
Title:
Post by: nErBoS on 22 February, 2004, 23:21:52
It's possible to do but it haves to be changed in the script that you are using, because of the kick in the script.

But if you are using a script that don't have kick commands you only use the kick on the client

this may help you..

--Requested by angelsanges
--Made by nErBoS

Bot = "CounterKick"

kick = {}

function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(user, data)
if (kick[user.sName] == nil ) then
kick[user.sName] = 0
end
if (kick[user.sName] == 3 ) then
user:SendData(Bot, "You are been banned for 3 kicks.")
user:TimeBan(48*60)
kick[user.sName] = 0
end
end

function DataArrival(user, data)

if strfind(data,"is kicking") then
local _,_, name = strfind(data,"%b<>%s*%S+%sis%skicking%s(%S+)%sbecause:%s")
kick[name] = kick[name] + 1
end
end

Best regards, nErBoS