Closed Exmirai closed 10 years ago
That doesn't seem to be the part that's crashing. It's crashing from a ReadTable call.
In any case, can you try running this?
function display( t, indent )
local s = ''
for k,v in pairs( t ) do
for i=0,indent do
s = s .. '\t'
end
s = s .. k .. ' (' .. type( k ) .. ')' .. ': ' .. ((type( v ) == 'table') and (' (table)\n' .. display( v, indent+1 )) or (tostring( v )) .. ' (' .. type( v ) .. ')' ) .. '\n'
end
return s .. '\n'
end
function BanSys.SaveData()
local sr = GetSerialiser( 'admin/bandata.dat', FSMode.WRITE )
local t = BanSys.Bans
local z = 'Ban'
print( 'writing test:\n' )
print( display( t, 0 ) )
-- sr:AddTable( z, t )
-- sr:Close()
-- sr = nil
end
yes, that executed perfectly
What did it show? =p
1
tables : BanSys = { Bans = {"lal", "lol"} }
Serialising the above table worked fine for me on client and server.
ok, that work now... but there is another problem: my "Plugin" use modules ( bansys.lua, accounts.lua etc... ) so when i'm start server or type /lua_reload Server load tables from /japlus/sv/plugin name/admins.data. but, when i'm trying to save data manually by BanSys.Save() ( this function is in Bansys.lua ) then server saves file in /japlus/sv/(NULL)/admins.data why so? :( how to fix?
How are you running Bansys.lua?
in plugin.lua : function Init () require 'BanSys.lua' local test = BanSys.LoadData if not test then print("ERROR") else BanSys.LoadData() end end
Looks like you haven't registered the plugin? Try that in plugin.lua
if i put function in plugin.lua it works perfecly but i want that function was in BanSys.lua
Are you using require
after the call to RegisterPlugin
?
yea, can i send to you part of code for analysis, it will be much easier,
https://www.dropbox.com/s/yfx0iaedt3hptj8/Elib2.zip - Some parts of code
CRASH LOG:
Part of Code: