So i want to learn about Oxide Permission System there are some plugins like chathandler and it uses Oxide Permission System but too long code ....
Is there any simple plugin that uses Oxide Permission System ??
Just simple.. not 5000 lines
Simple example of Oxide permission system?
Discussion in 'Rust Discussion' started by PaiN, Apr 18, 2015.
-
Wulf Community Admin
Searching the Plugins section will show you many simple plugins that use it. A few of my recent plugin updates make use of it as well.
-
Only kits found... i will wait for your plugin.
-
File: EnhancedBanSystem.lua Line: 71 bad argument #1 to 'pairs' (table expected, got nil):
at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
lines 69-75
http://screenshooter.net/101978843/xnbrcyq
I tried to add this in other plugin but the exact same error ;/ -
The error pretty much says exactly whats wrong. pairs() expected a table argument and got a nil value.
-
It clearly says
" for _, perm in pairs(self.Config.Settings.Permissions) do"
Config:
self.Config.Settings.Permissions = self.Config.Settings.Permissions or {}
self.Config.Settings.Permissions.BanPerm = self.Config.Settings.Permissions.BanPerm or "canban"
So dunno where is the nil value that says -
You can just debug your argument and see what it is.
http://www.lua.org/pil/2.html -
There are eight basic types in Lua: nil, boolean, number, string, userdata, function, thread, and table.
It shows 7 and the one missing is the table.. or i'm just blind
[DOUBLEPOST=1429392665][/DOUBLEPOST]GOT IT LOL xD i was just experimenting
function PLUGIN:RegisterPermissions()
for _, perm in pairs(self.Config.Settings.Permissions or {}) do
if not permission.PermissionExists(perm) then
permission.RegisterPermission(perm, self.Object)
end
end
end