Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Plugin.Crosshair = function()
- local start = qq.Setting(Plugin, "crosshair_space")
- local size = qq.Setting(Plugin, "crosshair_size")
- local rps = qq.Setting(Plugin, "crosshair_rps")
- local segments = qq.Setting(Plugin, "crosshair_segments")
- surface.SetDrawColor(qq.Setting(Plugin, "crosshair_color"))
- local time = -RealTime() * (math.pi * 2) * rps
- local segmentsize = (math.pi * 2) / segments
- for i = 0, segments - 1 do
- local timeoffset = segmentsize * i
- Plugin.DrawCrossSegment(time + timeoffset, size, start)
- end
- local x,y = qq.ScreenSize.x / 2, qq.ScreenSize.y / 2
- surface.DrawRect(x,y,1,1)
- end
- Plugin.DrawCrossSegment = function(time, size, start) // Just a conveniance function
- local x,y = qq.ScreenSize.x / 2, qq.ScreenSize.y / 2
- local sin = math.sin(time)
- local cos = math.cos(time)
- local startx = sin * start
- local endx = sin * (start + size)
- local starty = cos * start
- local endy = cos * (start + size)
- surface.DrawLine(x + startx, y + starty, x + endx, y + endy)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement