Hi,
Is there a script that can limit the amout of passive users in a hub, like set the user limit to say 300 and only allow 50 passive users (example)
Can this be done, would be very nice :)
Thanx HeavensDevil :)
Hi!
This does not do a save, script restart will reset it, so careful! (Save would introduce a fake number and passive users could not log in.)
OPs arent checked.
-- maximum passive by bastya_elvtars, written for (??^(o)?He^a*ve^n~??e^v?L?^(o)??)
Bot="PassiveKiller"
maximum=50 -- max nuber of passive users that can be in the hub simultaneously
-- please dont edit below
loggedinpassive={}
function NewUserConnected(user)
if checknumber() if strfind (user.sMyInfoString,"M:P") then
loggedinpassive[user]=1
end
elseif checknumber()==maximum then
user:SendData(Bot,"No more passive users accepted, there are already "..maximum.." logged in!")
end
end
function UserDisconnected(user)
if loggedinpassive(user) then
loggedinpassive[user]=nil
end
end
function checknumber()
local arr={}
for a,b in loggedinpassive do
tinsert(arr,a)
end
return getn(arr)
end
I said this before (and will have to i know) that you should give feedbacks even if its works good. My self-confidence won1t be destroyed then ^^
ello,
i keep getting this error :(
Syntax error: attempt to call global `loggedinpassive' (a table value)
stack traceback:
1: function `UserDisconnected' at line 43 [file `...\0.330.b15.25.dbg\scripts\max passive users.lua']
Watch out for this small typo ;)
function UserDisconnected(user)
if loggedinpassive[b][[/b]user[b]][/b] then
loggedinpassive[user]=nil
end
end