1. I am using
    CreateGroup(string name, string title, int rank)
    to add a group. And as I am using the oxide permissionsystem the first time I would need some infos.
    Now, what exactly is the difference between the name and the title, and what is the rank supposed to be?
    Thanks
    - Laser

    + A little extra question which has nothing to do with this but its to small to open a new thread for it:
    How do I get the current time as string? thanks
     
    Last edited by a moderator: Apr 22, 2015
  2. The name is a unique identifier for the group. The title appears to be a display name. From what I can tell, looking at the API reference and the Permission.cs code, the rank value is just a numeric rank you can assign to a group for your own purposes.

    Keep in mind that the groups are server-wide (not per-plugin) so it's probably a good idea to prefix them with your plugin name, so that they don't conflict with other plugins. I think that's the primary reason for having the name and title separate.

    On the "current time" question, it depends on what language you're using, but in C# you can use:

    Code:
    string serverTime = DateTime.Now.ToLongTimeString();
    Unless you mean the time of day in-game, in which case you can use TOD_Sky.Instance.Cycle to get information about the current day/night cycle, including the hour and minute, which you can use in a string.Format() call.
     
  3. Thanks :)
    [DOUBLEPOST=1429739232][/DOUBLEPOST]well if i'm using the CreateGroup it gives me an error....
    Code:
    attempt to call method 'CreateGroup' (a nil value)
     
  4. Wulf

    Wulf Community Admin

    I wouldn't recommend prefixing or making your own groups for each plugin. The groups are made to be assigned multiple permissions from any number of plugins other than your own. If prefixing anything, I'd recommend prefixing your permissions to be something such as laser.airdrop.call, but that isn't required. Keep in mind that there are default groups of player, moderator, and admin as well.
     
  5. what I wanted to add, is a vip group...
     
  6. Wulf

    Wulf Community Admin

    It most likely already exists from another plugin, so I'd do a check if the group exists first, and register it only if it doesn't exist.
     
  7. kk
    [DOUBLEPOST=1429740045][/DOUBLEPOST]
    Code:
     if not GroupExists("vip") then
            CreateGroup("vip", "V.I.P.", 0)
        else
            print("[Name Colors]:", "Group 'vip' does already exist!")
        end
    that should be right I think... still getting that error....
     
  8. You need to specify the class the functions are located in.
    permission.GroupExists()
    permission.CreateGroup()
     
  9. well yeah that explains it, thanks ^^
    [DOUBLEPOST=1429822147,1429740601][/DOUBLEPOST]A little additional question to the groups.
    Im not sure why, and I tried some ways to fix it but it does not work like this to check if someone has a permission.
    Code:
    if permission.UserHasPermission(player, "color_owner") then
    does this also count the hooks added by groups to user? So if the user is in a group which has that permission? Or whats the problem there? :c

    Always getting:
    Code:
    invalid arguments to method call
    [DOUBLEPOST=1429822363][/DOUBLEPOST]nevermind - used player instead of userid... but now im not getting an error anymore but its not doing anything either... Seems like it does not detect permissions added to groups the player is in... as I edited it:
    Code:
    if permission.UserHasPermission(userid, "color_owner") then
    print("Found required permission at user " .. player.displayName)
    else
    print("Unable to find required permission at user " .. player.displayName)
    and it gives me out in the console:

    Code:
    Unable to find required permission at user LaserHydra
     
    Last edited by a moderator: Apr 23, 2015
  10. first idea for your Name Colors plugin is to fix the typo in line 11: PermissionsEnabledEnabled to PermissionsEnabled ;) and i think the group owner is no default group so you also need to create it first, after that your permission check should work
     
  11. okay, yeah propably it was named admin... ^_^ I think I got it fixed... Maybe changed an old version and uploaded it with that error again? Im not sure. I was sure I fixed that already. Nevermind, fixed it again. Update is coming out soon if I got it to work.