Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local svgData = http.Get("https://upload.wikimedia.org/wikipedia/commons/e/e7/Greek_uc_sigma.svg");
- local imgRGBA, imgWidth, imgHeight = common.RasterizeSVG(svgData);
- local texture = draw.CreateTexture(imgRGBA, imgWidth, imgHeight);
- local function DistanceFrom(vec1, vec2)
- return math.sqrt((vec2.x - vec1.x) ^ 2 + (vec2.y - vec1.y) ^ 2)
- end
- callbacks.Register("Draw", function()
- local plocal = entities.GetLocalPlayer()
- if not plocal then return end
- draw.SetTexture(texture);
- local players = entities.FindByClass("C_CSPlayerPawn")
- for i = 1, #players do
- local player = players[i]
- if player:GetName() == "C_CSGO_PreviewPlayer" then goto continue end
- if player:GetIndex() == plocal:GetIndex() then goto continue end
- if not player:IsAlive() then goto continue end
- if player:GetTeamNumber() == plocal:GetTeamNumber() then goto continue end
- local playerAbs1 = player:GetAbsOrigin()
- local playerAbs2 = player:GetAbsOrigin()
- local distance = DistanceFrom(plocal:GetAbsOrigin(), playerAbs2)
- playerAbs1.z = playerAbs1.z + 70
- local x1, y1 = client.WorldToScreen(playerAbs1)
- local x2, y2 = client.WorldToScreen(playerAbs2)
- if x1 ~= nil and y1 ~= nil then
- --draw.Color(255, 255, 255, 255)
- --draw.FilledCircle(x1 - (15000/distance), y1, 5)
- --draw.FilledCircle(x2 + (15000/distance), y2, 5)
- --Got the math from here: https://www.unknowncheats.me/forum/c-and-c-/76713-esp-box-size-calculation.html
- draw.FilledRect(x1 - (15000/distance), y1 - (900/distance), x2 + (15000/distance), y2 + (900/distance))
- end
- ::continue::
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement