Adissonboy11 Posted May 31, 2015 Share Posted May 31, 2015 (edited) Friends , I need this hud high, only appears when I'm in aircraft and helicopters , no cars and motorcycles . If you do not understand , I want this text to appear when I get into some helicopter , type : My code: addEventHandler ( "onClientRender", getRootElement(), function() if isPedInVehicle(getLocalPlayer()) and isSpeedoEnabled == true then local x,y,z = getElementPosition (getLocalPlayer()) dxDrawText("ALT:", 707+2, 8+2, 773+2, 42+2, tocolor(0, 0, 0), 0.70, "bankgothic", "left", "top", false, false, true) dxDrawText("ALT:", 707, 8, 773, 42, tocolor(67, 150, 39), 0.70, "bankgothic", "left", "top", false, false, true) dxDrawText("" ..tostring(math.floor (z)).. "m",777+2, 10+2, 866+2, 42+2, tocolor(0, 0, 0), 0.70, "bankgothic", "left", "top", false, false, true) dxDrawText("" ..tostring(math.floor (z)).. "m",777, 10, 866, 42, tocolor(67, 150, 39), 0.70, "bankgothic", "left", "top", false, false, true) dxDrawImage(773+1, 4+1, 68+1, 34+1,"imgs/speeds.png", 0,0,0, tocolor(0, 0, 0)) dxDrawImage(773, 4, 68, 34,"imgs/speeds.png", 0,0,0, tocolor(67, 150, 39)) end end) function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return math.floor((x^2 + y^2 + z^2) ^ 0.5 * 100) else return math.floor((x^2 + y^2 + z^2) ^ 0.5 * 100 * 1.609344) end else return false end end Edited June 2, 2015 by Guest Link to comment
#RooTs Posted May 31, 2015 Share Posted May 31, 2015 try this (tested) addEventHandler ( "onClientRender", getRootElement(), function() local Vehicle = getPedOccupiedVehicle(getLocalPlayer()) if Vehicle then local Type = getVehicleType(Vehicle) if Type == "Plane" or Type == "Helicopter" then local x,y,z = getElementPosition (getLocalPlayer()) dxDrawText("ALT:", 707+2, 8+2, 773+2, 42+2, tocolor(0, 0, 0), 0.70, "bankgothic", "left", "top", false, false, true) dxDrawText("ALT:", 707, 8, 773, 42, tocolor(67, 150, 39), 0.70, "bankgothic", "left", "top", false, false, true) dxDrawText("" ..tostring(math.floor (z)).. "m",777+2, 10+2, 866+2, 42+2, tocolor(0, 0, 0), 0.70, "bankgothic", "left", "top", false, false, true) dxDrawText("" ..tostring(math.floor (z)).. "m",777, 10, 866, 42, tocolor(67, 150, 39), 0.70, "bankgothic", "left", "top", false, false, true) dxDrawImage(773+1, 4+1, 68+1, 34+1,"imgs/speeds.png", 0,0,0, tocolor(0, 0, 0)) dxDrawImage(773, 4, 68, 34,"imgs/speeds.png", 0,0,0, tocolor(67, 150, 39)) end end end) function getElementSpeed(element,unit) if (unit == nil) then unit = 0 end if (isElement(element)) then local x,y,z = getElementVelocity(element) if (unit=="mph" or unit==1 or unit =='1') then return math.floor((x^2 + y^2 + z^2) ^ 0.5 * 100) else return math.floor((x^2 + y^2 + z^2) ^ 0.5 * 100 * 1.609344) end else return false end end Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now