Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEventHandler ( "onClientElementDataChange", lp,
- function ( data, old )
- if data == "money" then
- local cMoney = getPlayerMoney ( lp )
- local new = getElementData ( lp, "money" )
- if cMoney > new then
- _takePlayerMoney ( cMoney - new )
- hudEinblendenMoney_func ()
- playSoundFrontEnd ( 43 )
- elseif cMoney < new then
- _givePlayerMoney ( (new-cMoney) )
- hudEinblendenMoney_func ()
- playSoundFrontEnd ( 43 )
- end
- end
- end )
- timetohide = 3000
- function setRadarVisible ( bool )
- setPlayerHudComponentVisible ( "radar", bool )
- end
- function hudAusblenden ()
- setPlayerHudComponentVisible ( "ammo", false )
- setPlayerHudComponentVisible ( "weapon", false )
- setPlayerHudComponentVisible ( "health", false )
- setPlayerHudComponentVisible ( "armour", false )
- setPlayerHudComponentVisible ( "money", false )
- setPlayerHudComponentVisible ( "radar", false )
- setPlayerHudComponentVisible ( "area_name", false )
- setPlayerHudComponentVisible ( "clock", false )
- setPlayerHudComponentVisible ( "wanted", false )
- hideWeaponFireState ()
- neuesHUD()
- showHungerBar()
- ausblendentimer_dmg_started = false
- bindKey ( "b", "both", showall )
- end
- addEventHandler ( "onClientResourceStart", getRootElement(), hudAusblenden )
- local showingneuesHUD = false
- function showneuesHUD()
- if tonumber ( getElementData ( lp, "loggedin" ) ) == 1 and not isCursorShowing () then
- if not showingneuesHUD then
- removeEventHandler ( "onClientRender", getRootElement(), neuesHUD )
- showingneuesHUD = true
- end
- end
- end
- function hideneuesHUD()
- if showingneuesHUD then
- addEventHandler ( "onClientRender", getRootElement(), neuesHUD )
- showingneuesHUD = false
- end
- end
- function neuesHUD()
- --showHungerBar()
- local playerX, playerY, playerZ = getElementPosition ( localPlayer )
- local gebiet = getZoneName ( playerX, playerY, playerZ )
- if gebiet == "Unknown" then
- gebiet = "Nicht Lokalisierbar"
- end
- if gebiet == "San Fierro" then
- gebiet = "Police Departmend"
- end
- local stadt = getZoneName ( x, y, z, true )
- if stadt == "San Fierro" then
- stadt = "SF"
- end
- if stadt == "Las Venturas" then
- stadt = "LV"
- end
- if stadt == "Los Santos" then
- stadt = "LS"
- end
- if stadt == "Unknown" then
- stadt = ""
- end
- local time = getRealTime()
- local hours = time.hour
- if hours < 10 then
- hours = "0"..hours
- end
- local minutes = time.minute
- if minutes < 10 then
- minutes = "0"..minutes
- end
- local day = time.monthday
- if day < 10 then
- day = "0"..day
- end
- local month = time.month + 1
- if month < 10 then
- month = "0"..month
- end
- local year = time.year + 1900
- local x, y = guiGetScreenSize()
- --dxDrawRectangle(x, y, x, y, tocolor(0, 0, 0, 150), false)
- dxDrawRectangle(x-225, 10, 220, 200, tocolor(0, 0, 0, 150), false)
- dxDrawImage(x-220, 51, 17, 21, ":vio/images/hud/location.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawImage(x-220, 20, 17, 21, ":vio/images/hud/stopwatch.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawImage(x-220, 82, 16, 22, ":vio/images/hud/armour.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawImage(x-220, 114, 16, 22, ":vio/images/hud/health.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawImage(x-220, 146, 18, 21, ":vio/images/hud/hunger.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawImage(x-220, 178, 17, 22, ":vio/images/hud/money.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
- dxDrawText(day.. "." ..month.. "." ..year.. ", " ..hours.. ":" ..minutes.." Uhr", x-190, 25, 1004, 41, tocolor(255, 255, 255, 200), 1.10, "default-bold", "left", "top", false, false, true, false, false)
- dxDrawText(gebiet..", "..stadt, x-190, 56, 1004, 72, tocolor(255, 255, 255, 200), 1.10, "default-bold", "left", "top", false, false, true, false, false)
- -- Lebensanzeige und Armor --
- local armor = getPedArmor ( localPlayer )
- local health = getElementHealth ( localPlayer )
- local hunger = getElementData ( player, "hunger" )
- local x, y = guiGetScreenSize()
- local armor = 174/100*armor
- local health = 174/100*health
- local hunger = 174/100*hunger
- dxDrawRectangle(x-190, 118, health, 8, tocolor(207, 0, 0, 200), true)
- dxDrawRectangle(x-190, 126, health, 8, tocolor(187, 0, 0, 255), false)
- dxDrawRectangle(x-190, 118, 174, 16, tocolor(39, 39, 39, 200), false)
- dxDrawRectangle(x-190, 86, armor, 8, tocolor(28, 18, 224, 200), true)
- dxDrawRectangle(x-190, 94, armor, 8, tocolor(24, 16, 190, 255), false)
- dxDrawRectangle(x-190, 86, 174, 16, tocolor(39, 39, 39, 200), false)
- dxDrawRectangle(x-190, 150, hunger, 8, tocolor(76, 255, 24, 200), true)
- dxDrawRectangle(x-190, 150, hunger, 16, tocolor(76, 255, 23, 245), false)
- -- Schwarzer Hintergrund fuer die Hunger Leiste --
- dxDrawRectangle(x-190, 150, 174, 16, tocolor(39, 39, 39, 150), false)
- -- Geld Anzeige --
- local m = string.format("%08d", getPlayerMoney(localPlayer))
- --[[if m < 0 then
- m = "00000000"
- end
- if m < 1 then
- m = "00000000"
- end
- if m < 10 then
- m = "0000000"..m
- end
- if m < 100 then
- m = "000000"..m
- end
- if m < 1000 then
- m = "00000"..m
- end
- if m < 10000 then
- m = "0000"..m
- end
- if m < 100000 then
- m = "000"..m
- end
- if m < 1000000 then
- m = "00"..m
- end
- if m < 10000000 then
- m = "0"..m
- end
- if m < 100000000 then
- m = ""..m
- end]]
- dxDrawText("$"..m, x-190, 174, 1005, 206, tocolor(0, 0, 0, 200), 1.50, "pricedown", "left", "center", false, false, true, false, false)
- dxDrawText("$"..m, x-190, 172, 1005, 204, tocolor(0, 0, 0, 200), 1.50, "pricedown", "left", "center", false, false, true, false, false)
- dxDrawText("$"..m, x-189, 174, 1003, 206, tocolor(0, 0, 0, 200), 1.50, "pricedown", "left", "center", false, false, true, false, false)
- dxDrawText("$"..m, x-189, 172, 1003, 204, tocolor(0, 0, 0, 200), 1.50, "pricedown", "left", "center", false, false, true, false, false)
- dxDrawText("$"..m, x-190, 173, 1004, 205, tocolor(255, 255, 255, 200), 1.50, "pricedown", "left", "center", false, false, true, false, false)
- -- Waffen Anzeige --
- local weaponID = getPedWeapon (getLocalPlayer()); -- Weapon ID
- dxDrawImage(x-320, 10, 82, 89,":vio/images/hud/".. tostring( weaponID ) .. ".png",0.0,0.0,0.0,tocolor(255,255,255,200),false)
- dxDrawText(getPedAmmoInClip ( localPlayer ).." - "..getPedTotalAmmo ( localPlayer ) - getPedAmmoInClip ( localPlayer ), x-305, 90, 786, 103, tocolor(255, 255, 225, 255), 1.30, "default-bold", "left", "top", false, false, true, false, false)
- -- Wanteds --
- --[[if vioGetElementData (player, "wanteds") == 0 then
- dxDrawImage(x-225, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --6
- dxDrawImage(x-190, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --5
- dxDrawImage(x-155, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --4
- dxDrawImage(x-120, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --3
- dxDrawImage(x-85, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --2
- dxDrawImage(x-50, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --1
- end]] -- Wer will kann es ja drinnen lassen...Ich finds haesslich --
- if vioGetElementData (player, "wanteds") == 1 then
- dxDrawImage(x-225, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --6
- dxDrawImage(x-190, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --5
- dxDrawImage(x-155, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --4
- dxDrawImage(x-120, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --3
- dxDrawImage(x-85, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --2
- dxDrawImage(x-50, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --1
- end
- if vioGetElementData (player, "wanteds") == 2 then
- dxDrawImage(x-225, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --6
- dxDrawImage(x-190, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --5
- dxDrawImage(x-155, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --4
- dxDrawImage(x-120, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --3
- dxDrawImage(x-85, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --2
- dxDrawImage(x-50, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --1
- end
- if vioGetElementData (player, "wanteds") == 3 then
- dxDrawImage(x-225, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --6
- dxDrawImage(x-190, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --5
- dxDrawImage(x-155, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --4
- dxDrawImage(x-120, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --3
- dxDrawImage(x-85, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --2
- dxDrawImage(x-50, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --1
- end
- if vioGetElementData (player, "wanteds") == 4 then
- dxDrawImage(x-225, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --6
- dxDrawImage(x-190, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --5
- dxDrawImage(x-155, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --4
- dxDrawImage(x-120, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --3
- dxDrawImage(x-85, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --2
- dxDrawImage(x-50, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --1
- end
- if vioGetElementData (player, "wanteds") == 5 then
- dxDrawImage(x-225, 215, 27, 30, ":vio/images/hud/wanted_inactive.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --6
- dxDrawImage(x-190, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --5
- dxDrawImage(x-155, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --4
- dxDrawImage(x-120, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --3
- dxDrawImage(x-85, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --2
- dxDrawImage(x-50, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --1
- end
- if vioGetElementData (player, "wanteds") == 6 then
- dxDrawImage(x-225, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --6
- dxDrawImage(x-190, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --5
- dxDrawImage(x-155, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --4
- dxDrawImage(x-120, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --3
- dxDrawImage(x-85, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --2
- dxDrawImage(x-50, 215, 27, 30, ":vio/images/hud/wanted_active.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) --1
- end
- end
- addEventHandler ( "onClientRender", root, neuesHUD )
- function showall ( key, state )
- if state == "down" and not isPedDead ( lp ) then
- setPlayerHudComponentVisible ( "ammo", false )
- setPlayerHudComponentVisible ( "weapon", false )
- setPlayerHudComponentVisible ( "health", false )
- setPlayerHudComponentVisible ( "armour", false )
- setPlayerHudComponentVisible ( "money", false )
- setPlayerHudComponentVisible ( "area_name", false )
- setPlayerHudComponentVisible ( "clock", false )
- setPlayerHudComponentVisible ( "radar", true )
- setPlayerHudComponentVisible ( "wanted", false )
- neuesHUD()
- showWeaponFireState ()
- hideHungerBar()
- refreshAmmoKindDraw ()
- end
- if state == "up" then
- setPlayerHudComponentVisible ( "ammo", false )
- setPlayerHudComponentVisible ( "weapon", false )
- setPlayerHudComponentVisible ( "health", false )
- setPlayerHudComponentVisible ( "armour", false )
- setPlayerHudComponentVisible ( "money", false )
- setPlayerHudComponentVisible ( "area_name", false )
- setPlayerHudComponentVisible ( "clock", false )
- setPlayerHudComponentVisible ( "wanted", false )
- neuesHUD()
- showHungerBar()
- hideWeaponFireState ()
- end
- end
- function hideall ()
- setPlayerHudComponentVisible ( "ammo", false )
- setPlayerHudComponentVisible ( "weapon", false )
- setPlayerHudComponentVisible ( "health", false )
- setPlayerHudComponentVisible ( "armour", false )
- setPlayerHudComponentVisible ( "money", false )
- setPlayerHudComponentVisible ( "area_name", false )
- setPlayerHudComponentVisible ( "clock", false )
- setPlayerHudComponentVisible ( "wanted", false )
- neuesHUD()
- hideHungerBar()
- local inprogress = false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement