Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2021-01-18, 22:32


Panasonic_PL_







Wiek: 26
Na forum: 2167 dni
Posty: 16
Nick w MP: Tolek



Respekt: 50

Witam was Ponownie :p Znalaz?em tutaj na stronie Bardzo ?adny hud!
Tylko nie wiem Jak dok?adnie da? K??ko kt?re zosta?o Pokazane na zdj?ciu (Na zdj?ciu jest one czarne Natomiast u mnie nie ma go) Poprosi?bym o Kod w kt?rym dzia?a? by ten hud

 
setElementData(localPlayer, "hud", true)

local sx, sy = guiGetScreenSize()
local font = dxCreateFont("gtav.ttf", 20)
local font2 = dxCreateFont("normal.ttf", 16)
setPlayerHudComponentVisible("all", false)
setPlayerHudComponentVisible("radar", true)

function sw(value)
    return sx*value/1920    
end
            
function sh(value)    
    return sy*value/1080
end

local pos={
    server = { x = 2700, y = -525, w = 825, h = 627},
    imgHud = { x = 0, y = 0, w = 1920, h = 1080},
    imgKolo = { x = 0, y = 0, w = 115, h = 115}
}

local images={
    hud = dxCreateTexture(':drpg-hud/img/hud.png', 'argb', false, 'clamp'),
    pasek = dxCreateTexture(':drpg-hud/img/pasek.png', 'argb', false, 'clamp'),
    kolo = dxCreateTexture(':drpg-avatary/kolo.png', 'argb', false, 'clamp'),
}

function render()
    local player={
        name = getPlayerName(localPlayer),
        money = getPlayerMoney(localPlayer),
    }
        
    dxDrawImage(sw(pos["imgHud"].x), sh(pos["imgHud"].y), sw(pos["imgHud"].w), sh(pos["imgHud"].h), images.hud, 0, 0, 0, tocolor(255,255,255,200), false)
    dxDrawImage(sw(pos["imgHud"].x), sh(pos["imgHud"].y), sw(pos["imgHud"].w), sh(pos["imgHud"].h), images.pasek, 0, 0, 0, tocolor(255,255,255,200), false)
    dxDrawImage(sw(pos["imgHud"].x+1575), sh(pos["imgHud"].y+59), sw(pos["imgKolo"].w), sh(pos["imgKolo"].h), images.kolo, 0, 0, 0, tocolor(255,255,255,200), false)

  dxDrawText(player.name, sw(pos["server"].x - 350), sw(pos["server"].y - 2), sw(pos["server"].w), sw(pos["server"].h), tocolor(230, 230, 230, 255), 1.00, font,"center","center",true, true, true, true, true)
    dxDrawText(""..przecinek(player.money).." PLN", sw(pos["server"].x + 50), sw(pos["server"].y + 220), sw(pos["server"].w), sw(pos["server"].h), tocolor(230, 230, 230, 255), 1.00, font2, "center", "center", true, true, true, true, true)
    if getElementData(localPlayer, "player:premium") then 
        dxDrawText("#fcdf03Premium", sw(pos["server"].x + 125), sw(pos["server"].y - 2), sw(pos["server"].w), sw(pos["server"].h), tocolor(230, 230, 230, 255), 1.00, font, "center", "center", true, true, true, true, true)
   end
end
addEventHandler("onClientRender", root, render)

function przecinek(liczba)  
    local format = liczba  
    while true do      
        format, k = string.gsub(format, "^(-?%d+)(%d%d%d)", '%1,%2')    
        if ( k==0 ) then      
            break  
        end  
    end  
    return format
end


Ostatnio zmieniony przez Wilq 2021-01-18, 22:34, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-18, 22:37


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

W linijce 26 masz odniesienie do skryptu drpg-avatary. Je?li nie masz tego zasobu to musisz go stworzy? lub bezpo?rednio w tej linijce wstawi? ?cie?k? do zdj?cia uprzednio zdj?cie dodaj?c do mety.


Więcej informacji znajdziesz w Wikipedii MTA:

dxCreateTexture


Postaw piwo autorowi tego posta
 

 
Tagi: hud :: nie :: działa :: poprawnie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » hud Nie działa Poprawnie Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku