HG Snuuk Posted October 14, 2019 Share Posted October 14, 2019 Opa tudo bom , eu estou trabalhando numa hud e eu gostaria de fazer o seguinte , colocar para que não mostre munição de apenas 2 armas , a primeira que seria a first "Mão" , e a 2° a "colt" questão de apontar o dedo . local showammo3 = getPedTotalAmmo(getLocalPlayer()) dxDrawText(tostring (showammo3), x * 979, y * 240, x*1340, y*142,cor[1], 0.9, "pricedown", "right", "center") estou utilizando essa base para fazer a capturação das munição Link to comment
DNL291 Posted October 14, 2019 Share Posted October 14, 2019 local disabledweps = { [0] = true, [22] = true } if not disabledweps[weaponID] then local showammo3 = getPedTotalAmmo(getLocalPlayer()) dxDrawText(tostring (showammo3), x * 979, y * 240, x*1340, y*142,cor[1], 0.9, "pricedown", "right", "center") end 1 Link to comment
HG Snuuk Posted October 14, 2019 Author Share Posted October 14, 2019 4 minutes ago, DNL291 said: local disabledweps = { [0] = true, [22] = true } if not disabledweps[weaponID] then local showammo3 = getPedTotalAmmo(getLocalPlayer()) dxDrawText(tostring (showammo3), x * 979, y * 240, x*1340, y*142,cor[1], 0.9, "pricedown", "right", "center") end ele continua mostrando a quantidade total de munição Link to comment
DNL291 Posted October 14, 2019 Share Posted October 14, 2019 Mostre o código completo. Link to comment
HG Snuuk Posted October 14, 2019 Author Share Posted October 14, 2019 addEventHandler("onClientPreRender", root, function() if getElementData(localPlayer, "FPS") <= 20 then cor[1] = tocolor(255, 0, 0, 255) elseif getElementData(localPlayer, "FPS") >= 21 and getElementData(localPlayer, "FPS") <= 39 then cor[1] = tocolor(254, 204, 0, 255) elseif getElementData(localPlayer, "FPS") >= 40 then cor[1] = tocolor(255, 255, 255, 255) end if (getElementData(localPlayer, "TabActive") == false) then dxDrawImage(x*1228, y*4, x*120, y*80, "files/logo.png", 0, 0, 0, tocolor(255, 254, 254, 255), false) if moneyTick >= getTickCount() then dxDrawText(moneyChange, x * 979 -1, y * 150 -1, x*1340 -1, y*142 -1, tocolor(0, 0, 0, 255), x*0.8, "pricedown", "right", "center") dxDrawText(moneyChange, x * 979, y * 150, x*1340, y*142, cor[2], x*0.8, "pricedown", "right", "center") end dxDrawText("FPS: "..getElementData(localPlayer, "FPS"), x * 979 -1, y * 100 -1, x*1340 -1, y*142 -1, tocolor(0, 0, 0, 255), 0.9, "pricedown", "right", "center") dxDrawText("FPS: "..getElementData(localPlayer, "FPS"), x * 979, y * 100, x*1340, y*142,cor[1], 0.9, "pricedown", "right", "center") local disabledweps = { [0] = true, [22] = true } if not disabledweps[weaponID] then local showammo3 = getPedTotalAmmo(getLocalPlayer()) dxDrawText(tostring (showammo3), x * 979 -1, y * 240 -1, x*1340 -1, y*142 -1, tocolor(0, 0, 0, 255), 0.9, "pricedown", "right", "center") dxDrawText(tostring (showammo3), x * 979, y * 240, x*1340, y*142,cor[1], 0.9, "pricedown", "right", "center") end local money = convertNumber(getPlayerMoney(getLocalPlayer())) dxDrawText("Dinheiro R$: "..money, x * 979 -1, y * 200 -1, x*1340 -1, y*142 -1, tocolor(0, 0, 0, 255), 0.9, "pricedown", "right", "center") dxDrawText("Dinheiro R$: "..money, x * 979, y * 200, x*1340, y*142,cor[1], 0.9, "pricedown", "right", "center") if not getElementData(localPlayer, "ILEGAIS:Job") then local Encaminhado = getElementData ( localPlayer, "Emprego") or "Desempregado" dxDrawText(Encaminhado, x*979-1, y*150-1, x*1340-1, y*142-1, tocolor(0, 0, 0, 255), 0.9, "pricedown", "right", "center") dxDrawText(Encaminhado, x*979, y*150, x*1340, y*142, tocolor(255, 255, 255, 255), 0.9, "pricedown", "right", "center") else if (getElementData(localPlayer, "ILEGAIS:Job") == 1) then dxDrawText("Traficante de Drogas", x*979-1, y*43-1, x*1340-1, y*142-1, tocolor(0, 0, 0, 255), 1, "pricedown", "right", "center") dxDrawText("Traficante de Drogas", x*979, y*43, x*1340, y*142, tocolor(255, 255, 255, 255), 1, "pricedown", "right", "center") elseif (getElementData(localPlayer, "ILEGAIS:Job") == 2) then dxDrawText("Matador de Aluguel", x*979-1, y*43-1, x*1340-1, y*142-1, tocolor(0, 0, 0, 255), 1, "pricedown", "right", "center") dxDrawText("Matador de Aluguel", x*979, y*43, x*1340, y*142, tocolor(255, 255, 255, 255), 1, "pricedown", "right", "center") elseif (getElementData(localPlayer, "ILEGAIS:Job") == 3) then dxDrawText("Traficante de Orgãos", x*979-1, y*43-1, x*1340-1, y*142-1, tocolor(0, 0, 0, 255), 1, "pricedown", "right", "center") dxDrawText("Traficante de Orgãos", x*979, y*43, x*1340, y*142, tocolor(255, 255, 255, 255), 1, "pricedown", "right", "center") elseif (getElementData(localPlayer, "ILEGAIS:Job") == 5) then dxDrawText("Hacker", x*979-1, y*43-1, x*1340-1, y*142-1, tocolor(0, 0, 0, 255), 1, "pricedown", "right", "center") dxDrawText("Hacker", x*979, y*43, x*1340, y*142, tocolor(255, 255, 255, 255), 1, "pricedown", "right", "center") end end end end ) Link to comment
HG Snuuk Posted October 14, 2019 Author Share Posted October 14, 2019 um exeplo seria se eu estiver sem arma nenhuma , nem aparecer o texto . só aparecer quando tiver uma das armas permitidas Link to comment
DNL291 Posted October 14, 2019 Share Posted October 14, 2019 Você não definiu weaponID, getPedWeapon. Obs: existem outras armas que não possuem munição, como armas brancas. Link to comment
HG Snuuk Posted October 14, 2019 Author Share Posted October 14, 2019 como eu posso ta fazendo pra fazer usando o exemplo a cima. Link to comment
DNL291 Posted October 15, 2019 Share Posted October 15, 2019 disabledweps[weaponID] disabledweps[ getPedWeapon(localPlayer) ] 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now