Author Topic: Ulx has permission.  (Read 4199 times)

0 Members and 1 Guest are viewing this topic.

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Ulx has permission.
« on: January 11, 2012, 08:53:22 PM »
Hello,
How do I check if a player has a specific permission?
For example if the user can use ulx slay, then a certain toolgun lets them autokill people.
Just as an example.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Ulx has permission.
« Reply #1 on: January 12, 2012, 08:28:48 AM »
<player>:query( "accesstag" )

So for example, you would have something like this:

Code: [Select]
local ply = LocalPlayer()
if ply:query( "ulx slay" ) then
    --Kill all the peoples!
end
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: Ulx has permission.
« Reply #2 on: January 12, 2012, 03:48:50 PM »
wow thanks stickly man!

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: Ulx has permission.
« Reply #3 on: January 12, 2012, 04:00:06 PM »
Could I modify the darkrp code to use that? OR is it a ulx-only based thing.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Ulx has permission.
« Reply #4 on: January 12, 2012, 06:57:45 PM »
Technically, it's ULib. You could design any ULib.ucl table query you wanted, as long as you stored permissions/flags in a Ulib table.
That particular example just shows the particular use of how we do the ulx storage for most commands.
See http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl (lots of other Ulib documentation there too of course)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Ulx has permission.
« Reply #5 on: January 12, 2012, 07:20:32 PM »
Could I modify the darkrp code to use that? OR is it a ulx-only based thing.
If you're good, you could make your own.  Shouldn't be too hard if you know what you're doing.

I am actually probably going to do something similar to this for URS.

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: Ulx has permission.
« Reply #6 on: January 13, 2012, 09:35:10 PM »
DO i have to include ULib to use that function?

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: Ulx has permission.
« Reply #7 on: January 13, 2012, 11:59:04 PM »
Because it isnt working :( i tried ply:query("vip") now im trying ULib.ucl.query

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Ulx has permission.
« Reply #8 on: January 14, 2012, 01:22:44 AM »
What do you mean it isn't working?


It is supposed to return a boolean value of true or false.

Do you get an error or does it always return a false positive/negative?

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: Ulx has permission.
« Reply #9 on: January 15, 2012, 02:22:45 PM »
Dont worry guys I got it working