Skip to content

Instantly share code, notes, and snippets.

@meepen
Last active May 12, 2021 05:48
Show Gist options
  • Save meepen/050993ac93dd0afd0125 to your computer and use it in GitHub Desktop.
Save meepen/050993ac93dd0afd0125 to your computer and use it in GitHub Desktop.
antigarry - idea by leystryku
hook.Add("FakeIDDetect", "FakeIDDetectExample", function(ply)
chat.AddText(Color(255,0,0,255), ply:Nick().." has a fake id. Do not let him fool you. If you are an admin please ban him.");
end);
steamids = steamids or {};
local Old = FindMetaTable"Player".SteamID64;
net.Receive("weapon_smg1", function(len, cl)
local ent = net.ReadEntity();
steamids[ent] = net.ReadString();
print(Old(ent), steamids[ent]);
if (steamids[ent] ~= Old(ent)) then
hook.Run("FakeIDDetect", ent);
end
end);
FindMetaTable"Player".SteamID64 = function(self)
return steamids[self] or "0";
end
FindMetaTable"Player".SteamID = function(self)
return util.SteamIDFrom64(steamids[self]);
end
local function SendSteamID(target)
timer.Simple(1, function()
net.Start"weapon_smg1"
net.WriteEntity(target);
net.WriteString(target:SteamID64());
net.Broadcast();
for k,v in pairs(player.GetAll()) do
net.Start"weapon_smg1"
net.WriteEntity(v);
net.WriteString(v:SteamID64());
net.Send(target);
end
end);
end
hook.Add("PlayerInitialSpawn", "AntiGarry", SendSteamID);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment