CreateClientConVar("scr_apykey","your_api_key",true,false)
CreateClientConVar("scr_distance",3000,true,false)
CreateClientConVar("scr_chaseplayer",1,true,false)
CreateClientConVar("scr_quality",1,true,false)
CreateClientConVar("scr_timerenable",1,true,false)
CreateClientConVar("scr_timerseconds",60,true,false)
CreateClientConVar("scr_drawentity",1,true,false)
local a=vgui.Create("DFrame")
a:SetSize(533,360)
a:Center()
a:SetTitle("Simple Cloud Radar")
a:MakePopup()
local b=vgui.Create("DLabel",a)
b:SetPos(7,25)
b:SetText("API Key")
local c=vgui.Create("DTextEntry",a)
c:SetPos(7,45)
c:SetSize(200,25)
c:SetValue(GetConVar("scr_apykey"):GetString())
c.OnChange=function()
RunConsoleCommand("scr_apykey",c:GetValue())
end
local d=vgui.Create("DButton",a)
d:SetText("Create new API Key")
d:SetPos(7,75)
d:SetSize(130,20)
d.DoClick=function()
gui.OpenURL("https://api.imgbb.com/")
end
local e=vgui.Create("DNumSlider",a)
e:SetPos(7,90)
e:SetSize(200,30)
e:SetText("Quality")
e:SetMin(1)
e:SetMax(100)
e:SetDecimals(0)
e:SetConVar("scr_quality")
local f=vgui.Create("DNumSlider",a)
f:SetPos(7,120)
f:SetSize(200,30)
f:SetText("Distance")
f:SetMin(500)
f:SetMax(10000)
f:SetDecimals(0)
f:SetConVar("scr_distance")
local g=a:Add("DCheckBoxLabel")
g:SetPos(7,150)
g:SetText("Chasing LocalPlayer")
g:SetConVar("scr_chaseplayer")
g:SetValue(GetConVar("scr_chaseplayer"):GetFloat())
g:SizeToContents()
local g=a:Add("DCheckBoxLabel")
g:SetPos(7,170)
g:SetText("Update on Timer")
g:SetConVar("scr_timerenable")
g:SetValue(GetConVar("scr_timerenable"):GetFloat())
g:SizeToContents()
local h=vgui.Create("DNumSlider",a)
h:SetPos(7,185)
h:SetSize(200,30)
h:SetText("Seconds")
h:SetMin(30)
h:SetMax(150)
h:SetDecimals(0)
h:SetConVar("scr_timerseconds")
local i=a:Add("DCheckBoxLabel")
i:SetPos(7,215)
i:SetText("Show entity")
i:SetConVar("scr_drawentity")
i:SetValue(GetConVar("scr_drawentity"):GetFloat())
i:SizeToContents()
local j=vgui.Create("DLabel",a)
j:SetPos(220,25)
j:SetText("Preview")
local k=vgui.Create("DLabel",a)
k:SetPos(220,45)
k:SetSize(305,305)
k:SetText("")
k.Paint=function(l,m,n)
local o,p=a:GetPos()
local q=DisableClipping(true)
render.RenderView({origin=LocalPlayer():GetPos()+Vector(0,0,GetConVar("scr_distance"):GetFloat()),angles=Angle(90,0,0),x=o+220,y=p+45,w=m,h=n})
DisableClipping(q)
end
local r=vgui.Create("DLabel",a)
r:SetPos(7,233)
r:SetSize(200,80)
r:SetText("Update manual command - scr_update\n\nShare with friends link on your profile in\npostimages to view,\nexample: https://user.imgbb.com\nfriends need to register too.")
local s=vgui.Create("DButton",a)
s:SetText("Run Radar")
s:SetPos(7,320)
s:SetSize(200,30)
s.DoClick=function()
local t={}
t.bb=LocalPlayer():GetPos()
local u=false
hook.Add("PostRender","scrpost",function()
if not u then return end
u=false
if GetConVar("scr_chaseplayer"):GetFloat()then
t.bb=LocalPlayer():GetPos()end
render.RenderView({angles=Angle(90,0,0),origin=t.bb+Vector(0,0,GetConVar("scr_distance"):GetFloat()),x=0,y=0,w=ScrW(),h=ScrH()})
cam.Start2D()
surface.SetFont("ChatFont")
if GetConVar("scr_drawentity"):GetFloat()then
for v,w in pairs(ents.GetAll())do
local x=w:GetPos()
local x,y=(x-Vector(0,0,5)):ToScreen(),(x+Vector(0,0,70)):ToScreen()
local n=x.y-y.y
surface.SetTextColor(170,170,170,100)
local z,A=surface.GetTextSize(w:GetClass())
surface.SetTextPos(x.x-z/2,x.y-n+2-A)
surface.DrawText(w:GetClass())
end
end
for v,player in pairs(player.GetAll())do
local x=player:GetPos()
local x,y=(x-Vector(0,0,5)):ToScreen(),(x+Vector(0,0,70)):ToScreen()
local n=x.y-y.y
local B=0
surface.SetTextColor(255,255,255)
local z,A=surface.GetTextSize(player:Name())
surface.SetTextPos(x.x-z/2,x.y-n+2-A+B)
surface.DrawText(player:Name())
B=B+A
surface.SetTextColor(0,0,255)
local z,A=surface.GetTextSize(player:GetUserGroup())
surface.SetTextPos(x.x-z/2,x.y-n+2-A+B)
surface.DrawText(player:GetUserGroup())
B=B+A
local C=player:GetActiveWeapon()
if C and C:IsValid()then
surface.SetTextColor(255,255,0)
local z,A=surface.GetTextSize(C:GetPrintName())
surface.SetTextPos(x.x-z/2,x.y-n+2-A+B)
surface.DrawText(C:GetPrintName())B=B+A
end
if DarkRP and DarkRP.formatMoney then
local D=DarkRP.formatMoney(player:getDarkRPVar("money"))
surface.SetTextColor(0,255,0)
local z,A=surface.GetTextSize(D)
surface.SetTextPos(x.x-z/2,x.y-n+2-A+B)
surface.DrawText(D)
B=B+A
end
local E=player:Team()
local F=team.GetName(E)
surface.SetTextColor(team.GetColor(E))
local z,A=surface.GetTextSize(F)
surface.SetTextPos(x.x-z/2,x.y-n+2-A+B)
surface.DrawText(F)
end
surface.SetTextColor(60,60,60)
surface.SetTextPos(10,10)
surface.DrawText("Simple Cloud Radar - "..os.date("!%d/%m/%Y %H:%M:%S",os.time()).." UTC - Quality "..GetConVar("scr_quality"):GetFloat().." - "..GetHostName().." - "..#player.GetAll().."/"..game.MaxPlayers())
cam.End2D()
local G=render.Capture({format="jpeg",x=0,y=0,w=ScrW(),h=ScrH(),alpha=false,quality=GetConVar("scr_quality"):GetFloat()})
--file.Write("image.png",G)
http.Post("https://api.imgbb.com/1/upload",{key=GetConVar("scr_apykey"):GetString(),image=util.Base64Encode(G or"")or"",expiration=300},function(H)
local I=util.JSONToTable(H or"")or{}if I["error"]then LocalPlayer():ChatPrint(H)return end
end)
end)
local function J()
gui.HideGameUI()
u=true
end
if GetConVar("scr_timerenable"):GetFloat()==1 then
timer.Create("scr_timerupdate",GetConVar("scr_timerseconds"):GetFloat(),0,J)
end
concommand.Add("scr_update",J)
a:Close()
J()
end