Viellecht wen es noch wer braucht hier die richtige rechnung
Lua
local veh = getPedOccupiedVehicle( lp )
local health = getElementHealth( veh )
local ScreenX, ScreenY = guiGetScreenSize()
newX = ScreenX/1600
newY = ScreenY/900
newX1 = ScreenX/1680
newY1 = ScreenY/1050
local height1 = health * (200*newY) / 1000 -- so is die groesse
local height2 = health * 218 / 1000
dxDrawImage(26*newX, 614*newY, 87*newX, 200*newY, "img/cRadar_lEmpty.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) -- Empty VEHICLEHEALTH
dxDrawImageSection( 26*newX, 614*newY+(200*newY)-height1, 87*newX, height1, 0, 218-(height2-218), 94*newX, height2, 'img/cRadar_lFull.png', 0, 0, 0, tocolor(255, 0, 0) ) -- Full VEHICLEHEALTH
dxDrawImage(254*newX1, 713*newY1, 91*newX1, 238*newY1, "img/cRadar_rEmpty.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
if getVehicleUpgradeOnSlot(veh, 8) then -- Check if the vehicle has nitrous added in it
local nitro = getVehicleNitroLevel ( veh )
local height3 = nitro * (238*newY1) / 1.0
local height4 = nitro * 218 / 1.0
dxDrawImageSection(254*newX1, 713*newY1+(238*newY1)-height3, 91*newX1, height3, 0, 218-(height4-218), 91*newX1, height4, "img/cRadar_rFull.png", 0, 0, 0, tocolor(0, 205, 219, 255) )
Alles anzeigen