I’ve been working on an addon called xPermissions, which is basicly something for Lua coders to implement into scripts.
You can do stuff like.
if xPermissions and xPermissions.HasPermission(ply, "noclip") then return true else return false end
hook.Add(“PlayerNoClip”, “xPermissionsTest”, LetUsNoClip)
It will be released soon as soon as I work out all of the bugs.
You can also assign a player a ‘*’ permission to let them access everything.
xPermission.GetPermissions(PLAYER Object) – Returns a table of all the players permissions.
xPermission.GivePermission(PLAYER Object, STRING permission) – Gives a player a permission.
xPermission.HasPermission(PLAYER Object, STRING permission) – Returns true if a player has a permission, Returns false if they do not.
xPermission.RemovePermission(PLAYER Object, STRING permission) – Removes a players permission, if they do not have permission, it returns nil.
xPermission.SetPermissions(PLAYER Object, TABLE permissions) – Sets a players permission, (WARNING: Accepts tables only.)
For some reason, Permissions started to durr when I put it on a dedicated server instead of a listen server. - Should be fixed.
You can also use this in DarkRP to restrict weapons and jobs to certain players.
Instead of true/false for the admin boolean on the AddCustomTeam function, use [lua]xPermissions.HasPermission(ply, “whateverpermission”)[/lua]