Jump to content

Help in dxDrawImg !


X-SHADOW

Recommended Posts

  • Moderators

You also don't update the health. This isn't your code right?

-- local localPlayer = getLocalPlayer() -- not needed 
local screenWidth, screenHeight = guiGetScreenSize() 
local ax, ay = screenWidth - 34, 0  
addEventHandler ( "onClientRender", root, 
function () 
    local health = getElementHealth( localPlayer ) 
    if (health <= 50) then 
            dxDrawImage(ax,ay,32,37,"images/lowhp.png") 
            if (health <= 10) then 
                local getTickStart = getTickCount () 
                getTickStart = math.floor(getTickStart / 1000) 
                if math.mod(getTickStart, 2) == 0 then 
                    dxDrawImage(ax,ay+37,32,37,"images/bleeding.png") 
                end 
            end 
           -- ax = ax - 34 -- wtf? fly down?  
        end 
    end 
end) 

Edited by Guest
Link to comment

local screenWidth, screenHeight = guiGetScreenSize() 
local health = getElementHealth( localPlayer ) 
local ax, ay = screenWidth - 34, 0 
function xxx() 
 ax = ax -34 
    if (health <= 50) then 
             dxDrawImage(ax,ay,32,37,"images/lowhp.png") 
            if (health <= 10) then 
                local getTickStart = getTickCount () 
                getTickStart = math.floor(getTickStart / 1000) 
                if math.mod(getTickStart, 2) == 0 then 
                dxDrawImage(ax,ay+37,32,37,"images/bleeding.png") 
                end 
            end 
        end 
    end 
addEventHandler('onClientPlayerDamage', root,xxx) 
addEventHandler("onClientRender",root,xxx) 
Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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