Hi all!
Seems I need some help saving and loading a table.
The table within code below works just fine, but I need to have the table saved at exit and loaded at scriptrestart.
I'd be very gratefull to get it working!!
-- PASSIVE.LUA
-- Keeps the number of Passive users limited to
Passive = { "Non-Registered Passive Users" }
MaxPassive = 100
function NewUserConnected(curUser)
if strfind(curUser.sMyInfoString, "M:P") then
if getn(Passive) > MaxPassive then
curUser:SendData("\r\n\r\n\t*** Sorry, but we do not allow more than "..MaxPassive.." PASSIVE users in the hub.\r\n\t*** Please try again later.\r\n")
curUser:Disconnect()
return 1
else
tinsert(Passive, curUser.sName)
-- Report the Passive Users (debug function)
for index=1,getn(Passive) do
SendToAll("\r\n\tArray["..index.."]\t"..Passive[index])
end
end
end
end
(Script is to be used in LUA4)