Jump to content

problem


MAB

Recommended Posts

why the script is not working?! it is client at the meta.xml

sx,sy = guiGetScreenSize() 
x,y = (sx/1280),(sy/768) 
  
function speedometer() 
         if isPedInVehicle(localPlayer) then 
             local veh = getPedOccupiedVehicle (localPlayer) 
             local sx, sy, sz = getElementVelocity ( veh ) 
             local kphSpeed = math.ceil( ( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) * 161 ) 
             local health = getElementHealth ( veh ) 
             local currenthealth = math.floor( health/10 ) 
             dxDrawRectangle(x*91, y*495, x*181, y*18, tocolor(0, 0, 0, 100), false) 
             dxDrawRectangle(x*91, y*473, x*181, y*18, tocolor(0, 0, 0, 100), false) 
             dxDrawRectangle(x*91, y*495, x*(181/161/0.5/2/1.5*kphSpeed), y*18, tocolor(0, 0, 255, 100), false) 
             dxDrawRectangle(x*91, y*473, x*(currenthealth*181), y*18, tocolor(r, g, b, 100), false) 
             if (currenthealth >= 80) then 
                  r, g, b = 0, 255, 0 
                  elseif (currenthealth < 80 and currenthealth >= 60) then 
                  r, g, b = 150, 255, 0 
                  elseif (currenthealth < 60 and currenthealth >= 50) then 
                  r, g, b = 255, 215, 0 
                  elseif (currenthealth < 50 and currenthealth >= 40) then 
                  r, g, b = 255, 69, 0 
                  elseif (currenthealth <40 and currenthealth >= 30) then 
                  r, g, b = 178, 34, 34 
                  elseif (currenthealth < 30) then 
                  r, g, b = 50, 0, 0         
                end 
            end 
        end 
addEventHandler ( "onClientRender", root, speedometer ) 

Link to comment
sx,sy = guiGetScreenSize() 
x,y = (sx/1280),(sy/768) 
local r, g, b = 255, 255, 255 
  
function speedometer() 
         if isPedInVehicle(localPlayer) then 
             local veh = getPedOccupiedVehicle (localPlayer) 
             local sx, sy, sz = getElementVelocity ( veh ) 
             local kphSpeed = math.ceil( ( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) * 161 ) 
             local health = getElementHealth ( veh ) 
             local currenthealth = math.floor( health/10 ) 
             dxDrawRectangle(x*91, y*495, x*181, y*18, tocolor(0, 0, 0, 100), false) 
             dxDrawRectangle(x*91, y*473, x*181, y*18, tocolor(0, 0, 0, 100), false) 
             dxDrawRectangle(x*91, y*495, x*(181/161/0.5/2/1.5*kphSpeed), y*18, tocolor(0, 0, 255, 100), false) 
             dxDrawRectangle(x*91, y*473, x*(currenthealth*181), y*18, tocolor(r, g, b, 100), false) 
             if (currenthealth >= 80) then 
                  r, g, b = 0, 255, 0 
                  elseif (currenthealth < 80 and currenthealth >= 60) then 
                  r, g, b = 150, 255, 0 
                  elseif (currenthealth < 60 and currenthealth >= 50) then 
                  r, g, b = 255, 215, 0 
                  elseif (currenthealth < 50 and currenthealth >= 40) then 
                  r, g, b = 255, 69, 0 
                  elseif (currenthealth <40 and currenthealth >= 30) then 
                  r, g, b = 178, 34, 34 
                  elseif (currenthealth < 30) then 
                  r, g, b = 50, 0, 0        
                end 
            end 
        end 
addEventHandler ( "onClientRender", root, speedometer ) 

Link to comment
sx,sy = guiGetScreenSize() 
x,y = (sx/1280),(sy/768) 
local r, g, b = 255, 255, 255 
  
function speedometer() 
         if isPedInVehicle(localPlayer) then 
             local veh = getPedOccupiedVehicle (localPlayer) 
             local sx, sy, sz = getElementVelocity ( veh ) 
             local kphSpeed = math.ceil( ( ( sx^2 + sy^2 + sz^2 ) ^ ( 0.5 ) ) * 161 ) 
             local health = getElementHealth ( veh ) 
             local currenthealth = math.floor( health/10 ) 
             dxDrawRectangle(x*91, y*495, x*181, y*18, tocolor(0, 0, 0, 100), false) 
             dxDrawRectangle(x*91, y*473, x*181, y*18, tocolor(0, 0, 0, 100), false) 
             dxDrawRectangle(x*91, y*495, x*(181/161/0.5/2/1.5*kphSpeed), y*18, tocolor(0, 0, 255, 100), false) 
             dxDrawRectangle(x*91, y*473, x*(currenthealth*181), y*18, tocolor(r, g, b, 100), false) 
             if (currenthealth >= 80) then 
                  r, g, b = 0, 255, 0 
                  elseif (currenthealth < 80 and currenthealth >= 60) then 
                  r, g, b = 150, 255, 0 
                  elseif (currenthealth < 60 and currenthealth >= 50) then 
                  r, g, b = 255, 215, 0 
                  elseif (currenthealth < 50 and currenthealth >= 40) then 
                  r, g, b = 255, 69, 0 
                  elseif (currenthealth <40 and currenthealth >= 30) then 
                  r, g, b = 178, 34, 34 
                  elseif (currenthealth < 30) then 
                  r, g, b = 50, 0, 0        
                end 
            end 
        end 
addEventHandler ( "onClientRender", root, speedometer ) 

didn't work

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...