Hi there, i was wondering if anyone could help me, i'm looking for a basic script to run along side Robocop v10.01c The point of the new script would be to be able to set my maximum users as high or low as i want but to put a limit on the amount of unregisterd users that can connect to the hub, for example 100.
Thanks in advance for any help in this matter, Sneeks
Done quickly and not tested....
-- Limit unregged users
-- By [UK]Madman
sBot = "Unreg-counter"
iMaxunreg = 100
iCurrentunreg = 0
function Main()
for key,value in frmHub:GetOnlineUsers() do
if not value.bRegistered then
iCurrentunreg = iCurrentunreg + 1
end
end
end
function NewUserConnected(tCuruser)
if not tCuruser.bRegistered then
iCurrentunreg = iCurrentunreg + 1
if iCurrentunreg >= iMaxunreg then
tCuruser:SendData(sBot,"Unfortunatly, there are too many unregistered users in the hub, Please try again later!")
tCuruser:Disconnect()
end
end
end
function UserDisconnected(tCuruser)
if not tCuruser.bRegistered then
iCurrentunreg = iCurrentunreg - 1
end
end
That seems to be working great, i knew that to someone in the know it would be a simple task thank you very much for your time, Sneeks
Maby with this function added
function UserDisconnected(tCuruser)
if not tCuruser.bRegistered then
iCurrentunreg = iCurrentunreg - 1
end
end
:P :P :P
Edited Code
??????Hawk??????
OOoooppppssssssyyyyyyy
Thanks hawk, ill add that to the above :P :P
Fancy forgetting to take leaving users into account :P :P
hehehehehe easy done m8 ...
youll notice every post i make with code is always edited ... lolol
??????Hawk??????
Nice option!
Maybe NOT so nice, but..... would it also be possible to give preference to REGGED users once the max number of users has been reached?
What I would like is:
if a regged users wishes to enter while hub is full, then (at random) disconnect an unregged user after having sent him/her an apologizing PM.
Just wondering if it can be done.
If it can, I'll do it. 8)
Thnx in advance.