SHARE
TWEET

Untitled

a guest May 23rd, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local x,y = guiGetScreenSize()
  2. oX, oY = 1920, 1080
  3. local lp = getLocalPlayer()
  4. local health,armor,hunger,weapon
  5. local rt,hour,minute,second
  6. local fps
  7.  
  8. local sx, sy = guiGetScreenSize()
  9.  
  10.  
  11.  
  12. local hudState = true
  13.  
  14.  
  15.  
  16. local hudX, hudY, hudW, hudH = sx - 300 - 5, 5, 300, 100
  17.  
  18.  
  19.  
  20. local hudComponents = {'clock', 'ammo', 'weapon', 'money', 'breath', 'health', 'armour'}
  21.  
  22.  
  23.  
  24. addEventHandler('onClientResourceStart', resourceRoot, function()
  25.  
  26.     for k, v in pairs(hudComponents) do
  27.  
  28.         setPlayerHudComponentVisible(v, false)
  29.  
  30.     end
  31.  
  32. end)
  33.  
  34.  
  35.  
  36. addEventHandler('onClientRender', root, function()
  37.  
  38.     local playerMoney = getPlayerMoney()
  39.  
  40.     dxDrawText("#008000"..playerMoney .. "#008000$", hudX + hudW*0.85, hudY + hudH*1.95 - 65, hudX, hudY, tocolor(255, 255, 255, 255), 1, "pricedown", "center", "center", false, false, false, true)
  41.  
  42.  
  43.  
  44. end)
  45.  
  46.  
  47.  
  48. addCommandHandler('toghud', function()
  49.  
  50.     hudState = not hudState
  51.  
  52. end)
  53.  
  54. addEventHandler("onClientRender",getRootElement(),
  55. function()
  56.     if not isElement(lp) then return end
  57.     --HP--
  58.     health = getElementHealth(lp)
  59.     dxDrawRectangle(x-259/oX*x, 11/oY*y, 250/oX*x, 15/oY*y,tocolor(0,0,0,100))
  60.     dxDrawRectangle(x-259/oX*x, 11/oY*y, health*2.48/oX*x, 15/oY*y,tocolor(255,20,20,200))
  61.     dxDrawText(math.floor(health).."%",x-260/oX*x, 12/oY*y, x-10/oX*x, 10/oY*y,tocolor(255,255,255),0.8,"default-bold","center")
  62. --    dxDrawText("Élet", x-557/oX*x, 7.2/oY*y, x-10/oX*x, 10/oY*y,tocolor(255,255,255),0.65,"pricedown","center")
  63.     ------
  64.     --Armor--
  65.     armor = getPedArmor(lp)
  66.     dxDrawRectangle(x-259/oX*x, 35/oY*y, 250/oX*x, 15/oY*y,tocolor(0,0,0,100))
  67.     dxDrawRectangle(x-259/oX*x, 35/oY*y, armor*2.48/oX*x, 15/oY*y,tocolor(30,191,255,200))
  68.     dxDrawText(math.floor(armor).."%",x-260/oX*x, 36/oY*y, x-10/oX*x, 27/oY*y,tocolor(255,255,255),0.8,"default-bold","center")
  69. --    dxDrawText("Pajzs", x-570/oX*x, 32.5/oY*y, x-10/oX*x, 10/oY*y,tocolor(255,255,255),0.65,"pricedown","center")
  70.     ---------
  71.     --Fegyver--
  72.     weapon = getPedWeapon(lp)
  73.     dxDrawImage(x-256/oX*x, 100/oY*y, 256/oX*x, 128/oY*y,"weapons/"..weapon..".png")
  74. --  dxDrawText(getPedAmmoInClip(lp).." | "..getPedTotalAmmo(lp),x-255/oX*x, 169/oY*y, x-10/oX*x, y/oY*y,tocolor(0,0,0,255),1,"pricedown","right")
  75.     dxDrawText(getPedAmmoInClip(lp).." | "..getPedTotalAmmo(lp),x-256/oX*x, 168/oY*y, x-10/oX*x, y/oY*y,tocolor(255,255,255,255),1,"pricedown","right")
  76.     -----------
  77.     --Óra----
  78.     rt = getRealTime()
  79.     hour = rt.hour
  80.     minute = rt.minute
  81.     second = rt.second
  82.     if hour < 10 then
  83.         hour = "0" .. hour
  84.     end
  85.     if minute < 10 then
  86.         minute = "0" .. minute
  87.     end
  88.     if second < 10 then
  89.         second = "0" .. second
  90.     end
  91. --  dxDrawText(hour.." : " ..minute.. " : " ..second,x-255/oX*x, 161/oY*y, x-10/oX*x, y/oY*y,tocolor(0,0,0,255),1,"pricedown","right")
  92.     dxDrawText(hour.." : " ..minute.. " : " ..second,x-132/oX*x, 65/oY*y, x-10/oX*x, y/oY*y,tocolor(255,255,255,255),1,"pricedown","left")
  93.     --------
  94.     --FPS---
  95. --    dxDrawText(math.floor(fps),x-500/oX*x, 60/oY*y, x-150/oX*x, 10/oY*y,tocolor(0,0,0,255),1,"pricedown","right")
  96.     dxDrawText(math.floor(fps),x-450/oX*x, 100/oY*y, x-10/oX*x, 10/oY*y,tocolor(255,255,255,255),1,"pricedown","center")
  97.     dxDrawText("FPS:",x-540/oX*x, 100/oY*y, x-10/oX*x, 10/oY*y,tocolor(255,255,255,255),1,"pricedown","center")
  98.     --------
  99.     --Penz--
  100.     dxDrawText("$"..getMoney():gsub("#%x%x%x%x%x%x", ""),x-276/oX*x,65/oY*y,x-10/oX*x,y/oY*y,tocolor(102,255,51),1,"pricedown","right")
  101.     dxDrawText("$"..getMoney():gsub("#%x%x%x%x%x%x", ""),x-276/oX*x,65/oY*y,x-10/oX*x,y/oY*y,tocolor(255,255,255),1,"pricedown","right")
  102.     --------
  103.  
  104. end)
  105.  
  106.  
  107.  
  108. setPlayerHudComponentVisible("all",false) --Alap hud eltüntetés
  109. setPlayerHudComponentVisible("crosshair",true)
  110.  
  111.  
  112.  
  113. function updateFPS(a)
  114.     fps = (1 / a) * 1000
  115. end
  116. addEventHandler("onClientPreRender", getRootElement(), updateFPS)
  117.  
  118. function showClientImage()
  119.    guiCreateStaticImage( x-302/oX*x, 3.5/oY*y, 300/oX*x, 100/oY*y, "zsolti.png", false )
  120. end
  121. addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), showClientImage )
  122.  
  123. function getMoney()
  124.  
  125.     local maxDrawNull = 8
  126.  
  127.     local actualCharMoney = maxDrawNull - string.len(tostring(getElementData(localPlayer,"char:money")))
  128.  
  129.     finalConvert = ""
  130.  
  131.              
  132.  
  133.     for i = 0, actualCharMoney, 1 do
  134.  
  135.         finalConvert = finalConvert .. "0"
  136.  
  137.     end
  138.  
  139.  
  140.  
  141.     if getElementData(localPlayer, "char:money") >= 0 then
  142.  
  143.         finalConvert = finalConvert .. "#7cc576" .. getElementData(localPlayer, "char:money")
  144.  
  145.     else
  146.  
  147.         finalConvert = "-" .. finalConvert .. "#d24d57" .. math.abs(getElementData(localPlayer, "char:money"))
  148.  
  149.     end
  150.  
  151.  
  152.  
  153.     return finalConvert
  154.  
  155. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top