Opa, agora deu certo! ^^ Eu usei:
local vida = math.min(getElementHealth(localPlayer)/100,1)
e usei:
_dxDrawImageSection(1138, 102, 34,34,0,0,34,34,"files/img/health.png",0,0,0,99,150,255,255,false,1-vida)
Mt obrigado Gw8!
Aqui ficou com um monte de círculos ;-;
meu código:
_dxDrawImageSection(1138, 102, 34,34,0,0,34,34,"files/img/health.png",0,0,0,99,150,255,255,false,vida)
E coloquei a função _dxDrawImageSection no código tb, mas ficou assim:
;-; Mesmo assim ficou errado, ficou esticado dos lados
local vida = getElementHealth(localPlayer)
dxDrawImageSection(1138, 102, 34, 34, 0, 0, 34, 34*(vida/100), 'files/img/health.png', 180, 0, 0, tocolor(255, 255, 255, 255))
Se a vida do player estiver em 100, fica normal, no lugar certo, mas se o player perde vida o círculo vai subindo
Meu código:
local vida = getElementHealth(localPlayer)
dxDrawImageSection(1138, 102, 34, 34*(vida/100), 0, 0, 34, 34*(vida/100), 'files/img/health.png', 180, 0, 0, tocolor(255, 255, 255, 255))
Muito obrigado cara! Tu é o cara
Realmente com o image section da, mas como eu posso calcular pra fzer como na foto? pode me ajudar novamente? kkk
por exemplo calcular a vida do player
vida = getElementHealth(localPlayer)
Eu tentei usar
34/100*vida
(34 é o tamanho da imagem), mas a imagem só ficou esticada ;-;
Hello guys, I wanted to ask a question here, how can I do to make a dx circle, when I change the height it looks like this, with the top straight ^^
reference image:
Hello, I have a resource here in html and when I put it in the MTA, it has a white background, I don't understand practically anything about html and css and I already tried to make the body background as transparent, but the background was white ?
body {
background: transparent;
}
Does anyone know how to make it transparent to help me, please ?
Opa, eu tenho uma resource aqui em html e quando eu coloco no MTA, ela fica com o fundo branco, eu não entendo praticamente nada de html e css e eu já tentei colocar o background do body como transparent, mas o fundo ficou branco ?
body {
background: transparent;
}
Alguém sabe como deixa transparente pra me ajudar, pfv? ???
Hello, I am in doubt about how to get the ids system of this resource to implement in my chat resource.
IDS Resource Link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=2322
Everything I have so far from my script:
function twitter ( thePlayer, _, ... )
local message = table.concat ( { ... }, " " )
local uncoloredMsg = string.gsub(message, "#%x%x%x%x%x%x", "") --Delete all HEX codes.
local nick = getPlayerName(thePlayer)
local uncoloredNick = string.gsub(nick, "#%x%x%x%x%x%x", "") --Delete all HEX codes.
outputChatBox ( "[TWITTER] "..uncoloredNick.."[ID]: "..uncoloredMsg, root, 255, 255, 255, true )
end
addCommandHandler ( "twitter", twitter )