PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Krysalis on 12 June, 2005, 19:51:05

Title: [Request]Disconnect
Post by: Krysalis on 12 June, 2005, 19:51:05
Hello,
Im search a simple script which only disconnect the User without tempban & co.
cmd should be like +disc User Reason.
And would be nice if there are on/off Funktion for each Profile. ( based on Profile Nr.)

Ive searched the Forum, but dont find this. Anyone can do for me?

Title:
Post by: Krysalis on 13 June, 2005, 11:02:54
No one can do this?
Title:
Post by: Dessamator on 13 June, 2005, 12:10:54
yeah its so darn simple nobody bothers to do so, either way it already exists probably  !
Title:
Post by: jiten on 13 June, 2005, 12:13:40
Give this a try:
-- Disconnect v1.0 by jiten (6/14/2005)
-- with: Immune Profiles/Allowed Profiles
-- based on Kick & Warn 1.0

sBot = frmHub:GetHubBotName() -- bot name

AllowedProfiles = {
[-1] = 0, -- unreg
[0] = 1, -- master
[1] = 1, -- operator
[2] = 0, -- vip
[3] = 0, -- reg
[4] = 1, -- moderator
[5] = 1, -- founder
}

ImmuneProfiles = {
[-1] = 0, -- unreg
[0] = 1, -- master
[1] = 0, -- operator
[2] = 0, -- vip
[3] = 0, -- reg
[4] = 0, -- moderator
[5] = 1, -- founder
}

function ChatArrival (user,data)
local data=string.sub(data,1,-2)
local s,e,cmd = string.find ( data, "%b<>%s+[%!%?%+%#](%S+)" )
if cmd then
local s,e,usr,reason = string.find( data, "%b<>%s+%S+%s+(%S+)%s*(.*)" )
local tCmds = {
["disc"] = function(user,data)
if AllowedProfiles[user.iProfile] == 1 then
if usr == nil or reason == nil then
user:SendData(sBot, "*** Syntax Error: Type !disc ")
else
local victim = GetItemByName(usr)
if (victim == nil) then
user:SendData(sBot, "*** Error: The user "..usr.." is not online.")
else
if ImmuneProfiles[victim.iProfile] ~= 1 then
SendToOps(sBot, victim.sName.." is being disconnected by "..user.sName.." because: "..reason)
victim:SendPM(sBot, "You are being disconnected because: "..reason) victim:Disconnect()
else
user:SendData(sBot,"*** Error: You can't disconnect Immune Profile Users.")
end
end
end
else
user:SendData(sBot,"*** Error: You are not allowed to use this command.")
end
end,
}
if tCmds[cmd] then return tCmds[cmd](user,data), 1 end
end
end

Best regards
Title:
Post by: Krysalis on 14 June, 2005, 06:47:55
Thx Jiten for doing.  
Can you add a message in Main send to ops if someone be +disconnectet?
Perfect Work as always. Runs fine:)

Greets
Title:
Post by: jiten on 14 June, 2005, 10:40:33
QuoteOriginally posted by Krysalis
Thx Jiten for doing.  
Can you add a message in Main send to ops if someone be +disconnectet?
Perfect Work as always. Runs fine:)

Greets
First post updated with your request.

Best regards
Title:
Post by: Krysalis on 14 June, 2005, 11:53:21
Thanks for fast answer. Runs ;-)

Greets