Advertisement
Guest User

Speedometer e2

a guest
Jun 26th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. @name Speedometer e2
  2. @inputs RPM Gear
  3. @persist A
  4. @trigger
  5. #KPH
  6.  
  7.  
  8. if(first()|dupefinished()){
  9. Colour = vec(255,0,0)
  10. holoCreate(0,entity():toWorld(vec(1,-5,0)),vec()+0.03,entity():toWorld(ang()),Colour,"hq_cylinder")
  11. holoCreate(1,holoEntity(0):toWorld(vec(0,0,-0.08)),vec(0.55,0.015,0.03),holoEntity(0):toWorld(ang(0,0,0)),Colour,"hq_cylinder")
  12. holoParent(0,entity())
  13. holoParent(1,0)
  14. holoClipEnabled(1,1,1)
  15. holoClip(1,1,vec(-0.6,0,0),vec(1,0,0),0)
  16. }
  17. interval(33)
  18.  
  19. Speed=round(toUnit("km/h",entity():vel():length()))
  20. AngleS = Speed*1.77 + 90
  21. holoAng(0,entity():toWorld(ang(AngleS,90,90)))
  22.  
  23. #RPM
  24. if(first()|dupefinished()){
  25.  
  26. holoCreate(2,entity():toWorld(vec(1,5,0)),vec()+0.03,entity():toWorld(ang()),Colour,"hq_cylinder")
  27. holoCreate(3,holoEntity(2):toWorld(vec(0,0,-0.08)),vec(0.55,0.015,0.03),holoEntity(0):toWorld(ang(-90,0,0)),Colour,"hq_cylinder")
  28. holoParent(2,entity())
  29. holoParent(3,2)
  30. holoClipEnabled(3,1,1)
  31. holoClip(3,1,vec(-0.6,0,0),vec(1,0,0),0)
  32.  
  33. }
  34. AngleR = RPM/6 + 90
  35. holoAng(2,entity():toWorld(ang(AngleR,90,90)))
  36. #gagues
  37. if(first()|dupefinished()){
  38. holoCreate(4,entity():toWorld(vec(0,5,0)),vec(1),entity():toWorld(ang(0,0,0)),vec(50),"models/sprops/trans/misc/gauge_2.mdl")
  39. holoCreate(5,entity():toWorld(vec(0,-5,0)),vec(1),entity():toWorld(ang(0,0,0)),vec(50),"models/sprops/trans/misc/gauge_2.mdl")
  40. holoParent(4,entity())
  41. holoParent(5,entity())
  42. holoSkin(4,1)
  43. holoCreate(6,entity():toWorld(vec(0.7,6,-3)),vec(0.05,0.05,0.005),entity():toWorld(ang(90,0,0)),vec(10,10,10),"hq_cylinder")
  44. holoParent(6,entity())
  45. }
  46. if(RPM>=1600){A = !A}else{A =0}
  47.  
  48. if(A){holoColor(6,vec(255,0,0))}else{holoColor(6,vec(10,10,10))}
  49.  
  50. #gear
  51.  
  52. if(first()|dupefinished()){
  53. holoCreate(7,entity():toWorld(vec(0,0,3)),vec(0.05),entity():toWorld(ang(90,0,0)),vec(50),"models/props_phx/construct/metal_wire1x1.mdl")
  54. holoCreate(8,entity():toWorld(vec(0,0,3)),vec(0.02,0.18,0.18),entity():toWorld(ang(0,0,0)),vec(50),"cube")
  55. holoMaterial(7,"wtp/paint_2")
  56. holoParent(7,entity())
  57. holoParent(8,entity())
  58. holoCreate(9,entity():toWorld(vec(0.1,0,3)),vec(0.1,0.1,0.1),entity():toWorld(ang(0,-90,0)),vec(200,0,0),"models/sprops/misc/alphanum/alphanum_0.mdl")
  59. holoParent(9,entity())
  60. holoMaterial(9,"wtp/paint_2")
  61. }
  62.  
  63. if(Gear==-1){holoModel(9,"models/sprops/misc/alphanum/alphanum_r.mdl")}elseif(Gear==0){holoModel(9,"models/sprops/misc/alphanum/alphanum_n.mdl")}else
  64. {holoModel(9,"models/sprops/misc/alphanum/alphanum_"+Gear+".mdl")}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement