xRGamingx Posted February 6, 2018 Share Posted February 6, 2018 Hello friends, I need a little help How can I make this height meter appear only for the jetpack ? Sorry for my bad English function height() local Vehicle = getPedOccupiedVehicle(getLocalPlayer()) if Vehicle then local Type = getVehicleType(Vehicle) if Type == "Plane" then dxDrawRectangle(40, 498, 20, 163, tocolor(0 , 0 , 0 , 100), false) local x,y,z = getElementPosition (getLocalPlayer()) local height = math.floor((z*001)) if height < 161 then dxDrawRectangle(30, 659-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 322 then dxDrawRectangle(30, 820-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 483 then dxDrawRectangle(30, 981-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 644 then dxDrawRectangle(30, 1142-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 803 then dxDrawRectangle(30, 1303-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 962 then dxDrawRectangle(30, 1464-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) end end end end addEventHandler ( "onClientRender", getRootElement(), height ) --doesPedHaveJetPack Link to comment
KaMi Posted February 6, 2018 Share Posted February 6, 2018 44 minutes ago, xRGamingx said: Hello friends, I need a little help How can I make this height meter appear only for the jetpack ? Sorry for my bad English function height() local Vehicle = getPedOccupiedVehicle(getLocalPlayer()) if Vehicle then local Type = getVehicleType(Vehicle) if Type == "Plane" then dxDrawRectangle(40, 498, 20, 163, tocolor(0 , 0 , 0 , 100), false) local x,y,z = getElementPosition (getLocalPlayer()) local height = math.floor((z*001)) if height < 161 then dxDrawRectangle(30, 659-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 322 then dxDrawRectangle(30, 820-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 483 then dxDrawRectangle(30, 981-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 644 then dxDrawRectangle(30, 1142-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 803 then dxDrawRectangle(30, 1303-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 962 then dxDrawRectangle(30, 1464-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) end end end end addEventHandler ( "onClientRender", getRootElement(), height ) --doesPedHaveJetPack function height() local jet = doesPedHaveJetPack ( localPlayer ) if ( jet ) then dxDrawRectangle(40, 498, 20, 163, tocolor(0 , 0 , 0 , 100), false) local x,y,z = getElementPosition (getLocalPlayer()) local height = math.floor((z*001)) if height < 161 then dxDrawRectangle(30, 659-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 322 then dxDrawRectangle(30, 820-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 483 then dxDrawRectangle(30, 981-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 644 then dxDrawRectangle(30, 1142-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 803 then dxDrawRectangle(30, 1303-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 962 then dxDrawRectangle(30, 1464-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) end end end addEventHandler ( "onClientRender", getRootElement(), height ) PD : ¿ do you speak spanish ? 1 Link to comment
xRGamingx Posted February 6, 2018 Author Share Posted February 6, 2018 22 minutes ago, <~KaMiKaZe~> said: function height() local jet = doesPedHaveJetPack ( localPlayer ) if ( jet ) then dxDrawRectangle(40, 498, 20, 163, tocolor(0 , 0 , 0 , 100), false) local x,y,z = getElementPosition (getLocalPlayer()) local height = math.floor((z*001)) if height < 161 then dxDrawRectangle(30, 659-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 322 then dxDrawRectangle(30, 820-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 483 then dxDrawRectangle(30, 981-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 644 then dxDrawRectangle(30, 1142-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 803 then dxDrawRectangle(30, 1303-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) elseif height < 962 then dxDrawRectangle(30, 1464-height, 45, 2, tocolor(255 , 255 , 255 , 115), false) end end end addEventHandler ( "onClientRender", getRootElement(), height ) PD : ¿ do you speak spanish ? Yes i speak spanish 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