ULX

Author Topic: Fancylog  (Read 3332 times)

0 Members and 1 Guest are viewing this topic.

Offline dankpepe

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 1
Fancylog
« 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.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Fancylog
« Reply #1 on: May 09, 2016, 05:07:40 AM »
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:

ulx/lua/ulx/modules/sh/
ulx.fancyLogAdmin()
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline dankpepe

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 1
Re: Fancylog
« Reply #2 on: May 09, 2016, 05:21:11 AM »
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:

ulx/lua/ulx/modules/sh/
ulx.fancyLogAdmin()

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.

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Fancylog
« Reply #3 on: May 16, 2016, 12:13:54 PM »
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.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Fancylog
« Reply #4 on: May 19, 2016, 03:03:08 PM »
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.
Experiencing God's grace one day at a time.