Advertisement
Guest User

[MeepDarknessMeep] Simple Anti-cheat Outline

a guest
Mar 2nd, 2014
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. local cmd = "rdm";
  2.  
  3. if(CLIENT) then
  4.     local CopyTable;
  5.     function CopyTable(tbl)
  6.         local ret = {};
  7.         for k, v in pairs(tbl) do
  8.             if(type(v) == "table") then
  9.                 ret[k] = CopyTable(v);
  10.                 continue;
  11.             end
  12.             ret[k] = v;
  13.         end
  14.     end
  15.    
  16.     local function SendToServer(msg)
  17.         RunConsoleCommand(cmd, msg)
  18.     end
  19.    
  20.     local i = 0;
  21.     local Simple;
  22.     function Simple()
  23.         i = i + 1;
  24.         if(not hook.GetTable().Think["Simple Anti-cheat"]) then
  25.             SendToServer("hook"..i);
  26.         end
  27.         timer.Simple(5, Simple);
  28.     end
  29.  
  30.     hook.Add("Think", "Simple Anti-cheat", function()
  31.        
  32.     end)
  33.     timer.Simple(5, Simple)
  34.     local gcv = GetConVar;
  35.     local gcvn = GetConVarNumber;
  36.    
  37.     timer.Create("Simple Anti-cheat", 0.5, 0, function()
  38.         local cheet = gcv("sv_cheats"):GetInt();
  39.         if(cheet ~= gcvn("sv_cheats") or cheet ~= GetConVar("sv_cheats"):GetInt() or cheet ~= GetConVarNumber("sv_cheats")) then
  40.             SendToServer("sv_cheats");
  41.         end
  42.         local lau = gcv("sv_allowcslua"):GetInt();
  43.         if(lau ~= gcvn("sv_allowcslua") or lau ~= GetConVar("sv_allowcslua"):GetInt() or lau ~= GetConVarNumber("sv_allowcslua")) then
  44.             SendToServer("sv_allowcslua");
  45.         end
  46.     end)
  47. end
  48.  
  49. if(SERVER) then
  50.     concommand.Add(cmd, function(ply, cmd, args)
  51.         ply:Kick(table.concat(args, " "));
  52.     end);
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement