xRGamingx Posted February 6, 2018 Share Posted February 6, 2018 How can I get the number 0 out when I'm on the ground? function height() local jet = doesPedHaveJetPack ( localPlayer ) local x,y,z = getElementPosition (getLocalPlayer()) local height = math.floor((z*0)) if ( jet ) then dxDrawText("Altitude: " .. (z).."", 17, 461, 110, 498, tocolor(254, 17, 17, 254), 0.50, "bankgothic", "left", "top", false) end end addEventHandler ( "onClientRender", getRootElement(), height ) Link to comment
URBAN Posted February 6, 2018 Share Posted February 6, 2018 function height() local jet = doesPedHaveJetPack ( localPlayer ) local x,y,z = getElementPosition (getLocalPlayer()) local height = math.floor((z*0)) if ( jet ) then if isPedOnGround(localPlayer) then z = 0 end dxDrawText("Altitude: " .. (z).."", 17, 461, 110, 498, tocolor(254, 17, 17, 254), 0.50, "bankgothic", "left", "top", false) end end addEventHandler ( "onClientRender", getRootElement(), height ) 1 Link to comment
xRGamingx Posted February 6, 2018 Author Share Posted February 6, 2018 1 minute ago, URBAN said: function height() local jet = doesPedHaveJetPack ( localPlayer ) local x,y,z = getElementPosition (getLocalPlayer()) local height = math.floor((z*0)) if ( jet ) then if isPedOnGround(localPlayer) then z = 0 end dxDrawText("Altitude: " .. (z).."", 17, 461, 110, 498, tocolor(254, 17, 17, 254), 0.50, "bankgothic", "left", "top", false) end end addEventHandler ( "onClientRender", getRootElement(), height ) Now it works But why do the other numbers come out? example 13.9585 I want him to come out only on the 13th Link to comment
NeXuS™ Posted February 6, 2018 Share Posted February 6, 2018 Use math.floor(number). 1 Link to comment
xRGamingx Posted February 6, 2018 Author Share Posted February 6, 2018 5 minutes ago, NeXuS™ said: Use math.floor(number). Thanks Broth!!! Link to comment
MisterQuestions Posted February 7, 2018 Share Posted February 7, 2018 z * 0 is just zero 1 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