Advertisement
clark

Untitled

Feb 2nd, 2012
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.34 KB | None | 0 0
  1.  
  2. SuperAdmins = { "STEAM_0:1:10000" }
  3. Admins = { "STEAM_0:1:11000" }
  4. Gold = { "STEAM_0:1:11100"  }
  5. VIPs = { "STEAM_0:1:11110" }
  6.  
  7. function _R.Player:IsAdmin() then
  8.     return table.HasValue(Admins, self:SteamID())
  9. end
  10.  
  11. function _R.Player:IsSuperAdmin() then
  12.     return table.HasValue(SuperAdmins, self:SteamID())
  13. end
  14.  
  15. function _R.Player:IsGoldMember() then
  16.     return table.HasValue(Gold, self:SteamID())
  17. end
  18.  
  19. function _R.Player:IsVIP() then
  20.     return table.HasValue(VIPs, self:SteamID())
  21. end
  22.  
  23. concommand.Add("perp_adduser", function( p, c, a)
  24.     local rank = string.lower(a[1])
  25.     if rank == "superadmin" then
  26.         table.insert(SuperAdmins, a[2[)
  27.     elseif rank == "admin" then
  28.         table.insert(Admins, a[2[)
  29.     elseif rank == "gold" then
  30.         table.insert(Gold, a[2[)
  31.     elseif rank == "vip" then
  32.         table.insert(VIPs, a[2[)
  33.     end
  34. end)
  35.  
  36. concommand.Add("perp_removeuser", function( p, c, a)
  37.     local rank = string.lower(a[1])
  38.     if rank == "superadmin" then
  39.         local key = table.KeyFromValue(SuperAdmins, a[2])
  40.         table.remove(SuperAdmins, key)
  41.     elseif rank == "admin" then
  42.         local key = table.KeyFromValue(Admins, key)
  43.         table.remove(Admins, a[2[)
  44.     elseif rank == "gold" then
  45.         local key = table.KeyFromValue(Gold, key)
  46.         table.remove(Gold, a[2[)
  47.     elseif rank == "vip" then
  48.         local key = table.KeyFromValue(VIPs, key)
  49.         table.remove(VIPs, a[2[)
  50.     end
  51. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement