PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: Jaakko on 30 August, 2007, 11:50:20

Title: Kick & warn script.
Post by: Jaakko on 30 August, 2007, 11:50:20
I need a script that kicks user if he has been warned 3 times, and after 3 kicks will automagically ban him for 6 hours.
Protection for profiles would be nice, but isn't necessary.

Profiles:
[-1] = 0, -- unreg
[0] = 1, -- admin
[1] = 1, -- master
[2] = 1, -- operator
[3] = 0, -- vip
[4] = 0, -- reg
Title: Re: Kick & warn script.
Post by: CrazyGuy on 30 August, 2007, 16:26:57
I made this script, but i can't find it back  :-\
I know it's being used in a hub, I'll ask the owner to attach it.
Title: Re: Kick & warn script.
Post by: -SkA- on 30 August, 2007, 16:44:47
ChatArrival = function(User,Data)
local _,_,cmd,sNick,sReason = string.find(Data, "%b<>%s%p(%S+)%s(%S+)%s(.*)|")
if (cmd) and (cmd =="warn") then
local Prof = GetProfilePermissions(User.iProfile)
if (Prof.bKick) then
if (sReason) then
local Victim = GetItemByName(sNick)
if Victim then
if (Victim.iProfile == -1) or (Victim.iProfile > User.iProfile) then
Victim:SendPM(frmHub:GetHubBotName(), "You have been warned by "..User.sName.." because: "..sReason)
SendToAll(frmHub:GetHubBotName(), sNick.." has been warned because: "..sReason)
else
User:SendData(frmHub:GetHubBotName(), "Forget it, "..sNick.." is more powerful than you.")
end
else
User:SendData(frmHub:GetHubBotName(), sNick.." is not online")
end
else
User:SendData(frmHub:GetHubBotName(),"Please specify a reason")
end
else
User:SendData(frmHub:GetHubBotName(), "You are not allowed to use this command")
end
return 1
end
end

OpConnected = function(User)
local Prof = GetProfilePermissions(User.iProfile)
if (Prof.bKick) then
User:SendData("$UserCommand 1 3 "..frmHub:GetHubName().."\\Warn$<%[mynick]> !warn %[nick] %[line:Reason]&#124;|")
end
end