Ulysses
General => Developers Corner => Topic started by: dankpepe on May 08, 2016, 07:59:06 PM
-
Is there a page anywhere where I can learn about fancylog admin? I'm not exactly sure how to use it or the variables.
-
I don't think there is any documentation for ULX functions, so it's unlikely there's a page about fancyLogAdmin. However another way you can learn about it is by looking at ULX's code. Just open up garrysmod/addons/ulx/lua/ulx/modules/sh/ and have a look around, you're likely to find a command that uses it. In addition you can look at the actual function in garrysmod/addons/ulx/lua/ulx/log.lua, line 409.
If you don't have a copy of ULX handy, you can view all of these things on GitHub (https://github.com/TeamUlysses/ulx):
ulx/lua/ulx/modules/sh/ (https://github.com/TeamUlysses/ulx/tree/master/lua/ulx/modules/sh)
ulx.fancyLogAdmin() (https://github.com/TeamUlysses/ulx/blob/master/lua/ulx/log.lua#L409)
-
I don't think there is any documentation for ULX functions, so it's unlikely there's a page about fancyLogAdmin. However another way you can learn about it is by looking at ULX's code. Just open up garrysmod/addons/ulx/lua/ulx/modules/sh/ and have a look around, you're likely to find a command that uses it. In addition you can look at the actual function in garrysmod/addons/ulx/lua/ulx/log.lua, line 409.
If you don't have a copy of ULX handy, you can view all of these things on GitHub (https://github.com/TeamUlysses/ulx):
ulx/lua/ulx/modules/sh/ (https://github.com/TeamUlysses/ulx/tree/master/lua/ulx/modules/sh)
ulx.fancyLogAdmin() (https://github.com/TeamUlysses/ulx/blob/master/lua/ulx/log.lua#L409)
The problem I have though is the variables. The only thing I can figure out is #A is calling ply, #T is target ply. I can make a fancy log, I just can't set up how I would like with more variables.
-
What I did is just looked at already existing code that uses the fancyLogAdmin (almost all commands do) and used that to sort of figure out what things mean. I believe #s references a table, and like you said before, #A = calling_ply (usually an Admin) and #T = target_ply.
Honestly though, those are really the only ones you'll need I think. Unless you're trying to go for a specific thing.
-
Sorry, I know the missing documentation in ULX is a bummer. Fancylog works as you've outlined above. Anything other than #A or #T gets passed as %<keycode> to string.format -- http://www.lua.org/manual/5.1/manual.html#pdf-string.format.