-
Posts
1,990 -
Joined
-
Last visited
-
Days Won
2
Everything posted by #RooTs
-
@#Samy, account 1 and 1 not work ..(math.ceil(getElementHealth(localPlayer)/1)*1).. the script is local health = math.ceil(getElementHealth(localPlayer)) if health > 0 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/"..(math.ceil(getElementHealth(localPlayer)/5)*5)..".png" ) end does anyone know the formula for this? I'll leave it as is
-
account 5 and 5 for 1 and 1 ??
-
WORKING....... my MTA really was in trouble SORRY MY FRIENDS, thanks all, by patience with me
-
LOLLSSS I'm already thinking that my mta is in trouble function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if ( k==0 ) then break end end return formatted end local money = formatted -- what to put here? I've tried ( number, formatted, k ) dxDrawText("R$: "..money, x*0.835, y*0.150, x*800, y*030, tocolor(255, 255, 255,255), 0.7, "bankgothic", "left", "top", false, false, true, false, false)
-
there are no errors
-
this also does not work unfortunately my problem will not be clarified @Banex, tests the formula on your local server, and show me the result, please local pMoney = getPlayerMoney(getLocalPlayer()) local convertedMoney = convertNumber(pMoney)
-
do not know WHAT is talking, looks the Solidsnake14 spoke,
-
@Castilho, I had this function, and because it no longer works? ( because it became so complicated? ) local money = convertNumber(getPlayerMoney(localPlayer)) makes no sense why she no longer works
-
always used this function in mta 1.3, has another easier way to do it in mta 1.4 ?? local money = convertNumber(getPlayerMoney(localPlayer))
-
is no longer working? local money = convertNumber(getPlayerMoney(localPlayer)) --money format 1,000,000,0 dxDrawBorderedText("R$: "..money, x*0.875, y*0.155, x*800, y*030, tocolor(255, 255, 255,255), 1.7, "default", "left", "top", false, false, true, false, false)
-
this does not help me
-
@Hex547, como add health 200% ?? Example: local health = math.ceil(getElementHealth(localPlayer)) if health > 0 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/"..(math.ceil(getElementHealth(localPlayer)/5)*5)..".png" ) end else local health = math.ceil(getElementHealth(localPlayer)) if health > 0 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health2/"..(math.ceil(getElementHealth(localPlayer)/5)*5)..".png" ) end Look file name ( health and health2 ). note (else in script) as an example
-
makes no sense, took a ready line of a hud existing ((840/1024)*sWidth, (80/768)*sHeight, (32/1024)*sWidth, (32/768) I not work with it anymore
-
@Hex547 Working, Thanks my friend, it help me a lot. function simple and easy. have to make things easier for newbies like me local health = math.ceil(getElementHealth(localPlayer)) if health > 0 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/"..(math.ceil(getElementHealth(localPlayer)/5)*5)..".png" ) end local armor = math.ceil(getPedArmor(localPlayer)) if health > 0 then dxDrawImage(x*Alargura, y*Aaltura, largura, altura, "armor/"..(math.ceil(getPedArmor(localPlayer)/5)*5)..".png" ) end
-
that's what I did, and still does not work can make things easier for me? local x,y = guiGetScreenSize() function hudLekRoots ( ) local largura = 220 local altura = 200 -------- local Tlargura = 0.830 local Taltura = 0.001 local dxHealthImage = "health/100.png"; function exampleCode_Client(theAttacker, theWeapon, theBodyPart) if(source == localPlayer) then outputChatBox("You were damaged!", 187, 0, 0, true); local localPlayerHealth = getElementHealth(localPlayer); if(localPlayerHealth >= 96) then -- Is the health between 96-100+? Draw 100.png dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/100.png" ) dxHealthImage = "health/100.png"; elseif(localPlayerHealth <= 95 and localPlayerHealth > 91) then -- Is the health between 95 and 91? Draw 95.png dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/95.png" ) dxHealthImage = "health/95.png"; elseif(localPlayerHealth <= 90 and localPlayerHealth > 86) then -- Is the health between 90 and 86? Draw 90.png dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/90.png" ) dxHealthImage = "health/90.png"; end end end addEventHandler("onClientPlayerDamage", root, exampleCode_Client); end local hudTable = { "ammo", "armour", "clock", "health", "money", "weapon", "wanted", "area_name", "vehicle_name", "breath", "clock" } addEventHandler("onClientRender", root, hudLekRoots) addEventHandler("onClientResourceStart", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, false) end end ) addEventHandler("onClientResourceStop", resourceRoot, function() for id, hudComponents in ipairs(hudTable) do showPlayerHudComponent(hudComponents, true) end end )
-
@Dealman did not understand much
-
yes I'm using the event, my friend function hudLekRoots ( ) --dxDrawImage addEventHandler("onClientRender", root, hudLekRoots)
-
@IIYAMA Not Work local largura = 220 local altura = 250 -------- local Tlargura = 0.785 local Taltura = 0.200 local health = math.ceil(getElementHealth(localPlayer)) if health > 0 then if health <= 5 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/05.png" ) if health <= 10 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/10.png" ) if health <= 15 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/15.png" ) if health <= 20 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/20.png" ) if health <= 25 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/25.png" ) if health <= 30 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/30.png" ) if health <= 35 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/35.png" ) if health <= 40 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/40.png" ) if health <= 45 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/45.png" ) if health <= 50 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/50.png" ) if health <= 55 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/55.png" ) if health <= 60 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/60.png" ) if health <= 65 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/65.png" ) if health <= 70 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/70.png" ) if health <= 75 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/75.png" ) if health <= 80 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/80.png" ) if health <= 85 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/85.png" ) if health <= 90 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/90.png" ) if health <= 95 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/95.png" ) if health <= 100 then dxDrawImage(x*Tlargura, y*Taltura, largura, altura, "health/100.png" ) end end
-
@IIYAMA I will try your example,
-
download this script https://community.multitheftauto.com/in ... ls&id=3468