Wasn't quite sure where to toss this, so I'll put it here. Feel free to move.Hi, everyone!
So, I've noticed there's not much by way of a ULX command documentation out there—the way I've had to find out how to use ULX's internal functions was to search around premade plugins and build my own.
I decided to scrap together a reference template for making ULX commands as a result of that—the hunt and build method got a little tiring after a while.
So, here y'all go:
if SERVER then
-- serverside things
end
if CLIENT then
-- clientside things
end
function ulx.something( calling_ply, target_ply )
-- do command things
end
-- Auto completes, for a list of predefined values for an argument
auto_complete_table = {
"one",
"two",
"three"
}
local uniquename = ulx.command( "category", "ulx something", ulx.something, "!something" )
uniquename:addParam( type = type, hint = "hint", completes = auto_complete_table, ULib.cmds.restrictToCompletes )
uniquename:defaultAccess( ULib.ACCESS_ALL )
uniquename:help( "Something about your command." )
The values "uniquename", "something", "category", etc can all be modified, as well as the parameters to the addParam, ulx.command, defaultAcces, and help functions and autocompletes table.
This is just to help out people who know Lua (ish) but want to get started on making ULX commands.
I hope y'all appreciate it.
