Hi,
I'm trying to add the logging of rounds in Excl's jailbreak to ULX. I've looked through the log.lua file and it seems that the function is just ulx.logWriteLn( string ). However when I try to call this function in a hook, ULX seems to freak out and stop function. When the server first starts or the map changes it spams console with about 10 "invalid command" messages. The other error I've noticed is that fancyLogAdmin is nil, making most commands not work. This error only appears when you try to run a command the uses the fancyLog function.
It's even stranger because just commenting out the lines won't fix it. I've needed to completely delete the file and restart the server for ULX to start functioning again. My full code is below, if anyone has any idea as to why this might be happening please do share. This is going in garrysmod/addons/customulxcommands/lua/ulx/log.lua
hook.Add( "JailbreakRoundStart", "ULXLogJBRoundStart", function( gamemode, rounds )
ulx.logWriteLn( string.format( "Round %i is starting.", rounds ) )
end )
hook.Add( "JailbreakRoundEnd", "ULXLogJBRoundEnd", function( gamemode, rounds )
ulx.logWriteLn( string.format( "Round %i is ending.", rounds ) )
end )
And this might be helpful, here are the hook.Call functions for each of those hooks:
hook.Call("JailBreakRoundStart",JB.Gamemode,JB.RoundsPassed)
hook.Call("JailBreakRoundEnd",JB.Gamemode,JB.RoundsPassed);
JB.RoundsPassed is a non-zero positive integer, and JB.Gamemode is just a master table of sorts for the gamemode.