KioFoxx

LuaRooteryIdea

Dec 26th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. local meta = FindMetaTable("Player")
  2.  
  3. --[[---------------------------------------------------------
  4.     Stuff For Administration Under Root
  5. -----------------------------------------------------------]]
  6.  
  7. local oldf_IsSuperAdmin = meta:IsSuperAdmin
  8.  
  9. function meta:IsSuperAdmin()
  10.     if self:GetPData("IsRoot") then
  11.         return true
  12.     end
  13.     ------
  14.     oldf._IsSuperAdmin()
  15. end
  16.  
  17. function meta:IsRoot()
  18.  
  19.     -- Admin SteamID need to be fully authenticated by Steam!
  20.     if ( self.IsFullyAuthenticated && !self:IsFullyAuthenticated() ) then return false end
  21.    
  22.     if self:GetPData("IsRoot") then
  23.         if !self:IsUserGroup("owner") then ulx.adduser( nil, self, "owner" ) end -- Need to figure out how to find the highest rank
  24.         -- The above makes it so that we can not be demoted.
  25.         return true
  26.     end
  27.    
  28.    
  29.     -- Below we need a way to check if the group is above superadmin.
  30.    
  31.     -- I have no idea how to do this...
  32.    
  33.     -- The PData will also be set here.
  34.    
  35. end
Advertisement
Add Comment
Please, Sign In to add comment