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
Solved Creating Oxide permission group?
Discussion in 'Rust Development' started by LaserHydra, Apr 22, 2015.
-
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();
-
[DOUBLEPOST=1429739232][/DOUBLEPOST]well if i'm using the CreateGroup it gives me an error....
Code:attempt to call method 'CreateGroup' (a nil value)
-
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.
-
-
Wulf Community Admin
-
[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
-
You need to specify the class the functions are located in.
permission.GroupExists()
permission.CreateGroup() -
[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
Always getting:
Code:invalid arguments to method call
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)
Code:Unable to find required permission at user LaserHydra
Last edited by a moderator: Apr 23, 2015 -
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
-