Author Topic: Custom permission?  (Read 2739 times)

0 Members and 1 Guest are viewing this topic.

Offline talmera

  • Newbie
  • *
  • Posts: 36
  • Karma: 4
    • Tectonic-Gaming
Custom permission?
« on: January 28, 2013, 04:05:35 AM »
So I know you can use the
Code: [Select]
ply:checkgroup to see if they are in a group or if they are in any higher group in the chain but this can cause problems.

I was wondering several things:

  • Is it possible to make a custom permission like "reserved slot access" except other stuff?
  • If so is it possible to check in code if this permission is ticked for a person?
And
  • Also what would be the userallow equiv of:
Code: [Select]
ULib.ucl.addUser(realsteamid, allows, denies, ULX_USERGROUP)


    Sorry for the cluster of questions but I thought I would get rid of them in one big swoop :3
    « Last Edit: January 28, 2013, 04:07:21 AM by talmera »
    It's not a sin if it can't make me cry
    He's not the devil unless there's fire in his eyes
    It ain't the ghost if it don't speak in tongue
    It's not a victory 'till the battles been won

    Offline Megiddo

    • Ulysses Team Member
    • Hero Member
    • *****
    • Posts: 6214
    • Karma: 394
    • Project Lead
    Re: Custom permission?
    « Reply #1 on: January 28, 2013, 04:37:49 AM »
    Don't forget to refer to the documentation for questions like these.

    Checking to see if a player is allowed something: http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl.query

    Creating a custom access string: http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.registerAccess

    userallow: http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.userAllow
    Experiencing God's grace one day at a time.

    Offline talmera

    • Newbie
    • *
    • Posts: 36
    • Karma: 4
      • Tectonic-Gaming
    Re: Custom permission?
    « Reply #2 on: January 28, 2013, 05:18:04 AM »
    Don't forget to refer to the documentation for questions like these.

    Checking to see if a player is allowed something: http://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl.query

    Creating a custom access string: http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.registerAccess

    userallow: http://ulyssesmod.net/docs/files/lua/ulib/server/ucl-lua.html#ucl.userAllow

    cool thank you, I'm still relatively new to lua but thought I would start out by doing some practical stuff :D
    It's not a sin if it can't make me cry
    He's not the devil unless there's fire in his eyes
    It ain't the ghost if it don't speak in tongue
    It's not a victory 'till the battles been won

    Offline talmera

    • Newbie
    • *
    • Posts: 36
    • Karma: 4
      • Tectonic-Gaming
    Re: Custom permission?
    « Reply #3 on: January 28, 2013, 06:02:14 AM »
    one last thing, does xgui have any online documentation like that?
    It's not a sin if it can't make me cry
    He's not the devil unless there's fire in his eyes
    It ain't the ghost if it don't speak in tongue
    It's not a victory 'till the battles been won

    Offline Stickly Man!

    • Ulysses Team Member
    • Hero Member
    • *****
    • Posts: 1270
    • Karma: 164
    • What even IS software anymore?
      • XGUI
    Re: Custom permission?
    « Reply #4 on: January 28, 2013, 12:36:05 PM »
    I wish! No, I haven't gotten any documentation up and running for XGUI. But if you need any help on where to get started or have any specific questions, I can hopefully answer them for you!
    Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

    Offline JamminR

    • Ulysses Team Member
    • Hero Member
    • *****
    • Posts: 8096
    • Karma: 390
    • Sertafide Ulysses Jenius
      • Team Ulysses [ULib/ULX, other fine releases]
    Re: Custom permission?
    « Reply #5 on: January 28, 2013, 03:01:14 PM »

    ULib documentation is reasonably clear.
    ULX, well, the code is pretty well commented, and we use a straightforward coding style, which in the end often points to standard Lua and our ULib when possible.
    If you get you're own ULX commands working well, with all the hints that can be used within them, (, hint = "Number of <x>", ), and if needed, you're own category...I'm reasonably sure XGUI picks up on it.
    Stickly Man has done a good job of XGUI "command-awareness".

    "Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming