Jump to content

HUD


vallejo

Recommended Posts

Posted

Buenas, estoy haciendo un hud entonces quiero saber, como puedo que la barra de armor y health lleguen a 200, ya que el máximo que permite es 100?

Posted
usando getPedStat por si el player tiene la vida al máximo le asignas 200, y 100 lo contrario, luego usando lo que te dijeron arriba lo multiplicas por el ancho del hud.

Me podrías regalar un ejemplo a ver si te entiendo?

Posted

Si eso lo hice pero, no se como aplicarlo a la condición, tengo esto y no he podido configurar esa parte:

     
local vida = getElementHealth(getLocalPlayer()) 
BrrVida = 207*(vida/200) 
     
     prueba =getPedStat(getLocalPlayer(), 24) 
      
     if prueba == 100 then 
     end 
  
        dxDrawImage((sx/x)*1130, (sy/y)*72, (sx/x)*BrrVida, (sy/y)*25, "Fondo/vida.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
        dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1133, (sy/y)*75, (sx/x)*1291, (sy/y)*91, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
        dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1135, (sy/y)*75, (sx/x)*1293, (sy/y)*91, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
        dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1133, (sy/y)*77, (sx/x)*1291, (sy/y)*93, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
        dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1135, (sy/y)*77, (sx/x)*1293, (sy/y)*93, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
        dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1134, (sy/y)*76, (sx/x)*1292, (sy/y)*92, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 

http://i68.tinypic.com/2cmxjsn.png

Posted

Disculpa al tardansa.

local vida = math.floor(getElementHealth(getLocalPlayer())) 
local maxima = math.floor(getPedStat(getLocalPlayer(), 24)) 
BrrVida = 207*(vida/maxima) 
  
dxDrawImage((sx/x)*1130, (sy/y)*72, (sx/x)*BrrVida, (sy/y)*25, "Fondo/vida.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1133, (sy/y)*75, (sx/x)*1291, (sy/y)*91, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1135, (sy/y)*75, (sx/x)*1293, (sy/y)*91, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1133, (sy/y)*77, (sx/x)*1291, (sy/y)*93, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1135, (sy/y)*77, (sx/x)*1293, (sy/y)*93, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 
dxDrawText("Vida: "..math.ceil(vida), (sx/x)*1134, (sy/y)*76, (sx/x)*1292, (sy/y)*92, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...