Author Topic: Commands without category?  (Read 5566 times)

0 Members and 2 Guests are viewing this topic.

Offline TheNoobKid

  • Newbie
  • *
  • Posts: 25
  • Karma: -1
Commands without category?
« on: March 09, 2016, 08:27:49 AM »
Hello.

Isn't it possible to make commands in ULX without making them into a category in ULX !menu.
I tried to remove the category code from the code, but it's screwing up.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Commands without category?
« Reply #1 on: March 09, 2016, 08:57:34 AM »
Free-floating commands are unsupported, as far as i know. If you specify nil as the category name, they go into the section named "_UncategorizedCmds", if I recall correctly.
bw81@ulysses-forums ~ % whoami
Homepage

Offline TheNoobKid

  • Newbie
  • *
  • Posts: 25
  • Karma: -1
Re: Commands without category?
« Reply #2 on: March 09, 2016, 09:43:22 AM »
Doesn't work.

The problem is that I have a undercover script, but everyone can use it and that is after I restrict it to superadmins only.
Quote
undercover:defaultAccess( ULib.ACCESS_SUPERADMIN )

When I remove admins access to it via ULX groups etc, then no one can use it..

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Commands without category?
« Reply #3 on: March 09, 2016, 10:12:32 AM »
Doesn't work.

The problem is that I have a undercover script, but everyone can use it and that is after I restrict it to superadmins only.
When I remove admins access to it via ULX groups etc, then no one can use it..
Hang on... reword that, I'm confused.
Can you post your code? I'm not sure what exactly your issue is now.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Commands without category?
« Reply #4 on: March 09, 2016, 10:19:09 AM »
Categories are completely separate from permissions. Categories are just a way to organize things in the menu and help, they have no other purpose.

Otherwise, I agree with Bytewave in confusion as to what your underlying issue is.
Experiencing God's grace one day at a time.

Offline TheNoobKid

  • Newbie
  • *
  • Posts: 25
  • Karma: -1
Re: Commands without category?
« Reply #5 on: March 09, 2016, 10:27:26 AM »
Sure.

Quote
function ulx.undercover( calling_ply )
 
   if calling_ply:IsUserGroup("owner") then
      calling_ply:SetUserGroup("undercover")
 
   elseif calling_ply:IsUserGroup("undercover") then
      calling_ply:SetUserGroup("owner")
   end
 
--ulx.fancyLogAdmin( calling_ply, true, "#A went undercover" )
end

local undercover = ulx.command( CATEGORY_NAME, "ulx owner", ulx.undercover, "!under1", true )
undercover:addParam{ type=ULib.cmds.PlayerArg }
undercover:defaultAccess( ULib.ACCESS_SUPERADMIN )
undercover:help( "UNDERCOVER BIIIIACH!!" )

If I remove CATEGORY_NAME or add nil there, I'm getting lua errors. I want to remove it completely from the category list in ULX.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Commands without category?
« Reply #6 on: March 09, 2016, 02:43:42 PM »
You want to remove it from ULX help and XGUI? Only those with permission to use it can see it. Sounds like you may just have it configured for open access right now. Default access is only a default, servers can override that.
Experiencing God's grace one day at a time.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given