Guten Tag MTA Community,
Ich habe da probleme mit mein HUD.
Ich habe ein HUD gefunden was ich einfügen wollte ins reloaded reallife script. Das Hud wird nicht angezeigt
Erros:
https://picload.org/view/rppaipoi/…-30-02.png.html
Lua
isHudOpen = false
addEventHandler ( "onClientResourceStart", getRootElement(), function()
setPlayerHudComponentVisible("clock",false)
setPlayerHudComponentVisible("breath",false)
setPlayerHudComponentVisible("armour",false)
setPlayerHudComponentVisible("health",false)
setPlayerHudComponentVisible("money",false)
setPlayerHudComponentVisible("ammo",false)
setPlayerHudComponentVisible("weapon",false)
setPlayerHudComponentVisible("wanted",false)
hideWeaponFireState ()
ausblendentimer_dmg_started = false
bindKey ( "b", "down", function ()
if isHudOpen == false then
addEventHandler ( "onClientRender", getRootElement(), _StartHud)
isHudOpen = true
else
removeEventHandler ( "onClientRender", getRootElement(), _StartHud)
isHudOpen = false
end
end)
end)
function _StartHud()
localplayer = getLocalPlayer ( )
-- Allgemeine Variabeln
local login = vioGetElementData(getLocalPlayer(),"loggedin")
if (login == 1) then
if getElementHealth ( localplayer ) >= 1 then
local leben = getElementHealth ( localplayer )
local lunge = getPedOxygenLevel ( localplayer )
--local hungeranzeige = lp:getHunger()
local hungeranzeige = getElementData ( getLocalPlayer(), "hunger" )
local wantedsP = getPlayerWantedLevel(lp)
--local pgeld = lp:getMoney()
local pgeld = vioGetElementData(getLocalPlayer(),"money")
local sx, sy = guiGetScreenSize()
local px, py = 1920, 1080
local x,y = (sx/px), (sy/py)
local stunde, minute = getTime()
if minute < 10 then minute = tostring("0"..minute) end
if stunde < 10 then stunde = tostring("0"..stunde) end
clip = getPedAmmoInClip ( localplayer )
ammo = getPedTotalAmmo ( localplayer )
waffe = getPedWeapon ( localplayer )
magazin = getPedAmmoInClip ( localplayer )
namewap = getWeaponNameFromID ( waffe )
local armor = getPedArmor ( localplayer )
--[[setPlayerHudComponentVisible("clock",false)
setPlayerHudComponentVisible("breath",false)
setPlayerHudComponentVisible("armour",false)
setPlayerHudComponentVisible("health",false)
setPlayerHudComponentVisible("money",false)
setPlayerHudComponentVisible("ammo",false)
setPlayerHudComponentVisible("weapon",false)
setPlayerHudComponentVisible("wanted",false)
hideWeaponFireState ()
ausblendentimer_dmg_started = false]]
dxDrawLine(x*1587 - 1, y*27 - 1, x*1587 - 1, y*277, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(x*1884, y*27 - 1, x*1587 - 1, y*27 - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(x*1587 - 1, y*277, x*1884, y*277, tocolor(0, 0, 0, 255), 1, false)
dxDrawLine(x*1884, y*277, x*1884, y*27 - 1, tocolor(0, 0, 0, 255), 1, false)
dxDrawRectangle(x*1587, y*27, x*297, y*250, tocolor(20, 20, 20, 216), false)
dxDrawRectangle(x*120, y*234, x*0, y*0, tocolor(255, 255, 255, 255), false)
dxDrawRectangle(x*120, y*234, x*0, y*0, tocolor(255, 255, 255, 255), false)
dxDrawRectangle(x*1587, y*27, x*296, y*19, tocolor(20, 20, 20, 216), false)
local geldlaenge = string.len(pgeld)
local targetlaenge = 9-tonumber(geldlaenge)
local geldnullen = ""
for i = 1, targetlaenge, 1 do
geldnullen = tostring(geldnullen.."0")
end
local geld = tostring(geldnullen..""..pgeld)
dxDrawText("Reallife", x*1587, y*27, x*1883, y*45, tocolor(255, 255, 255, 255), x*1.10, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText( geld.." $", x*1638, y*216, x*1856, y*247, tocolor(255, 255, 255, 255), x*1.50, "pricedown", "center", "center", false, false, false, false, false)
dxDrawText(stunde..":"..minute, x*1793, y*55, x*1873, y*78, tocolor(255, 255, 255, 255), x*1.50, "default-bold", "center", "top", false, false, false, false, false)
local pos = {}
posx, posy, posz = getElementPosition(getLocalPlayer())
local city = getZoneName(posx, posy, posz, false)
local city2 = getZoneName(posx, posy, posz, true)
dxDrawText(city2..","..city, x*1628, y*52, x*1777, y*82, tocolor(255, 255, 255, 255), x*1.10, "default-bold", "center", "top", false, true, false, false, false)
-- Waffe
--dxDrawImage(x*1482-10, y*44, x*82, y*87, tostring("res/images/old/weapons/"..waffe..".png"), 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(x*1459-10, y*93, x*128, y*128, "images/weapons/"..waffe..".png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--Munition
if waffe ~= 0 then
if waffe ~= 1 then
if waffe ~= 2 then
if waffe ~= 3 then
if waffe ~= 4 then
if waffe ~= 5 then
if waffe ~= 6 then
if waffe ~= 7 then
if waffe ~= 8 then
if waffe ~= 9 then
if waffe ~= 10 then
if waffe ~= 11 then
if waffe ~= 12 then
if waffe ~= 14 then
if waffe ~= 15 then
if waffe ~= 40 then
if waffe ~= 46 then
if waffe ~= 44 then
if waffe ~= 45 then
--[[dxDrawText(magazin.." / "..ammo-magazin, x*1488-20, y*122, x*1565, y*166, tocolor(0, 0, 0, 255), x*1.20, "pricedown", "center", "center", false, false, true, false, false)
dxDrawText(magazin.." / "..ammo-magazin, x*1488-20, y*120, x*1565, y*164, tocolor(0, 0, 0, 255), x*1.20, "pricedown", "center", "center", false, false, true, false, false)
dxDrawText(magazin.." / "..ammo-magazin, x*1486-20, y*122, x*1563, y*166, tocolor(0, 0, 0, 255), x*1.20, "pricedown", "center", "center", false, false, true, false, false)
dxDrawText(magazin.." / "..ammo-magazin, x*1486-20, y*120, x*1563, y*164, tocolor(0, 0, 0, 255), x*1.20, "pricedown", "center", "center", false, false, true, false, false)
dxDrawText(magazin.." / "..ammo-magazin, x*1487-20, y*121, x*1564, y*165, tocolor(228, 227, 227, 254), x*1.20, "pricedown", "center", "center", false, false, true, false, false)
]]
dxDrawText(magazin.." / "..ammo-magazin, x*1475 - 1, y*98 - 1, x*1568 - 1, y*119 - 1, tocolor(0, 0, 0, 255), x*1.50, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText(magazin.." / "..ammo-magazin, x*1475 + 1, y*98 - 1, x*1568 + 1, y*119 - 1, tocolor(0, 0, 0, 255), x*1.50, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText(magazin.." / "..ammo-magazin, x*1475 - 1, y*98 + 1, x*1568 - 1, y*119 + 1, tocolor(0, 0, 0, 255), x*1.50, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText(magazin.." / "..ammo-magazin, x*1475 + 1, y*98 + 1, x*1568 + 1, y*119 + 1, tocolor(0, 0, 0, 255), x*1.50, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText(magazin.." / "..ammo-magazin, x*1475, y*98, x*1568, y*119, tocolor(255, 255, 255, 255), x*1.50, "default-bold", "center", "center", false, false, true, false, false)
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
--------------------------------
dxDrawImage(x*1777, y*59, x*16, y*16, "images/hud/time.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1602, y*56, x*16, y*16, "images/hud/location.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1601, y*221, x*17, y*16, "images/hud/money.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1627, y*108, x*245, y*16, "images/hud/healthBG.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1628, y*134, x*245, y*16, "images/hud/armourBG.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1628, y*187, x*246, y*16, "images/hud/lungenBG.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1601, y*187, x*16, y*16, "images/hud/air.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1601, y*160, x*16, y*16, "images/hud/hunger.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--[[dxDrawImage(x*1796, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1706, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1736, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1676, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1646, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)]]
dxDrawImage(x*1601, y*108, x*16, y*16, "images/hud/health.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1628, y*159, x*245, y*17, "images/hud/hungerBG.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x*1601, y*134, x*16, y*16, "images/hud/armour.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--------------------------------
-- Leben
dxDrawImage(x*1627, y*108, x*245/100*leben, y*16, "images/hud/healthbar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
-- Weste
dxDrawImage(x*1628, y*134, x*245/100*armor, y*16, "images/hud/armourbar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
-- Hunger
dxDrawImage(x*1628, y*159, x*245/100*hungeranzeige, y*17, "images/hud/hungerbar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
-- Lunge
--dxDrawImage(x*1628, y*187, x*246/100*lunge, y*16, "images/hud/lungenbar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
if lunge >= 1001 then
dxDrawImage(x*1628, y*187, x*245/2500*lunge, y*16, "images/hud/lungenbar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
else
dxDrawImage(x*1628, y*187, x*245/1000*lunge, y*16, "images/hud/lungenbar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
--((259/100)*breath)*sx
--[[
dxDrawImage(1459, 93, 128, 128, "images/hud/0.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("150 / 30", 1475 - 1, 98 - 1, 1568 - 1, 119 - 1, tocolor(0, 0, 0, 255), 1.50, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText("150 / 30", 1475 + 1, 98 - 1, 1568 + 1, 119 - 1, tocolor(0, 0, 0, 255), 1.50, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText("150 / 30", 1475 - 1, 98 + 1, 1568 - 1, 119 + 1, tocolor(0, 0, 0, 255), 1.50, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText("150 / 30", 1475 + 1, 98 + 1, 1568 + 1, 119 + 1, tocolor(0, 0, 0, 255), 1.50, "default-bold", "center", "center", false, false, true, false, false)
dxDrawText("150 / 30", 1475, 98, 1568, 119, tocolor(255, 255, 255, 255), 1.50, "default-bold", "center", "center", false, false, true, false, false)]]
-- Wanteds
if wantedsP == 1 then
--wantedP1 = dxDrawImage(x*1809, y*219, x*30, y*30, "res/images/old/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
wantedP1 = dxDrawImage(x*1796, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP2 = dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP3 = dxDrawImage(x*1706, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP4 = dxDrawImage(x*1736, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP5 = dxDrawImage(x*1676, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP6 = dxDrawImage(x*1646, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
elseif wantedsP == 2 then
wantedP1 = dxDrawImage(x*1796, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP2 = dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP3 = dxDrawImage(x*1706, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP4 = dxDrawImage(x*1736, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP5 = dxDrawImage(x*1676, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP6 = dxDrawImage(x*1646, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
elseif wantedsP == 3 then
wantedP1 = dxDrawImage(x*1796, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP2 = dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP3 = dxDrawImage(x*1706, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP4 = dxDrawImage(x*1736, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP5 = dxDrawImage(x*1676, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP6 = dxDrawImage(x*1646, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
elseif wantedsP == 4 then
wantedP1 = dxDrawImage(x*1796, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP2 = dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP3 = dxDrawImage(x*1706, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP4 = dxDrawImage(x*1736, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP5 = dxDrawImage(x*1676, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP6 = dxDrawImage(x*1646, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
elseif wantedsP == 5 then
wantedP1 = dxDrawImage(x*1796, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP2 = dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP3 = dxDrawImage(x*1706, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP4 = dxDrawImage(x*1736, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP5 = dxDrawImage(x*1676, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP6 = dxDrawImage(x*1646, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
elseif wantedsP == 6 then
wantedP1 = dxDrawImage(x*1796, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP2 = dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP3 = dxDrawImage(x*1706, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP4 = dxDrawImage(x*1736, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP5 = dxDrawImage(x*1676, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP6 = dxDrawImage(x*1646, y*247, x*30, y*30, "images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
else
wantedP1 = dxDrawImage(x*1796, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP2 = dxDrawImage(x*1766, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP3 = dxDrawImage(x*1706, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP4 = dxDrawImage(x*1736, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP5 = dxDrawImage(x*1676, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
wantedP6 = dxDrawImage(x*1646, y*247, x*30, y*30, "images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
------------------------
end
end
end
Alles anzeigen