Author Topic: Commands to different tabs?  (Read 1499 times)

0 Members and 1 Guest are viewing this topic.

Offline Olimium

  • Newbie
  • *
  • Posts: 2
  • Karma: 1
Commands to different tabs?
« on: September 27, 2014, 12:58:38 PM »
Hello.

I was wondering if i can put Commands for the "Custom" tab to say "Fun" tab or maybe just a whole new Tab. Please help if you know how, or if there is an addon somewhere.

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Commands to different tabs?
« Reply #1 on: September 27, 2014, 01:21:11 PM »
Changing which category a command is in is easy

Here's a small respawn command, for example

function ulx.respawn( calling_ply, target_ply )
      target_ply:Kill()
      target_ply:Spawn()
      ulx.fancyLogAdmin( calling_ply, true, "#A respawned #T", target_ply )
end

local respawn = ulx.command( CATEGORY_NAME, "ulx respawn", ulx.respawn, "!respawn", true )
respawn:addParam{ type=ULib.cmds.PlayerArg }
respawn:defaultAccess( ULib.ACCESS_ADMIN )
respawn:help( "Respawns a player" )

-------------------------------------------
Look at the part that I bolded
That's what sets the category

The default files that create the commands (every file that by default is in addons\ulx\lua\ulx\modules\sh) will have CATEGORY_NAME there
At the top of that file, there will usually be something like "local CATEGORY_NAME = "Utility" or whatever the name of the category will be for that file
If you want to change that, just change the CATEGORY_NAME that is in the line that says "local blahblahblah = ulx.command" to "Fun" (fun in your case) -- remember the quotes

If you want to change everything in the file to a new category, just change the word in quotes on the top of the file
(Where it says: local CATEGORY_NAME = "NameOfCategoryHere")



le PS: I might have phrased all of that badly
Let me know if you need me to reiterate that (or someone else can idk)

Offline Olimium

  • Newbie
  • *
  • Posts: 2
  • Karma: 1
Re: Commands to different tabs?
« Reply #2 on: September 27, 2014, 01:33:39 PM »
Thank you so much!!! oh BTW great vids :) keep up the wonderful work

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Commands to different tabs?
« Reply #3 on: September 27, 2014, 01:47:13 PM »
Thanks, Olimium
Glad you like 'em c: