Ulysses
General => Developers Corner => Topic started by: blackfire88 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.
-
<player>:query( "accesstag" )
So for example, you would have something like this:
local ply = LocalPlayer()
if ply:query( "ulx slay" ) then
--Kill all the peoples!
end
-
wow thanks stickly man!
-
Could I modify the darkrp code to use that? OR is it a ulx-only based thing.
-
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)
-
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.
-
DO i have to include ULib to use that function?
-
Because it isnt working :( i tried ply:query("vip") now im trying ULib.ucl.query
-
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?
-
Dont worry guys I got it working