ULX

Author Topic: This documentation...  (Read 57 times)

0 Members and 1 Guest are viewing this topic.

Offline mark272

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
This documentation...
« on: March 07, 2019, 10:35:51 AM »
I don't understand the documentation.
For example where is ulx.command like ulx.command( CATEGORY_NAME, "ulx bring", ulx.bring, "!bring" )
I only found cmds.addCommand
And why is the method not fully entered? In documentation: ucl.registerAccess but in real code it is ULib.ucl.registerAccess
Could someone help me out here? I am so confused.
Thanks.
« Last Edit: March 07, 2019, 10:37:30 AM by mark272 »

Offline iViscosity

  • Hero Member
  • *****
  • Posts: 782
  • Karma: 51
Re: This documentation...
« Reply #1 on: March 07, 2019, 10:47:22 AM »
The method is being fully entered.

The syntax for ulx.command is
Code: Lua
  1. ulx.command("Category Name", "console command", function_name, "!chatcommand", hide_command, require_space)
  2.  

Where you have the category to sort the command into, the console command to use the command, the actual function to execute when using the command, and then three optional arguments: the chat command, whether or not the person using the command should have their use message show in chat (useful for things like !p where you don't want it to show), and whether or not to require a space between the chat command and the arguments (useful for asay (@message))

The documentation shows ucl.registerAccess because that's how it was in the source code.

At the very top of the file, they have this line:
Code: Lua
  1. local ucl = ULib.ucl
  2.  

Which just makes it easier for them to write. Referencing outside of that file is still "ULib.ucl.registerAccess", remember it's all contained under the main "ULib" table.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me a PM or Join my Discord!.
--==[ Links ]==--
Steam
YouTube
Steam Group (feel free to join!)
Discord

Quote from: Steve Jobs
Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.

Offline mark272

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: This documentation...
« Reply #2 on: March 07, 2019, 10:58:39 AM »
Ah thanks  ;D
But where is ulx.command in the documentation? I may not see it but the search gives nothing (good).

Offline iViscosity

  • Hero Member
  • *****
  • Posts: 782
  • Karma: 51
Re: This documentation...
« Reply #3 on: March 07, 2019, 11:05:49 AM »
There is no official documentation for ulx, just ULib (actually I was working on documentation for ulx a while ago but kinda forgot about it)

You can find the source for ulx.command here.
I'm iViscosity. I like gaming and programming. Need some help? Shoot me a PM or Join my Discord!.
--==[ Links ]==--
Steam
YouTube
Steam Group (feel free to join!)
Discord

Quote from: Steve Jobs
Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.