0 Üye ve 1 Ziyaretçi konuyu incelemekte.
function renderHealth() if (isPlayerMapVisible() or not hudEnabled) then return end local health = getElementHealth(localPlayer) local maxHealth = getPedStat(localPlayer, 24) local maxHealth = (((maxHealth-569)/(1000-569))*100)+100 local healthStat = health/maxHealth local r1,g1,b1, r2,g2,b2, a if (healthStat > 0.25) then r1,g1,b1 = 29,79,161 r2,g2,b2 = 0,0,0 a = 200 else r1,g1,b1 = 29,79,161 r2,g2,b2 = 255,255,255 local aT = getTimerDetails(healthTimer) if (aT > 500) then a = (aT-500)/500*200 else a = (500-aT)/500*200 end end local dX,dY,dW,dH = sX-150,10,250,20 local dX,dY,dW,dH = sX-263-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH --dxDrawRectangle( dX,dY,dW,dH, tocolor(0,0,0,150) ) dxDrawImage( dX+5,dY+5,10,10, "img/health.png", 0, 0, 0, tocolor(255, 255, 255, 255)) local dX,dY,dW,dH = sX-10,15,225,10 local dX,dY,dW,dH = sX-245-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH dxDrawText("%"..health, dX,dY,dW,dH, tocolor(255,255,255,255) )endaddEventHandler("onClientRender", root, renderHealth)-- Armor--------->>function renderArmor() if (isPlayerMapVisible() or not hudEnabled) then return end local armor = getPedArmor(localPlayer) local armorStat = armor/100 local r1,g1,b1, r2,g2,b2 r1,g1,b1 = 0,0,0 r2,g2,b2 = 0,0,0 local dX,dY,dW,dH = sX-150,-10,250,20 local dX,dY,dW,dH = sX-263-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH --dxDrawRectangle( dX,dY,dW,dH, tocolor(0,0,0,150) ) dxDrawImage( dX+5,dY+5,10,10, "img/sheild.png", 0, 0, 0, tocolor(255, 255, 255, 255)) local dX,dY,dW,dH = sX-10,-5,225,10 local dX,dY,dW,dH = sX-245-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH dxDrawText("%"..armor, dX,dY,dW,dH, tocolor(255,255,255,255) )endaddEventHandler("onClientRender", root, renderArmor)
casse kardeşim yardımın için teşekkürler fakat şöyle bir sıkıntı oluyor canı veya zırhı %100 den 50 felan yapınca çok sayı gösteriyo
function renderHealth() if (isPlayerMapVisible() or not hudEnabled) then return end local health = getElementHealth(localPlayer) local maxHealth = getPedStat(localPlayer, 24) local maxHealth = (((maxHealth-569)/(1000-569))*100)+100 local healthStat = health/maxHealth local r1,g1,b1, r2,g2,b2, a if (healthStat > 0.25) then r1,g1,b1 = 29,79,161 r2,g2,b2 = 0,0,0 a = 200 else r1,g1,b1 = 29,79,161 r2,g2,b2 = 255,255,255 local aT = getTimerDetails(healthTimer) if (aT > 500) then a = (aT-500)/500*200 else a = (500-aT)/500*200 end end local dX,dY,dW,dH = sX-150,10,250,20 local dX,dY,dW,dH = sX-263-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH --dxDrawRectangle( dX,dY,dW,dH, tocolor(0,0,0,150) ) dxDrawImage( dX+5,dY+5,10,10, "img/health.png", 0, 0, 0, tocolor(255, 255, 255, 255)) local dX,dY,dW,dH = sX-10,15,225,10 local dX,dY,dW,dH = sX-245-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH dxDrawText("%"..math.floor(health), dX,dY,dW,dH, tocolor(255,255,255,255) )endaddEventHandler("onClientRender", root, renderHealth)-- Armor--------->>function renderArmor() if (isPlayerMapVisible() or not hudEnabled) then return end local armor = getPedArmor(localPlayer) local armorStat = armor/100 local r1,g1,b1, r2,g2,b2 r1,g1,b1 = 0,0,0 r2,g2,b2 = 0,0,0 local dX,dY,dW,dH = sX-150,-10,250,20 local dX,dY,dW,dH = sX-263-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH --dxDrawRectangle( dX,dY,dW,dH, tocolor(0,0,0,150) ) dxDrawImage( dX+5,dY+5,10,10, "img/sheild.png", 0, 0, 0, tocolor(255, 255, 255, 255)) local dX,dY,dW,dH = sX-10,-5,225,10 local dX,dY,dW,dH = sX-245-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH dxDrawText("%"..math.floor(armor), dX,dY,dW,dH, tocolor(255,255,255,255) )endaddEventHandler("onClientRender", root, renderArmor)