Hallo liebe Community,
das HUD wird komischerweise nicht gerendert. Errors etc. kommen keine.
Die outputChatBoxes funktionieren alle bis zu "lol8".
Habe auch schon versucht nach "lol8" alles zu Entfernen, klappte nicht.
Ist bei den Berechnungen etwas falsch ?
Code
local sx,sy = guiGetScreenSize()
local xy, yx = 1680,1050
local x,y = (sx/xy), (sy/yx)
lp = localPlayer
local wtd = math.floor(getPlayerWantedLevel())
local playerhealth = math.floor(getElementHealth(lp))
local playerarmour = math.floor(getPedArmor(lp))
local playerair = math.floor(getPedOxygenLevel(lp))
local playermoney = math.floor(getPlayerMoney(lp))
local x, y, z = getElementPosition(lp) or 0, 0, 0
local berechnungAnzeige = 100
local wid = getPedWeapon(lp)
local htime = getRealTime()
local hour = htime.hour
local minute = htime.minute
local rest_ammo = getPedTotalAmmo(getLocalPlayer())-getPedAmmoInClip(getLocalPlayer())
local m_ammo = getPedAmmoInClip(localPlayer)
function drawHud()
outputChatBox("test")
dxDrawRectangle(x*1299, y*42, x*371, y*206, tocolor(0, 0, 0, 136), true) -- BG
dxDrawRectangle(x*1436, y*57, x*218, y*21, tocolor(103, 0, 0, 249), true) -- health bg
dxDrawRectangle(x*1436, y*99, x*218, y*21, tocolor(78, 78, 78, 249), false) -- armour bg
dxDrawRectangle(x*1436, y*142, x*218, y*21, tocolor(0, 109, 109, 255), false) -- air bg
dxDrawRectangle(x*1436, y*57, x*218/100*playerhealth, y*21, tocolor(255, 0, 0, 255), true) -- health
dxDrawRectangle(x*1436, y*99, x*218/100*playerarmour, y*21, tocolor(60, 60, 60, 255), true) -- armour
dxDrawRectangle(x*1436, y*142, x*218/100*playerair, y*21, tocolor(0, 255, 255, 255), false) -- air
outputChatBox("lol2")
dxDrawImage(x*1318,y*52,x*101,y*101,"images/hud/"..wid..".png",0,0,0,tocolor(255,255,255,255),true) -- weapons
dxDrawText(m_ammo.."|"..rest_ammo, x*1337, y*152, x*1388, y*167, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, true, false, false) -- ammo
outputChatBox("lol3")
dxDrawText(playerhealth.."%", x*1529, y*58, x*1565, y*74, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) -- health%
dxDrawText(playerarmour.."%", x*1530, y*100, x*1566, y*116, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) -- armour%
dxDrawText(playerair.."%", 1529, 144, 1565, 160, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) -- luft%
outputChatBox("lol4")
dxDrawText(hour..":"..minute, x*1313, y*190, x*1419, y*232, tocolor(255, 255, 255, 255), 2.50, "sans", "left", "top", false, false, false, false, false) -- time
outputChatBox("lol5")
dxDrawText("$ "..playermoney, x*1438, y*178, x*1708, y*220, tocolor(0, 133, 6, 255), 2.50, "sans", "left", "top", false, false, false, false, false) -- money
outputChatBox("lol6")
--dxDrawText(zone, x*1454, y*221, x*1644, y*242, tocolor(255, 255, 255, 255), 1.10, "sans", "left", "top", false, false, false, false, false) -- place
outputChatBox("lol7")
dxDrawLine(x*1299, y*41, x*1299, y*247, tocolor(0, 107, 254, 255), 3, false) -- outline
dxDrawLine(x*1669, y*40, x*1669, y*246, tocolor(0, 107, 254, 255), 3, false) -- outline
dxDrawLine(x*1298, y*246, x*1671, y*246, tocolor(0, 107, 254, 255), 3, false) -- outline
dxDrawLine(x*1298, y*41, x*1669, y*41, tocolor(0, 107, 254, 255), 3, false) -- outline
outputChatBox("lol8")
if wtd == 6 then
outputChatBox("lol11")
dxDrawImage(x*1621, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1557, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1492, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1428, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1364, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1300, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
outputChatBox("lol12")
end
if wtd == 5 then
outputChatBox("lol13")
dxDrawImage(x*1621, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1557, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1492, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1428, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1364, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
outputChatBox("lol14")
end
if wtd == 4 then
outputChatBox("lol15")
dxDrawImage(x*1621, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1557, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1492, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1428, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
outputChatBox("lol16")
end
if wtd == 3 then
outputChatBox("lol17")
dxDrawImage(x*1621, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1557, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1492, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
outputChatBox("lol18")
end
if wtd == 2 then
outputChatBox("lol19")
dxDrawImage(x*1621, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1557, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
outputChatBox("lol20")
end
if wtd == 1 then
dxDrawImage(x*1621, y*254, x*49, y*49, "images/hud/wanted.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
end
--addEventHandler("onClientRender", root, drawHud)
addCommandHandler("hud", drawHud)
Alles anzeigen
MfG HandyStyle