Advertisement
Mister_Stefan

circle fps thing for v4

Jun 16th, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function FPSandLatency() {
  2.  
  3. /* Get screen size for positions */
  4.     var ScreenSize = Render.GetScreenSize();
  5.  
  6.  
  7.  
  8. /* Get custom fonts for the strings */
  9.     var font = Render.GetFont( "/resources/Montserrat-Regular.ttf", 12, false)
  10.     var font2 = Render.GetFont( "/resources/Montserrat-Light.ttf", 12, false)
  11.     var font3 = Render.GetFont( "/resources/Montserrat-Regular.ttf", 10, false)
  12.     var font4 = Render.GetFont( "/resources/Montserrat-Bold.ttf", 13, false)
  13.  
  14.  
  15.  
  16. /* FPS */
  17.  
  18.     /* Render background for the FPS strings */
  19.     var rr1x = (ScreenSize[0] - (ScreenSize[0]/2)) - 89;
  20.     var rr1y = Math.ceil(ScreenSize[1] - 89);
  21.  
  22.     var rc1x = (ScreenSize[0] - (ScreenSize[0]/2)) - 89;
  23.     var rc1y = Math.ceil(ScreenSize[1] - 75);
  24.  
  25.     Render.FilledRect( rr1x, rr1y, 70, 29, [ 26, 26, 30, 255 ] );
  26.     Render.FilledCircle( rc1x, rc1y, 14, [ 26, 26, 30, 255 ] );
  27.  
  28.     /* Get FPS and render strings */
  29.  
  30.     var f1x = ScreenSize[0] - (ScreenSize[0]/2) - 59;
  31.     var f1y = Math.ceil(ScreenSize[1] - 82);
  32.  
  33.     var f2x = (ScreenSize[0] - (ScreenSize[0]/2)) - 92;
  34.     var f2y = Math.ceil(ScreenSize[1] - 83);
  35.  
  36.     Fps = Math.floor(1 / Global.Frametime());
  37.     Render.String(f1x,f1y,0, "" + Fps, [255, 255, 255, 255], font2)
  38.     Render.String(f2x,f2y,0, "FPS", [255, 255, 255, 255], font4)
  39.  
  40.  
  41.  
  42. /* Latency */
  43.  
  44.     /* Render background for the latency strings */
  45.  
  46.     var lr1x = (ScreenSize[0] - (ScreenSize[0]/2)) +16;
  47.     var lr1y = Math.ceil(ScreenSize[1] - 89);
  48.  
  49.     var lc1x = (ScreenSize[0] - (ScreenSize[0]/2)) +89;
  50.     var lc1y = Math.ceil(ScreenSize[1] - 75);
  51.  
  52.     Render.FilledRect( lr1x, lr1y, 75, 29, [ 26, 26, 30, 255 ] );
  53.     Render.FilledCircle( lc1x, lc1y, 14, [ 26, 26, 30, 255 ] );
  54.  
  55.     /* Get ping and render strings */
  56.  
  57.     var p1x = ScreenSize[0] - (ScreenSize[0]/2) + 49;
  58.     var p1y = Math.ceil(ScreenSize[1] - 82);
  59.  
  60.     var p2x = (ScreenSize[0] - (ScreenSize[0]/2)) +72;
  61.     var p2y = Math.ceil(ScreenSize[1] - 83);
  62.  
  63.     ping = "" + Math.round(Entity.GetProp(Entity.GetLocalPlayer(), 'CPlayerResource', 'm_iPing'))
  64.         if (ping == "NaN") {
  65.        ping = "0";
  66.     }
  67.     Render.String(p1x,p1y,0, ping, [255, 255, 255, 255], font2)
  68.     Render.String(p2x,p2y,0, "MS", [255, 255, 255, 255], font4)
  69.  
  70.  
  71.  
  72. /* Render center circle with logo */
  73.  
  74.     var c1x = ScreenSize[0] - (ScreenSize[0]/2);
  75.     var c1y = Math.ceil(ScreenSize[1] - 75);
  76.  
  77.     var c2x = ScreenSize[0] - (ScreenSize[0]/2);
  78.     var c2y = Math.ceil(ScreenSize[1] - 75);
  79.  
  80.     var c3x = ScreenSize[0] - (ScreenSize[0]/2) - 13;
  81.     var c3y = Math.ceil(ScreenSize[1] - 93);
  82.  
  83.     Render.FilledCircle( c2x, c2y, 32, [ 250, 166, 24, 255 ] );
  84.     Render.FilledCircle( c1x, c1y, 30, [ 26, 26, 30, 255 ] );
  85.     skull = Render.AddTexture("ot/scripts/resources/Skull.png");
  86.     Render.TexturedRect( c3x, c3y, 28, 34, skull );
  87.  
  88. }
  89.  
  90. Cheat.RegisterCallback("Draw", "FPSandLatency")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement