Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function DrawRadar()
- local w_a = ScrW()-200
- local radar = {}
- radar.radius = 1024
- radar.w = 100
- radar.h = 100
- radar.x = ScrW()-radar.w
- radar.y = 0
- radar.alphascale = 0.6
- radar.bgcolor = Color(0,200,0,255)
- radar.fgcolor = Color(0,255,0,255)
- radar.screendetail = 16
- radar.screenrotation = 0
- surface.SetDrawColor( 255, 255, 255, 255 )
- if LocalPlayer( ):GetNWInt( "Virus" ) == 0 then
- surface.SetTexture( hud_radar_sur )
- else
- surface.SetTexture( hud_radar_inf )
- end
- surface.DrawTexturedRect( w_a, 0, 250, 130 )
- --surface.DrawCircle( ScrW()-45, 30 , 2, Color(255,255,255,255) )
- local lpl = LocalPlayer()
- local players = player.GetAll()
- for i, pl in ipairs(players) do
- local cx = radar.x+radar.w/2
- local cy = radar.y+radar.h/2
- local vdiff = pl:GetPos()-lpl:GetPos()
- if ( pl:Alive() and lpl!=pl and vdiff:Length()<=radar.radius ) then
- local px = (vdiff.x/radar.radius)
- local py = (vdiff.y/radar.radius)
- local z = math.sqrt( px*px + py*py )
- local phi = math.Deg2Rad( math.Rad2Deg( math.atan2( px, py ) ) - math.Rad2Deg( math.atan2( lpl:GetAimVector().x, lpl:GetAimVector().y ) ) - 90 )
- px = math.cos(phi)*z
- py = math.sin(phi)*z
- --draw.RoundedBox( 4, cx+px*radar.w/2-4, cy+py*radar.h/2-4, 8, 8, color_ascale(radar.player_color,radar.alphascale) )
- if LocalPlayer( ):GetNWInt( "Virus" ) == 0 then
- if pl:GetNWInt( "Virus" ) == 0 then
- surface.DrawCircle( cx+px*radar.w/2-22, cy+py*radar.h/2+18, 1, Color(0,0,255,255) )
- else
- surface.DrawCircle( cx+px*radar.w/2-22, cy+py*radar.h/2+18, 1, Color(255,0,0,255) )
- end
- else
- if pl:GetNWInt( "Virus" ) == 0 then
- surface.DrawCircle( cx+px*radar.w/2-22, cy+py*radar.h/2+18, 1, Color(255,0,0,255) )
- else
- surface.DrawCircle( cx+px*radar.w/2-22, cy+py*radar.h/2+18, 1, Color(0,0,255,255) )
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment