Advertisement
leo1553

Untitled

Feb 21st, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. public static Vector2 origin = TextDrawDrawer.Middle;
  2. static List<TextDraw> textDraws = new List<TextDraw>();
  3. static float scale = 1F;
  4.  
  5. [Command("speedo")]
  6. [Float("x")]
  7. [Float("y")]
  8. [Float("s")]
  9. public static void TDCommand(GtaPlayer player, float x, float y, float s) {
  10. foreach(TextDraw t in textDraws)
  11. t.Dispose();
  12. textDraws.Clear();
  13.  
  14. origin = new Vector2(x, y);
  15. scale = s;
  16. CalcTDs();
  17.  
  18. Show(player);
  19. }
  20.  
  21. [Command("show")]
  22. public static void Show(GtaPlayer player) {
  23. foreach(TextDraw t in textDraws)
  24. t.Show(player);
  25. }
  26. [Command("hide")]
  27. public static void Hide(GtaPlayer player) {
  28. foreach(TextDraw t in textDraws)
  29. t.Hide(player);
  30. }
  31.  
  32. public static void CalcTDs() {
  33. TextDraw t;
  34. int maxSpeed = 260;
  35. int points = maxSpeed / 20;
  36. float degrees = 270 / (float)points;
  37.  
  38. for(int i = 0; i < points + 1; i++) {
  39. t = new TextDraw(origin + Mathf.Forward(((270 / (float)points) * i) + 45, scale), ".");
  40. textDraws.Add(t);
  41. }
  42.  
  43. ///speedo 84 375 60
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement