Advertisement
C0BRA

Untitled

Sep 27th, 2011
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1.  
  2. Plugin.DrawCrossSegment = function(time, size, start) // Just a conveniance function
  3.     local x,y = qq.ScreenSize.x / 2, qq.ScreenSize.y / 2
  4.    
  5.     local sin = math.sin(time)
  6.     local cos = math.cos(time)
  7.    
  8.     local startx = sin * start
  9.     local endx = sin * (start + size)
  10.    
  11.     local starty = cos * start
  12.     local endy = cos * (start + size)
  13.    
  14.     surface.DrawLine(x + startx, y + starty, x + endx, y + endy)
  15. end
  16.  
  17. Plugin.Crosshair = function()
  18.     local start = qq.Setting(Plugin, "crosshair_space")
  19.     local size = qq.Setting(Plugin, "crosshair_size")
  20.     local rps = qq.Setting(Plugin, "crosshair_rps")
  21.     local segments = qq.Setting(Plugin, "crosshair_segments")
  22.    
  23.     surface.SetDrawColor(qq.Setting(Plugin, "crosshair_color"))
  24.    
  25.     local time = -RealTime() * (math.pi * 2) * rps
  26.     local segmentsize = (math.pi * 2) / segments
  27.    
  28.     for i = 0, segments - 1 do
  29.         local timeoffset = segmentsize * i
  30.        
  31.         Plugin.DrawCrossSegment(time + timeoffset, size, start)
  32.     end
  33.    
  34.     local x,y = qq.ScreenSize.x / 2, qq.ScreenSize.y / 2
  35.     surface.DrawRect(x,y,1,1)
  36. end
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement