Lua
--------------------------------
----- Script by DireXus -----
--------------------------------
local waehrung = "€"
local font1 = dxCreateFont( "fonts/font1.ttf", 13 )
local font2 = dxCreateFont( "fonts/font2.ttf", 13 )
local x, y = guiGetScreenSize()
setPlayerHudComponentVisible( "ammo", false )
setPlayerHudComponentVisible( "armour", false )
setPlayerHudComponentVisible( "clock", false )
setPlayerHudComponentVisible( "health", false )
setPlayerHudComponentVisible( "money", false )
setPlayerHudComponentVisible( "weapon", false )
setPlayerHudComponentVisible( "breath", false )
function drawHud()
local username = getPlayerName(getLocalPlayer())
local leben = math.floor( getElementHealth( getLocalPlayer() ) )
local weste = math.floor( getPlayerArmor( getLocalPlayer() ) )
local location = getZoneName( getElementPosition( getLocalPlayer() ) )
local px, py, pz = getElementPosition( getLocalPlayer() )
local realtime = getRealTime()
local hour = realtime.hour
local minute = realtime.minute
local money = getPlayerMoney( getLocalPlayer() )
local waffe = getPedWeapon( getLocalPlayer() )
local ammo = getPedTotalAmmo( getLocalPlayer() )
local clip = getPedAmmoInClip( getLocalPlayer() )
local oxygen = math.floor( getPedOxygenLevel( getLocalPlayer() ) )
--- Hud Hintergrund ---
dxDrawRectangle( x/1.31, y/30, x/4.2, y/4.5 , tocolor( 255, 255, 255, 20) )
dxDrawRectangle( x/1.31, y/30, x/4.2, y/30 , tocolor( 0, 100, 255, 255) )
--- Texte ---
dxDrawText( username, x/1.16, y/13.1, x/4.3, y/30, tocolor( 0, 0, 0, 200 ), 1.5, "font1" ) -- Schatten
dxDrawText( username, x/1.161, y/13.2, x/4.3, y/30, tocolor( 255, 255, 255, 255 ), 1.5, "font1" )
dxDrawImage( x/1.065, y/30, x/50, y/30, "images/clock.png")
dxDrawText( ""..hour..":"..minute.."", x/1.04, y/30, x/4.3, y/30, tocolor( 255,255,255, 255 ), 1.5, "font2" ) -- uhr
dxDrawText( "location:haitor scripting", 1, "sans" ) -- location text
dxDrawText( "x: "..px.." y: "..py.." z: "..pz.."", x/60, y/1.02, x/4.3, y/30, tocolor( 255,255,255, 255 ), 0.8, "font2" ) -- coordinaten
dxDrawText( ""..money.." "..waehrung.."", x/1.159, y/4.49, x/10*weste/100, y/40, tocolor( 0, 0, 0, 200 ), 1.8, "sans" ) -- Schatten
dxDrawText( ""..money.." "..waehrung.."", x/1.16, y/4.5, x/10*weste/100, y/40, tocolor( 3, 140, 0, 255 ), 1.8, "sans" )
dxDrawText( ""..clip.." / "..ammo.."", x/1.279, y/4.59, x/10*weste/100, y/40, tocolor( 0, 0, 0, 200 ), 1.2, "font1" ) -- Schatten
dxDrawText( ""..clip.." / "..ammo.."", x/1.28, y/4.6, x/10*weste/100, y/40, tocolor( 255,255,255, 255 ), 1.2, "font1" )
--- Leben ---
dxDrawImage( x/1.04, y/8.5, x/50, y/50 , "images/health.png")
dxDrawRectangle( x/1.16, y/8.5, x/10, y/40 , tocolor( 0, 0, 0, 255) )
dxDrawImage( x/1.16, y/8.5, x/10*leben/100, y/40, "images/health_bar.png" )
dxDrawText( ""..leben.." %", x/1.11, y/8.4, x/4.3, y/30, tocolor( 255,255,255, 255 ), 1, "sans" )
-- dxDrawRectangle( x/1.16, y/8.5, x/10*leben/100, y/40 , tocolor( 150, 0, 0, 255) ) -- alt ( vor health_bar.png )
--- Rüstung ---
dxDrawImage( x/1.04, y/6.5, x/50, y/50 , "images/armour.png")
dxDrawRectangle( x/1.16, y/6.5, x/10, y/40 , tocolor( 0, 0, 0, 255) )
dxDrawImage( x/1.16, y/6.5, x/10*weste/100, y/40, "images/armour_bar.png" )
dxDrawText( ""..weste.." %", x/1.11, y/6.4, x/4.3, y/30, tocolor( 255,255,255, 255 ), 1, "sans" )
-- dxDrawRectangle( x/1.16, y/6.5, x/10*weste/100, y/40 , tocolor( 200, 200, 200, 255) ) -- alt ( vor armour_bar.png )
--- Luft ---
dxDrawImage( x/1.04, y/5.2, x/50, y/50 , "images/oxygen.png")
dxDrawRectangle( x/1.16, y/5.2, x/10, y/40 , tocolor( 0, 0, 0, 255) )
dxDrawImage( x/1.16, y/5.2, x/10*oxygen/1000, y/40, "images/oxygen_bar.png" )
dxDrawText( ""..oxygen.." %", x/1.11, y/5.1, x/4.3, y/30, tocolor( 255,255,255, 255 ), 1, "sans" )
-- dxDrawRectangle( x/1.16, y/6.5, x/10*weste/100, y/40 , tocolor( 200, 200, 200, 255) ) -- alt ( vor armour_bar.png )
--- Weapon Icons ---
dxDrawImage( x/1.3, y/13.5, x/12.2, y/7, "images/weapon"..waffe..".png" )
end
addEventHandler("onClientRender", getRootElement(), drawHud )
Alles anzeigen
Hallo liebe Community,
Ich benutze momentan ein Hud, auf einem Tactic Server und nach einer Runde überlappt mein Hud mit dem Standard Hud von GTA SA.
Weis jemand woran das liegt?