Discord
Steam
/
Garry's Mod
/
Developers
/
Script doesn't..
Login/Join
Event Log
Script doesn't work
0 replies, posted
Search
In This Thread
Hi every one ! I have recently downloaded eSpeedometer from garrysmod.org but that doesn't work and the creator doesn't reply to my request ! The numbers stays at 0.00, do you know what's wrong in that script ? [lua] /* 2D Speedometer Version 1.0 Public © Night-Eagle 2008 gmail sedhdi */ surface.CreateFont( "lcd", 36, 2, 0, 0, "lcd36" ) hook.Add("HUDPaint","espeedometer.paint",function() local conv = 17.6 local max = 114 local speed = LocalPlayer() if LocalPlayer():IsValid() and LocalPlayer():InVehicle() then speed = speed:GetVelocity():Length()/conv else return end //speed = CurTime()*50%(max+30) draw.NoTexture() surface.SetDrawColor(0,0,0,128) local a = Vector(ScrW()*.5,ScrH(),0) local s = math.ceil(ScrW()/12/8)*8 s = s surface.DrawPoly{ { x = a.x - s*.5, y = a.y - s*.125, }, { x = a.x + s*.2, y = a.y - s *.3, }, { x = a.x + s*.5, y = a.y - s *.3, }, { x = a.x + s*.5, y = a.y, }, { x = a.x - s*.5, y = a.y, }, } local alpha = 32 for i = 0,math.min((speed/max)*(s/6-1),s/6-1) do if i < s/48 then surface.SetDrawColor(0,0,255,alpha) elseif i < s / 10 then surface.SetDrawColor(0,255,0,alpha) elseif i < s / 7 then surface.SetDrawColor(255,255,0,alpha) else surface.SetDrawColor(255,0,0,alpha) end //surface.DrawRect(a.x-s*.5+6*i+1,a.y-s,4,s) /* .3-.125 .175 s*.7 */ local x = s*.5+6*i local c = 1-s local v = s/128 local b = -s/32 if i < s/8.5-1 then surface.DrawPoly{ { x = a.x + c+x, y = a.y - x*.25+v, }, { x = a.x + c+x+4, y = a.y - (x+4)*.25+v, }, { x = a.x + c+x+4, y = a.y+b, }, { x = a.x + c+x, y = a.y+b, }, } else surface.DrawPoly{ { x = a.x + c+x, y = a.y - s*.3+v, }, { x = a.x + c+x+4, y = a.y - s*.3+v, }, { x = a.x + c+x+4, y = a.y+b, }, { x = a.x + c+x, y = a.y+b, }, } end end local speedstr = tostring(math.Round(speed*10)/10) if string.sub(speedstr,-2,-2) ~= "." then speedstr = speedstr .. ".0" end draw.DrawText(speedstr,"lcd36",a.x+s*.5-8,a.y-36,Color(255,255,255,200),2) end) [/lua] Thanks a lot ! Ps : sorry for my bad english, i'm french !
Sorry, you need to
Log In
to post a reply to this thread.