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

Wysłany: 2023-11-30, 15:01


K4M7K







Wiek: 34
Na forum: 1326 dni
Posty: 9
Nick w MP: 7EVEN

Piwa: 6

Respekt: 50

Mam problem z podlaczeniem avatarow z dashbordu do hudu pomoze ktos oto kod avtarow i hudu
-- Autor: AsaXx

panel = false

local sw,sh = guiGetScreenSize()
local scale = 1366 / sw

local font4 = dxCreateFont("Roboto-Regular.ttf", 9)
local font41 = dxCreateFont("Roboto-Regular.ttf", 8)
local font412 = dxCreateFont("Roboto-Regular.ttf", 15)
local font4123 = dxCreateFont("Roboto-Regular.ttf", 11)

local sx,sy=guiGetScreenSize()

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

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

function dashboard()
    setPlayerHudComponentVisible ( "radar", false )
    local lvl = getElementData(localPlayer, "player:lvl")
    local lvl2 = getElementData(localPlayer, "player:lvl") + 1
    local exp = getElementData(localPlayer, "player:exp")

    local pjA = getElementData(localPlayer, "player:license:pjA") or "Brak"
    local pjB = getElementData(localPlayer, "player:license:pjB") or "Brak"
    local pjC = getElementData(localPlayer, "player:license:pjC") or "Brak"
    local pjL = getElementData(localPlayer, "player:license:pjL") or "Brak"

    local ppA = getElementData(localPlayer, "player:ppA")
    local ppB = getElementData(localPlayer, "player:ppB")
    local ppC = getElementData(localPlayer, "player:ppC")
    local ppL = getElementData(localPlayer, "player:ppL")

    if pjA == 0 then 
        setElementData(localPlayer, "player:ppA", "Brak")
    elseif pjA == 1 then 
        setElementData(localPlayer, "player:ppA", "Tak")
    end
    if pjB == 0 then 
        setElementData(localPlayer, "player:ppB", "Brak")
    elseif pjB == 1 then 
        setElementData(localPlayer, "player:ppB", "Tak")
    end
    if pjC == 0 then 
        setElementData(localPlayer, "player:ppC", "Brak")
    elseif pjC == 1 then 
        setElementData(localPlayer, "player:ppC", "Tak")
    end
    if pjL == 0 then 
        setElementData(localPlayer, "player:ppL", "Brak")
    elseif pjL == 1 then 
        setElementData(localPlayer, "player:ppL", "Tak")
    end

    local tekst = "Siemka "..getPlayerName(localPlayer).."#ffffff! Witam ciÄ&#8482; na serwerze NAZWASERWERA. PozwĂłl, ĹĽe przedstawiÄ&#8482; Tobie po krĂłtce \nco warto zrobiÄ&#8225; na poczÄ&#8230;tku gry na naszym serwerze. Na poczÄ&#8230;tku warto udaÄ&#8225; siÄ&#8482; na pracÄ&#8482; \nmagazyniera. Znajduje siÄ&#8482; ona w okolicy LOKALIZACJA. NastÄ&#8482;pnie warto zrobiÄ&#8225; pierwszy wiÄ&#8482;kszy \nkrok na serwerze. Tak - prawojazdy. Bo przecieĹĽ nikt nie che (hehe) jeĹşdziÄ&#8225; bez prawa jazdy, co nie?\nKategoria B kosztuje CENA. Warto jÄ&#8230; zrobiÄ&#8225; jako pierwszÄ&#8230;, poniewaĹĽ dziÄ&#8482;ki temu moĹĽemy \nprzystÄ&#8230;piÄ&#8225; do pracy jako PRACA, jeĹ&#8250;li mamy odpowiedni poziom. A jak juĹĽ przy poziomach - na \nserwerze obowiÄ&#8230;zuje system poziomĂłw. Tak wiem zaskoczenie. Za kaĹĽdy poziom dostajemy 10.000$. \nPoza tym, ĹĽe dostajemy pieniÄ&#8230;ĹĽki odblokowujemy takĹĽe różne pracÄ&#8482; oraz pojazdy. Tak - bez \nodpowiedniego poziomiu nie bÄ&#8482;dziesz mĂłgĹ&#8218; kupiÄ&#8225; swojego wymarzonego pereniala. \n\nTo tyle sĹ&#8218;owem wstÄ&#8482;pu, jeĹ&#8250;li jeszcze czegoĹ&#8250; nie wiesz odsyĹ&#8218;am ciÄ&#8482; do administracji (/admins). \nMoĹĽesz napisaÄ&#8225; do niej w prywatnej wiadomoĹ&#8250;ci lub poprzez raporta (/raport).\n\nMiĹ&#8218;ej gry!\n\nAdministracja NAZWASERWERA."
 
    local time = getRealTime()
    local hours = time.hour
    local minutes = time.minute
    local seconds = time.second
    if (hours < 10) then
        hours = "0"..hours
    end
    if (minutes < 10) then
        minutes = "0"..minutes
    end
    if (seconds < 10) then
        seconds = "0"..seconds
    end


    local monthday = time.monthday
    if (monthday < 10) then
        monthday = "0"..monthday
    end
    local month = time.month
    if (month < 10) then
        month = "0"..month
    end
    local year = time.year

    dxDrawRectangle(325/scale, 160/scale, 750/scale, 450/scale, tocolor(12, 12, 12, 240), false)
    dxDrawRectangle(325/scale, 160/scale, 150/scale, 450/scale, tocolor(17, 17, 17, 255), false)
    dxDrawRectangle(325/scale, 160/scale, 750/scale, 50/scale, tocolor(17, 17, 17, 255), false)

    if isMouseIn(325/scale, 312/scale, 150/scale, 25/scale) then 
        dxDrawRectangle(325/scale, 312/scale, 150/scale, 25/scale, tocolor(10, 10, 10, 240))

    elseif isMouseIn(325/scale, 362/scale, 150/scale, 25/scale) then 
        dxDrawRectangle(325/scale, 362/scale, 150/scale, 25/scale, tocolor(10, 10, 10, 240))

    elseif isMouseIn(325/scale, 412/scale, 150/scale, 25/scale) then
        dxDrawRectangle(325/scale, 412/scale, 150/scale, 25/scale, tocolor(10, 10, 10, 240))
    elseif isMouseIn(325/scale, 462/scale, 150/scale, 25/scale) then
        dxDrawRectangle(325/scale, 462/scale, 150/scale, 25/scale, tocolor(10, 10, 10, 240))
    end

    dxDrawRectangle(355/scale, 175/scale, 85/scale, 85/scale, tocolor(10, 10, 10, 255))
    if getElementData(localPlayer, "player:avatar") == 0 then 
        dxDrawImage(360/scale, 180/scale, 75/scale, 75/scale, "default.png")
    elseif getElementData(localPlayer, "player:avatar") == 1 then 
        dxDrawImage(360/scale, 180/scale, 75/scale, 75/scale, "1.png")
    elseif getElementData(localPlayer, "player:avatar") == 2 then 
        dxDrawImage(360/scale, 180/scale, 75/scale, 75/scale, "2.jpg")
    elseif getElementData(localPlayer, "player:avatar") == 3 then 
        dxDrawImage(360/scale, 180/scale, 75/scale, 75/scale, "3.jpg")
    elseif getElementData(localPlayer, "player:avatar") == 4 then 
        dxDrawImage(360/scale, 180/scale, 75/scale, 75/scale, "4.jpg")
    elseif getElementData(localPlayer, "player:avatar") == 5 then 
        dxDrawImage(360/scale, 180/scale, 75/scale, 75/scale, "5.jpg")
    elseif getElementData(localPlayer, "player:avatar") == 6 then 
        dxDrawImage(360/scale, 180/scale, 75/scale, 75/scale, "6.jpg")
    end

    dxDrawText(""..lvl.."", 1125/scale, 270/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4123, "center", "center")
    dxDrawText(""..lvl2.."", 1670/scale, 270/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4123, "center", "center")
    dxDrawRectangle(640/scale, 175/scale, 215/scale, 20/scale, tocolor(10, 10, 10, 255))
    dxDrawRectangle(642/scale, 177/scale, 210*(exp/500)/scale, 15/scale, tocolor(255, 255, 255, 255))

    dxDrawText("Informacje", 700/scale, 550/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
    dxDrawText("Przeowdnik", 700/scale, 650/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
    dxDrawText("Gracz", 700/scale, 750/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
    dxDrawText("Avatar", 700/scale, 850/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")

    dxDrawText(""..monthday.."-"..month.."-2021", 695/scale, 1048/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font41, "center", "center")
    dxDrawText(""..hours..":"..minutes..":"..seconds.."", 694/scale, 1075/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font41, "center", "center")

    if page == 1 then 
        dxDrawImage(675/scale, 250/scale, 125/scale, 115/scale, "astralrp.png")
        dxDrawText("Data startu serwera: XX-XX-XXXX", 1375/scale, 775/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
        dxDrawText("ZaĹ&#8218;oĹĽyciel: AsaXx", 1375/scale, 850/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
        dxDrawText("Rekord online: 500", 1375/scale, 925/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
    
    elseif page == 2 then 
        dxDrawText(""..tekst.."", 1435/scale, 625/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center", false, false, false, true, false)
    
    elseif page == 3 then 
        -- OGĂ&#8220;LNE
        dxDrawRectangle(525/scale, 250/scale, 185/scale, 18/scale, tocolor(4, 4, 4, 240))
        dxDrawText("Informacje ogĂłlne", 1075/scale, 419/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font41, "center", "center")

        dxDrawRectangle(525/scale, 275/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- nick
        --dxDrawText("#C0C0C0Nick: "..getPlayerName(localPlayer).."", 1006/scale, 469/scale, 100/scale, 100/scale, tocolor(192,192,192, 255), 1, font41, "center", "center", false, false, false, true, false)
        dxDrawText("#C0C0C0Nick: #ffffff"..getPlayerName(localPlayer).."", 539/scale, 100/scale, 100/scale/scale, 469/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        dxDrawRectangle(525/scale, 300/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- id
        dxDrawText("#C0C0C0ID: #ffffff"..getElementData(localPlayer, "id").."", 539/scale, 100/scale, 100/scale, 519/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        dxDrawRectangle(525/scale, 325/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- sid
        dxDrawText("#C0C0C0SID: #ffffff"..getElementData(localPlayer, "player:sid").."", 539/scale, 569/scale, 100/scale, 100/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        dxDrawRectangle(525/scale, 350/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- hajs
        if getElementData(localPlayer, "player:premium") == true then
            dxDrawText("#C0C0C0Konto: #C0FF00Premium", 539/scale, 619/scale, 100/scale, 100/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        else 
            dxDrawText("#C0C0C0Konto: #ffffffNormalne", 539/scale, 619/scale, 100/scale, 100/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        end
        dxDrawRectangle(525/scale, 375/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- hajs bank
        dxDrawText("#C0C0C0PieniÄ&#8230;dze: #ffffff"..przecinek(getPlayerMoney(localPlayer)).."", 539/scale, 669/scale, 100/scale, 100/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        dxDrawRectangle(525/scale, 400/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- godziny
        dxDrawText("#C0C0C0Minuty: #ffffff"..getElementData(localPlayer, "player:hours").."", 539/scale, 719/scale, 100/scale, 100/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        dxDrawRectangle(525/scale, 425/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- skin id
        dxDrawText("#C0C0C0Skin: #ffffff"..getPlayerSkin(localPlayer).."", 539/scale, 769/scale, 100/scale, 100/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)

        -- LICENCJE
        dxDrawRectangle(825/scale, 250/scale, 185/scale, 18/scale, tocolor(4, 4, 4, 240))
        dxDrawText("Licencje", 1620/scale, 419/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font41, "center", "center")

        dxDrawRectangle(825/scale, 275/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- 
        dxDrawText("#C0C0C0Kategoria A: #ffffff"..ppA.."", 839/scale, 100/scale, 100/scale/scale, 469/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        dxDrawRectangle(825/scale, 300/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- 
        dxDrawText("#C0C0C0Kategoria B: #ffffff"..ppB.."", 839/scale, 100/scale, 100/scale/scale, 519/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        dxDrawRectangle(825/scale, 325/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- 
        dxDrawText("#C0C0C0Kategoria C: #ffffff"..ppC.."", 839/scale, 100/scale, 100/scale/scale, 569/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)
        dxDrawRectangle(825/scale, 350/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- 
        dxDrawText("#C0C0C0Kategoria L: #ffffff"..ppL.."", 839/scale, 100/scale, 100/scale/scale, 619/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)

        -- INNE
        dxDrawRectangle(825/scale, 400/scale, 185/scale, 18/scale, tocolor(4, 4, 4, 240))
        dxDrawText("Inne informacje", 1660/scale, 719/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font41, "center", "center")

        dxDrawRectangle(825/scale, 425/scale, 185/scale, 18/scale, tocolor(10, 10, 10, 240)) -- ping
        dxDrawText("#C0C0C0Ping: #ffffff"..getPlayerPing(localPlayer).."", 839/scale, 100/scale, 100/scale/scale, 769/scale, tocolor(192,192,192, 255), 1, font41, "left", "center", false, false, false, true, false)

    elseif page == 4 then
        dxDrawRectangle(570/scale, 270/scale, 85/scale, 85/scale, tocolor(10, 10, 10, 255))
        dxDrawImage(575/scale, 275/scale, 75/scale, 75/scale, "1.png")
        if not isMouseIn(570/scale, 375/scale, 85/scale, 20/scale) then
            dxDrawRectangle(570/scale, 375/scale, 85/scale, 20/scale, tocolor(10, 10, 10, 255))
        else 
            dxDrawRectangle(569/scale, 374/scale, 88/scale, 23/scale, tocolor(10, 10, 10, 255))
        end

        dxDrawRectangle(720/scale, 270/scale, 85/scale, 85/scale, tocolor(10, 10, 10, 255))
        dxDrawImage(725/scale, 275/scale, 75/scale, 75/scale, "2.jpg")
        if not isMouseIn(720/scale, 375/scale, 85/scale, 20/scale) then
            dxDrawRectangle(720/scale, 375/scale, 85/scale, 20/scale, tocolor(10, 10, 10, 255))
        else 
            dxDrawRectangle(719/scale, 374/scale, 88/scale, 23/scale, tocolor(10, 10, 10, 255))
        end

        dxDrawRectangle(870/scale, 270/scale, 85/scale, 85/scale, tocolor(10, 10, 10, 255))
        dxDrawImage(875/scale, 275/scale, 75/scale, 75/scale, "3.jpg")
        if not isMouseIn(870/scale, 375/scale, 85/scale, 20/scale) then 
            dxDrawRectangle(870/scale, 375/scale, 85/scale, 20/scale, tocolor(10, 10, 10, 255))
        else 
            dxDrawRectangle(869/scale, 374/scale, 88/scale, 23/scale, tocolor(10, 10, 10, 255))
        end

        dxDrawRectangle(570/scale, 445/scale, 85/scale, 85/scale, tocolor(10, 10, 10, 255))
        dxDrawImage(575/scale, 450/scale, 75/scale, 75/scale, "4.jpg")
        if not isMouseIn(570/scale, 550/scale, 85/scale, 20/scale) then
            dxDrawRectangle(570/scale, 550/scale, 85/scale, 20/scale, tocolor(10, 10, 10, 255))
        else 
            dxDrawRectangle(569/scale, 549/scale, 88/scale, 23/scale, tocolor(10, 10, 10, 255))
        end


        dxDrawRectangle(720/scale, 445/scale, 85/scale, 85/scale, tocolor(10, 10, 10, 255))
        dxDrawImage(725/scale, 450/scale, 75/scale, 75/scale, "5.jpg")
        if not isMouseIn(720/scale, 550/scale, 85/scale, 20/scale) then
            dxDrawRectangle(720/scale, 550/scale, 85/scale, 20/scale, tocolor(10, 10, 10, 255))
        else 
            dxDrawRectangle(719/scale, 549/scale, 88/scale, 23/scale, tocolor(10, 10, 10, 255))
        end

        dxDrawRectangle(870/scale, 445/scale, 85/scale, 85/scale, tocolor(10, 10, 10, 255))
        dxDrawImage(875/scale, 450/scale, 75/scale, 75/scale, "6.jpg")
        if not isMouseIn(870/scale, 550/scale, 85/scale, 20/scale) then
            dxDrawRectangle(870/scale, 550/scale, 85/scale, 20/scale, tocolor(10, 10, 10, 255))
        else 
            dxDrawRectangle(869/scale, 549/scale, 88/scale, 23/scale, tocolor(10, 10, 10, 255))
        end

        dxDrawText("Wybierz", 1125/scale, 670/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
        dxDrawText("Wybierz", 1425/scale, 670/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
        dxDrawText("Wybierz", 1725/scale, 670/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")

        dxDrawText("Wybierz", 1125/scale, 1020/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
        dxDrawText("Wybierz", 1425/scale, 1020/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")
        dxDrawText("Wybierz", 1725/scale, 1020/scale, 100/scale, 100/scale, tocolor(255, 255, 255, 255), 1, font4, "center", "center")

    end 
end

function onoff()
    if panel == false then
        addEventHandler("onClientRender", root, dashboard)
        panel = true
        showChat(false)
        showCursor(true)
        page = 1
    else
        removeEventHandler("onClientRender", root, dashboard)
        setPlayerHudComponentVisible( "radar", true )
        showChat(true)
        showCursor(false)
        panel = false
    end
end

bindKey("F1", "down", onoff)

addEventHandler("onClientClick", root, function()
    if isMouseIn(325/scale, 312/scale, 150/scale, 25/scale) then
        page = 1 
    elseif isMouseIn(325/scale, 362/scale, 150/scale, 25/scale) then
        page = 2
    elseif isMouseIn(325/scale, 412/scale, 150/scale, 25/scale) then
        page = 3
    elseif isMouseIn(325/scale, 462/scale, 150/scale, 25/scale) then
        page = 4
    end
end)

addEventHandler("onClientClick", root, function()
    if page == 4 then
        if isMouseIn(570/scale, 375/scale, 85/scale, 20/scale) then 
            setElementData(localPlayer, "player:avatar", 1)
        elseif isMouseIn(720/scale, 375/scale, 85/scale, 20/scale) then
            setElementData(localPlayer, "player:avatar", 2)
        elseif isMouseIn(870/scale, 375/scale, 85/scale, 20/scale) then 
            setElementData(localPlayer, "player:avatar", 3)
        elseif isMouseIn(570/scale, 550/scale, 85/scale, 20/scale) then
            setElementData(localPlayer, "player:avatar", 4)
        elseif isMouseIn(725/scale, 550/scale, 85/scale, 20/scale) then 
            setElementData(localPlayer, "player:avatar", 5)
        elseif isMouseIn(875/scale, 550/scale, 85/scale, 20/scale) then 
            setElementData(localPlayer, "player:avatar", 6)
        end
    end
end)
i kod hudu
main = {
    onlineTime = 0,
    onlineTime2 = 0,
    premiumMoney = 50000,
    premiumPlusMoney = 150000,
    afkTimes = 0,
}
local screenW, screenH = guiGetScreenSize()
local px, py = (screenW/1366),(screenH/768)
local zoom = 1
if screenW < 1366 then
    zoom = math.min(2, 1366 / screenW)
end
tick = getTickCount()
online = 0
function getPedWeapons(ped)
    local playerWeapons = {}
    if ped and isElement(ped) and getElementType(ped) == "ped" or getElementType(ped) == "player" then
        for i=2,9 do
            local wep = getPedWeapon(ped,i)
            if wep and wep ~= 0 then
                table.insert(playerWeapons,wep)
            end
        end
    else
        return false
    end
    return playerWeapons
end
main.voiceAlpha = 0
main.renderHUD = function()
    if getElementData(localPlayer, "player:sid") and not getElementData(localPlayer,"notshowhud") then
        local health = math.floor(getElementHealth(localPlayer))
        local money = getPlayerMoney(localPlayer)
        exports["W_Avatar"]:dxCreateAvatar(1265*px, 5*px, 95*px, 95*px, 255)
        if getElementData(localPlayer, "voice:mowi") then
            main.voiceAlpha = main.voiceAlpha + 25 <= 255 and main.voiceAlpha + 25 or 255
        else
            main.voiceAlpha = main.voiceAlpha - 25 >= 0 and main.voiceAlpha - 25 or 0 
        end
        dxDrawImage(1327*px, 75*px, 22*px, 22*px, "img/vc-off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(1327*px, 75*px, 22*px, 22*px, "img/vc-on.png", 0, 0, 0, tocolor(255, 255, 255, main.voiceAlpha), false)
        local weaponID = getPedWeapon(localPlayer)
        if weaponID then
            if weaponID == 8 then
            else
                dxDrawImage(1276*px, 110*px, 3*px, 3*px, "weapons/"..(weaponID or 0)..".png", 0, 0, 0, tocolor(255, 255, 255, 225), false)
                local weaponSlot = getPedWeaponSlot (localPlayer)
                if(weaponSlot > 1 and weaponSlot < 7) and not isElementInWater(localPlayer) then
                    local ammoClip = getPedAmmoInClip (localPlayer, weaponSlot)
                    local totalAmmo = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer)
                    dxDrawText(""..totalAmmo.." / "..ammoClip.." AMMO", 1270*px, 115*px, 1346*px, 95*px, tocolor(0, 0, 0, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money7"), "right", "top", false, false, false, true, false)
                    if getElementData(localPlayer, "player:strefaDM") == true then
                    dxDrawText("#FFFFFF"..totalAmmo.." / "..ammoClip.."#008000 AMMO", 1270*px, 115*px, 1345*px, 85*px, tocolor(255, 255, 255, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money7"), "right", "top", false, false, false, true, false)    
                    else
                    dxDrawText("#FFFFFF"..totalAmmo.." / "..ammoClip.."#008000 AMMO", 1270*px, 115*px, 1345*px, 85*px, tocolor(255, 255, 255, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money7"), "right", "top", false, false, false, true, false)    
                    end
                end
            end
        end
        dxDrawText("&#9829; "..health.."%", 1141*px, 40*px, 1265*px, 176*px, tocolor(0,0,0, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money9"), "right", "top", false, false, false, true, false)
            dxDrawText("&#9829; "..health.."%", 1141*px, 40*px, 1265*px, 176*px, tocolor(255,0,0, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money9"), "right", "top", false, false, false, true, false)
            dxDrawText("", 1171*px, 14*px, 1275*px, 96*px, tocolor(0, 0, 0, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money9"), "right", "top", false, false, false, true, false)
            dxDrawText("", 1170*px, 13*px, 1274*px, 95*px, tocolor(255, 225, 0, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money9"), "right", "top", false, false, false, true, false)
        dxDrawText(""..main.przecinkiAdd(money).." PLN", 1170*px, 70*px, 1264*px, 95*px, tocolor(0, 0, 0, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money8"), "right", "top", false, false, false, true, false)
        if getElementData(localPlayer, "player:strefaDM") == true then
        dxDrawText(""..main.przecinkiAdd(money).." #ff0000PLN", 1170*px, 69*px, 1263*px, 93*px, tocolor(255, 255, 255, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money8"), "right", "top", false, false, false, true, false)    
        else
        dxDrawText(""..main.przecinkiAdd(money).." #15B400PLN", 1170*px, 69*px, 1263*px, 93*px, tocolor(255, 255, 255, 255), 1/zoom, exports.nrpg_interface:getGUIFont("money8"), "right", "top", false, false, false, true, false)    end
        local x,y,z = getElementPosition(localPlayer)
        local sid = getElementData(localPlayer, "player:sid")
        local marycha = getElementData(localPlayer, "player:marihuana") or 0
        if getElementInterior(localPlayer) == 0 then
        end    
        if marycha > 1 then
            dxDrawText("Marihuana: "..marycha.."g", 282*px, 697*py, 367*px, 751*py, tocolor(0,0,0, 255), 1/zoom, exports.nrpg_interface:getGUIFont("gtav10"), "left", "center", false, false, false, false, false)
            dxDrawText("Marihuana: "..marycha.."g", 281*px, 696*py, 366*px, 750*py, tocolor(0,200,0, 255), 1/zoom, exports.nrpg_interface:getGUIFont("gtav10"), "left", "center", false, false, false, false, false) end
        if not getElementData(localPlayer, "player:customradar") then
            if getElementData(localPlayer, "player:strefaDM") == true then
            dxDrawText(ulica:gsub("#%x%x%x%x%x%x", "").." Strefa DM", 281*px, 696*py, 466*px, 657*py, tocolor(0, 0, 0, 255), 1/zoom, exports.nrpg_interface:getGUIFont("aileron10"), "left", "center", false, false, false, false, false)
            dxDrawText(ulica.." #ff0000Strefa DM", 280*px, 695*py, 465*px, 655*py, tocolor(255, 255, 255, 255), 1/zoom, exports.nrpg_interface:getGUIFont("aileron10"), "left", "center", false, false, false, true, false)    
        else    
        end
            dxDrawText("Sesja: "..main.secondsToClock(online), 8*px, 700*py, 252*px, 760*py, tocolor(225, 225, 225, 155), 1/zoom, exports.nrpg_interface:getGUIFont("money7"), "left", "bottom", false, false, false, false, false)
        end
        if (getTickCount() - tick) >= (1000) then
            tick = getTickCount()
            online=online+1
            main.addTime(1000)
        end
    end
end
main.addTime = function(seconds)
    main.onlineTime = main.onlineTime + 1
    main.onlineTime2 = main.onlineTime2 + 1
    if main.onlineTime2 > 60 then
        setElementData(localPlayer, "player:hours", tonumber(getElementData(localPlayer, "player:hours") or 0)+1)
        main.onlineTime2 = 0
    end
    if main.onlineTime > (60*60) then
        if getElementData(localPlayer, "player:premiumplus") then
            outputChatBox("&#9432; #FFFFFFOtrzymujesz #25C700"..main.przecinkiAdd(main.premiumPlusMoney).." PLN#ffffff za przegraną godzinę.", 255, 255, 0, true)
            triggerServerEvent("givePlayerBankMoney", localPlayer, main.premiumPlusMoney)
            main.onlineTime = 0
        elseif getElementData(localPlayer, "player:premium") then
            outputChatBox("&#9432; #FFFFFFOtrzymujesz #25C700"..main.przecinkiAdd(main.premiumMoney).." PLN#ffffff za przegraną godzinę.", 255, 255, 0, true)
            triggerServerEvent("givePlayerBankMoney", localPlayer, main.premiumMoney)
            main.onlineTime = 0
        end
    end
end
main.secondsToClock = function(seconds)
    seconds = seconds or 0
    if seconds <= 0 then
        return "00:00:00"
    else
        hours = string.format("%02.f", math.floor(seconds/3600))
        mins = string.format("%02.f", math.floor(seconds/60 - (hours*60)))
        secs = string.format("%02.f", math.floor(seconds - hours*3600 - mins *60))
        return hours..":"..mins..":"..secs
    end
end
addEventHandler("onClientResourceStart", resourceRoot, function()
    setPlayerHudComponentVisible("all", false)
    addEventHandler("onClientRender", root, function()
        main.renderHUD()
    end)    
end)
main.przecinkiAdd = function(amount) 
    local formatted = amount 
        while true do   
            formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') 
            
            if (k==0) then 
                break 
              end 
        end 
    return formatted 
end
bindKey("F7", "down", function()
    if getElementData(localPlayer, "player:sid") then
        if getElementData(localPlayer, "notshowhud") then
            setElementData(localPlayer, "notshowhud", false)
            showChat(true)
        else
            setElementData(localPlayer, "notshowhud", true)
            showChat(false)
        end
    end
end)


Ostatnio zmieniony przez rxkrxd 2023-11-30, 15:20, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2023-12-06, 16:11


Sokdev18

CJ






Wiek: 23
Na forum: 1340 dni
Posty: 27
Nick w MP: Soczek

Piwa: 123

Respekt: 20,5

Ostrzeżeń: 100%
Nadal potrzebujesz pomocy?

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Tagi: jak :: podpiac :: avatary?
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Jak podpiac avatary? 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