CapsAdmin

Untitled

Jan 16th, 2012
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. if CLIENT then
  2.  
  3.     local function run(typ, ...)
  4.     RunConsoleCommand("hm", typ, ...)
  5.     end
  6.    
  7.     local META = {}
  8.    
  9.     function META:__index(key)
  10.     if META[key] then
  11.         return META[key]
  12.     end
  13.    
  14.     return _R.Player[key]
  15.     end
  16.    
  17.     META.__newindex = _R.Player.__newindex
  18.    
  19.     function META:SetPos(var)
  20.     run("v", var.x, var.y, var.z)
  21.     end
  22.    
  23.     function META:SetVelocity(var)
  24.         run("vv", var.x, var.y, var.z)
  25.     end
  26.    
  27.     function META:Kill()
  28.     RunConsoleCommand("kill")
  29.     end
  30.    
  31.     function META:Spawn()
  32.     run("spwn")
  33.     end
  34.    
  35.     function META:StripWeapons()
  36.     run("stp")
  37.     end
  38.    
  39.     function ServerPlayer()
  40.     return setmetatable({}, META)
  41.     end
  42.    
  43.     ServerPlayer():SetVelocity(Vector(0,0,300))
  44.    
  45. end
  46.  
  47. if SERVER then
  48.     local funcs =
  49.     {
  50.     v = function(ply, ...)
  51.         ply:SetPos(Vector(...))
  52.     end,
  53.     vv = function(ply, ...)
  54.         ply:SetVelocity(Vector(...))
  55.     end,
  56.     strp = function(ply)
  57.         ply:StripWeapons()
  58.     end,
  59.     spwn = function(ply)
  60.         ply:Spawn()
  61.     end
  62.     }
  63.    
  64.     local function calc_quota()
  65.    
  66.     end
  67.    
  68.     concommand.Add("hm", function(ply, _, args)
  69.     calc_quota(ply)
  70.    
  71.     local T = args[1]
  72.    
  73.     if funcs[T] then
  74.         table.remove(args, 1)
  75.         funcs[T](ply, unpack(args))
  76.     end
  77.     end)
  78. end
Advertisement
Add Comment
Please, Sign In to add comment