Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screenW, screenH = guiGetScreenSize()
- local x, y = (screenW/1366), (screenH/768)
- local components = { "area_name", "radio", "vehicle_name" }
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
- function ()
- for _, component in ipairs( components ) do
- setPlayerHudComponentVisible( component, false )
- end
- end)
- local dxfont1_font = dxCreateFont("files/font/font.ttf", 18)
- alpha = 0
- function dxHud1()
- local vida1 = math.floor(getElementHealth(getLocalPlayer()))
- local oxigenio = math.floor(getPedOxygenLevel ( getLocalPlayer()) )
- local vida2 = getPedMaxHealth(getLocalPlayer())
- local colete = math.floor(getPedArmor(getLocalPlayer()))
- local dinheiro1 = ("%09d"):format(getPlayerMoney(getLocalPlayer()))
- local dinheiro2 = tostring(getPlayerMoney(getLocalPlayer())):gsub("-", "#ADFF2F")
- local procurado = getPlayerWantedLevel(getLocalPlayer())
- local weaponClip = getPedAmmoInClip(getLocalPlayer(), getPedWeaponSlot(getLocalPlayer()))
- local weaponAmmo = getPedTotalAmmo(getLocalPlayer()) - getPedAmmoInClip(getLocalPlayer())
- local armaId = getPedWeapon(getLocalPlayer())
- local arma = getPedWeapon(getLocalPlayer())
- local noreloadweapons = {}
- noreloadweapons[16] = true
- noreloadweapons[17] = true
- noreloadweapons[18] = true
- noreloadweapons[19] = true
- noreloadweapons[25] = true
- noreloadweapons[33] = true
- noreloadweapons[34] = true
- noreloadweapons[35] = true
- noreloadweapons[36] = true
- noreloadweapons[37] = true
- noreloadweapons[38] = true
- noreloadweapons[39] = true
- noreloadweapons[41] = true
- noreloadweapons[42] = true
- noreloadweapons[43] = true
- local meleespecialweapons = {}
- meleespecialweapons[0] = true
- meleespecialweapons[1] = true
- meleespecialweapons[2] = true
- meleespecialweapons[3] = true
- meleespecialweapons[4] = true
- meleespecialweapons[5] = true
- meleespecialweapons[6] = true
- meleespecialweapons[7] = true
- meleespecialweapons[8] = true
- meleespecialweapons[9] = true
- meleespecialweapons[10] = true
- meleespecialweapons[11] = true
- meleespecialweapons[12] = true
- meleespecialweapons[13] = true
- meleespecialweapons[14] = true
- meleespecialweapons[15] = true
- meleespecialweapons[40] = true
- meleespecialweapons[44] = true
- meleespecialweapons[45] = true
- meleespecialweapons[46] = true
- -- //#Fundo
- if oxigenio < 1000 or isElementInWater (getLocalPlayer()) then
- dxDrawRectangle(x*1145, y*103, x*150/1000*oxigenio, y*11, tocolor(172, 203, 241, 255), false)
- contornoRetangulo(x*1145, y*103, x*150, y*11, tocolor(0, 0, 0, 255), 1)
- dxDrawRectangle(x*1145, y*103, x*150, y*11, tocolor(255, 255, 255, 125), false)
- end
- dxDrawImage(x*1190, y*115, x*60, y*60, "files/img/"..tostring(arma)..".png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
- dxDrawRectangle(x*1145, y*68, x*150, y*11, tocolor(255, 255, 255, 125), false)
- dxDrawRectangle(x*1145, y*85, x*150, y*11, tocolor(255, 255, 255, 125), false)
- dxDrawImage(x*1130, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(0, 0, 0, 100), false)
- dxDrawImage(x*1160, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(0, 0, 0, 100), false)
- dxDrawImage(x*1190, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(0, 0, 0, 100), false)
- dxDrawImage(x*1220, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(0, 0, 0, 100), false)
- dxDrawImage(x*1250, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(0, 0, 0, 100), false)
- dxDrawImage(x*1280, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(0, 0, 0, 100), false)
- -- //#Status Jogador
- dxDrawRectangle(x*1145, y*68, x*150/vida2*vida1, y*11, tocolor(173, 255, 47), false)
- dxDrawRectangle(x*1145, y*85, x*150/100*colete, y*11, tocolor(255, 255, 255, 255), false)
- -- //#Nivel Procurado
- if procurado == 1 then
- dxDrawImage(x*1280, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- end
- if procurado == 2 then
- dxDrawImage(x*1280, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1250, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- end
- if procurado == 3 then
- dxDrawImage(x*1280, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1250, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1220, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- end
- if procurado == 4 then
- dxDrawImage(x*1280, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1250, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1220, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1190, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- end
- if procurado == 5 then
- dxDrawImage(x*1280, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1250, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1220, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1190, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1160, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- end
- if procurado == 6 then
- dxDrawImage(x*1280, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1250, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1220, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1190, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1160, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- dxDrawImage(x*1130, y*10, x*25, y*25, "files/img/star.png", 0, 0, 0, tocolor(255, 255, 255, alpha), false)
- end
- -- //#Armas
- dxDrawText("#ADFF2F"..weaponClip.." #FFFFFF/ #ADFF2F"..weaponAmmo, x*1245, y*311, x*1195, y*50, tocolor(255, 255, 255, 255), x*1.10, "default-bold", "center", "center", false, false, false, true, false)
- -- //#Dinheiro
- if tonumber(dinheiro1) > -1 then
- dxDrawText("$ "..dinheiro1, x*1045, y*05, x*1280, y*100, tocolor(255, 255, 255, 255), x*1.00, dxfont1_font, "right", "center", false, false, true, true, false)
- dxDrawText(dinheiro2, x*1045, y*05, x*1280, y*100, tocolor(173, 255, 47), x*1.00, dxfont1_font, "right", "center", false, false, true, true, false)
- else
- dxDrawText("$ "..dinheiro1, x*1045, y*05, x*1280, y*100, tocolor(255, 255, 255, 255), x*1.00, dxfont1_font, "right", "center", false, false, true, true, false)
- dxDrawText(dinheiro2, x*1045, y*05, x*1280, y*100, tocolor(173, 255, 47), x*1.00, dxfont1_font, "right", "center", false, false, true, true, false)
- end
- -- //#Contorno Retangulo
- contornoRetangulo(x*1145, y*68, x*150, y*11, tocolor(0, 0, 0, 255), 1)
- contornoRetangulo(x*1145, y*85, x*150, y*11, tocolor(0, 0, 0, 255), 1)
- end
- function dxDrawBorderedText( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI )
- dxDrawText ( text, x - 1, y - 1, w - 1, h - 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false )
- dxDrawText ( text, x + 1, y - 1, w + 1, h - 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false )
- dxDrawText ( text, x - 1, y + 1, w - 1, h + 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false )
- dxDrawText ( text, x + 1, y + 1, w + 1, h + 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false )
- dxDrawText ( text, x - 1, y, w - 1, h, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false )
- dxDrawText ( text, x + 1, y, w + 1, h, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false )
- dxDrawText ( text, x, y - 1, w, h - 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false )
- dxDrawText ( text, x, y + 1, w, h + 1, tocolor ( 0, 0, 0, 155 ), scale, font, alignX, alignY, clip, wordBreak, false )
- dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI )
- end
- function renderDxHud()
- addEventHandler("onClientRender", getRootElement(), dxHud1)
- setPlayerHudComponentVisible("armour", false)
- setPlayerHudComponentVisible("wanted", false)
- setPlayerHudComponentVisible("weapon", false)
- setPlayerHudComponentVisible("money", false)
- setPlayerHudComponentVisible("health", false)
- setPlayerHudComponentVisible("clock", false)
- setPlayerHudComponentVisible("breath", false)
- setPlayerHudComponentVisible("ammo", false)
- end
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), renderDxHud)
- function onStop()
- setPlayerHudComponentVisible("armour", true)
- setPlayerHudComponentVisible("wanted", true)
- setPlayerHudComponentVisible("weapon", true)
- setPlayerHudComponentVisible("money", true)
- setPlayerHudComponentVisible("health", true)
- setPlayerHudComponentVisible("clock", true)
- setPlayerHudComponentVisible("breath", true)
- setPlayerHudComponentVisible("ammo", true)
- end
- addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), onStop)
- function toggleRadar()
- if isVisible then
- addEventHandler("onClientRender", root, dxHud1)
- else
- removeEventHandler("onClientRender", root, dxHud1)
- end
- isVisible = not isVisible
- end
- addCommandHandler ( "hud", toggleRadar )
- function contornoRetangulo(absX, absY, sizeX, sizeY, color, ancho)
- dxDrawRectangle(absX, absY, sizeX, ancho, color)
- dxDrawRectangle(absX, absY + ancho, ancho, sizeY - ancho, color)
- dxDrawRectangle(absX + ancho, absY + sizeY - ancho, sizeX - ancho, ancho, color)
- dxDrawRectangle(absX + sizeX - ancho, absY + ancho, ancho, sizeY - ancho*2, color)
- end
- local alphaState = true
- function alphaFunction()
- if alphaState == true then
- alpha = alpha + 30
- if alpha >= 255 then
- alphaState = false
- end
- end
- if alphaState == false then
- alpha = alpha - 30
- if alpha <= 0 then
- alphaState = true
- end
- end
- end
- addEventHandler("onClientRender", getRootElement(), alphaFunction)
- function getPedMaxHealth(ped)
- assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]")
- local stat = getPedStat(ped, 24)
- local maxhealth = 100 + (stat - 569) / 4.31
- return math.max(1, maxhealth)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement