Hi There.. i'm looking 4 a stand alone function CountOPs() and vips.. :))
Tks in advance.
quick job, hope it works.
ops =0
vips = 0
VIPS = {}
OPS = {}
function NewUserConnected(user)
if user.iProfile == 2 then
CountVips(user)
end
end
function OpConnected(user)
CountOps(user)
end
function DataArrival(user,data)
if user.bOperator then
CountOps(user)
elseif user.iProfile == 2 then
CountVips(user)
end
end
function CountOps(user)
if OPS[user.sName] == nil then
OPS[user.sName]=1
ops = ops + 1
end
end
function CountVips(user)
if VIPS[user.sName] == nil then
VIPS[user.sName]=1
vips=vips +1
end
end
function UserDisconnected(user)
if user.iProfile == 2 then
if VIPS[user.sName] then
VIPS[user.sName]=nil
vips=vips - 1
end
end
end
function OpDisconnected(user)
if OPS[user.sName] then
OPS[user.sName]=nil
ops = ops -1
end
end
plop
QuoteOriginally posted by plop
quick job, hope it works.
ops =0
vips = 0
VIPS = {}
OPS = {}
function NewUserConnected(user)
if user.iProfile == 2 then
CountVips(user)
end
end
function OpConnected(user)
CountOps(user)
end
function DataArrival(user,data)
if user.bOperator then
CountOps(user)
elseif user.iProfile == 2 then
CountVips(user)
end
end
function CountOps(user)
if OPS[user.sName] == nil then
OPS[user.sName]=1
ops = ops + 1
end
end
function CountVips(user)
if VIPS[user.sName] == nil then
VIPS[user.sName]=1
vips=vips +1
end
end
function UserDisconnected(user)
if user.iProfile == 2 then
if VIPS[user.sName] then
VIPS[user.sName]=nil
vips=vips - 1
end
end
end
function OpDisconnected(user)
if OPS[user.sName] then
OPS[user.sName]=nil
ops = ops -1
end
end
plop
Thank U Plop, what i really want is to put that script into this one, to get these line
user:SendData(Bot, " ? Ops Online: "..OPS[user.sName]..".")
i tried to merge them, But is not working for me :( i allways get 1 Op and if there is no Ops the script get error syntax..
Bot = "[operserv]"
--frmHub:RegBot(Bot)
function NewUserConnected(user)
local s,e,share = strfind(user.sMyInfoString, "$(%d+)%$")
share = format("%0.2f", ( share / (1024*1024*1024) ))
local hubshare = format("%0.2f", ( frmHub:GetCurrentShareAmount() / (1024*1024*1024) ))
user:SendData(Bot, ":p2p:-------------------------------------------------------------------------------------------------:p2p:")
user:SendData(Bot, " ? "..user.sName..", Bem vindo ao -=[- "..frmHub:GetHubName().." -]=-")
user:SendData(Bot, " ? Seu endere?o IP: "..user.sIP)
user:SendData(Bot, " ? Website: [URL]www.lusobrasil.tk[/URL]")
user:SendData(Bot, " ? Seu status no Hub: "..(GetProfileName(user.iProfile) or "N?o registrado"))
user:SendData(Bot, " ? Voc? est? compartilhando: "..share.." GB.")
user:SendData(Bot, " ? Usu?rios Online: "..frmHub:GetUsersCount()..".")
user:SendData(Bot, " ? Compartilhamento atual no Hub: "..hubshare.." GB.")
user:SendData(Bot, " ? Digite: !ajuda no main chat.")
user:SendData(Bot, ":p2p:-------------------------------------------------------------------------------------------------:p2p:")
end
function OpConnected(user)
local s,e,share = strfind(user.sMyInfoString, "$(%d+)%$")
share = format("%0.2f", (share / (1024*1024*1024)))
local hubshare = format("%0.2f", (frmHub:GetCurrentShareAmount() / (1024*1024*1024)))
user:SendData(Bot, ":p2p:-------------------------------------------------------------------------------------------------:p2p:")
user:SendData(Bot, " ? "..user.sName..", Bem vindo ao -=[- "..frmHub:GetHubName().." -]=-")
user:SendData(Bot, " ? Seu endere?o IP: "..user.sIP)
user:SendData(Bot, " ? Website: [URL]www.lusobrasil.tk[/URL]")
user:SendData(Bot, " ? Seu status no Hub: "..(GetProfileName(user.iProfile) or "N?o registrado"))
user:SendData(Bot, " ? Voc? est? compartilhando: "..share.." GB.")
user:SendData(Bot, " ? Usu?rios Online: "..frmHub:GetUsersCount()..".")
user:SendData(Bot, " ? Compartilhamento atual no Hub: "..hubshare.." GB.")
user:SendData(Bot, " ? Digite: !ajuda e !ajuda.op no main chat.")
user:SendData(Bot, ":p2p:-------------------------------------------------------------------------------------------------:p2p:")
end
Sorry the english !! =\
Ruuning Ptokax td4
Thank U Plop .. working fine !! :)