Advertisement
WeltEnSTurm

Untitled

Aug 9th, 2010
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1. function ENT:Draw()
  2.     self:DrawModel()
  3.     local pos = self:GetPos()
  4.     local fwd = self:GetForward()
  5.     local up = self:GetUp()
  6.     local ri = self:GetRight()
  7.     local ang = self:GetAngles()
  8.    
  9.     local uptm = self:GetNWFloat("uptime") --Value between 0 and 1 (I think), rotor speed
  10.     local upm = self:GetNWFloat("up") --same range, rotor blade angle
  11.     ang:RotateAroundAxis(ri, 90)
  12.     ang:RotateAroundAxis(fwd, 90)
  13.     local spos=self.SeatsT[self.SeatsT.Pilot].Pos --the local position of the pilot seat
  14.     cam.Start3D2D(pos+fwd*(16+spos.y)+ri*-(5-spos.x)+up*(39+spos.z), ang, 0.02)
  15.     surface.SetDrawColor(MainColor)
  16.     surface.DrawRect(235, 249, 10, 2)
  17.     surface.DrawRect(255, 249, 10, 2)
  18.     surface.DrawRect(249, 235, 2, 10)
  19.     surface.DrawRect(249, 255, 2, 10)
  20.     surface.DrawRect(-3, 0, 3, 500)
  21.     surface.DrawRect(500, 0, 3, 500)
  22.     surface.DrawRect(7, 0, 3, 500)
  23.     surface.DrawRect(490, 0, 3, 500)
  24.     surface.DrawRect(1, 500-uptm*500, 5, uptm*500) --rotor speed bar
  25.     surface.DrawLine(30, 5*ang.r-200+2.77*ang.p, 220, 5*ang.r-200+2.77*(ang.p*0.12)) --artificial horizon, left line
  26.     surface.DrawLine(30, 5*ang.r-200+2.77*ang.p+1, 220, 5*ang.r-200+2.77*(ang.p*0.12)+1)
  27.     surface.DrawLine(280, 5*ang.r-200-2.77*(ang.p*0.12), 470, 5*ang.r-200-2.77*ang.p) --artificial horizon, right line
  28.     surface.DrawLine(280, 5*ang.r-200-2.77*(ang.p*0.12)+1, 470, 5*ang.r-200-2.77*ang.p+1)
  29.  
  30.     surface.SetMaterial(ArrowMaterial)
  31.     surface.DrawTexturedRect(-20,250-upm*250-10,20,20) --green arrow
  32.     cam.End3D2D()
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement