I have this code which I am trying to get to work... The problem I am having is to get this table to sort it self right after it is updated and get sent to client for viewing.
[code]
AdvLogger_logsList = {}
function AdvLogger_AddEvent(ply, _desc)
local date = os.date("*t")
date = string.format("%02d/%02d/%d %02d:%02d:%02d", date.month, date.day, date.year, date.hour, date.min, date.sec)
AdvLogger_logsList["event" .. tostring(table.Count(AdvLogger_logsList))] = {number = table.Count(AdvLogger_logsList), time = date, player = ply, desc = _desc}
table.SortByKey(AdvLogger_logsList, "number")
end
[/code]
I get this big nasty error
[code]
[ERROR] lua/includes/extensions/table.lua:146: attempt to compare two table values
1. unknown - lua/includes/extensions/table.lua:146
2. sort - [C]:-1
3. SortByKey - lua/includes/extensions/table.lua:146
4. AdvLogger_AddEvent - addons/advlogger/lua/autorun/files/al_server.lua:30
5. v - addons/advlogger/lua/autorun/files/al_events.lua:3
6. Call - lua/includes/modules/hook.lua:84
7. GMODSpawnProp - gamemodes/sandbox/gamemode/commands.lua:166
8. unknown - gamemodes/sandbox/gamemode/commands.lua:19
9. unknown - lua/includes/modules/concommand.lua:69
[/code]
[B]One thing thats important to know is that this table is on server side and gets transfered to client side. And it is at client side where I get the table all messed up and not sorted at all.[/B]
Thanks for the help.
Sorry, you need to Log In to post a reply to this thread.