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

Wysłany: 2018-02-04, 18:51


Xrent

-






Wiek: 22
Na forum: 3188 dni
Posty: 230
Nick w MP: Pazdam

Piwa: 535

Respekt: 295,3
Respekt: 295,3Respekt: 295,3Respekt: 295,3

Ostrzeżeń: 60%
Cze??, zrobi?em hud na serwer i jak skaluj? go relative to nie dopasowuje do innych rozdzielczo?? i do okna. I jak nada? dat? dla gui by podczas logowania da? setElementData false.


tutaj na 1024x720
- moja rozdzielczo?? 1600x900
Kod

font = dxCreateFont( "font.ttf", 12 )
fonty = dxCreateFont( "font1.ttf", 13 )
fontt = dxCreateFont( "font2.ttf", 12 )
local screenW, screenH = guiGetScreenSize()
local nick = getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x","")

addEventHandler("onClientRender", root, function()
    if isPlayerMapVisible() then return end

showPlayerHudComponent ("clock", false)
showPlayerHudComponent ("weapon", true)
showPlayerHudComponent ("health", true)
showPlayerHudComponent ("armour", true)
showPlayerHudComponent("money", false)
showPlayerHudComponent("ammo", true)
    
    local hajs = string.format("%08d", getPlayerMoney(getLocalPlayer()))

        dxDrawText(" "..nick.." ", screenW * 0.8519, screenH * 0.1211, screenW * 0.9356, screenH * 0.1722, tocolor(255,255,255), 1.00, fonty, "center", "top", false, false, false, false, false)   
        dxDrawText("EUR "..hajs..".00", (screenW * 0.7831) + 1, (screenH * 0.1667) + 1, (screenW * 1.0025) + 1, (screenH * 0.2600) + 1, tocolor(0, 0, 0, 255), 1.70, "pricedown", "left", "top", true, true, false, true, false)
        dxDrawText("EUR "..hajs..".00", screenW * 0.7831, screenH * 0.1667, screenW * 1.0025, screenH * 0.2600, tocolor(76, 180, 74, 255), 1.70, "pricedown", "left", "top", true, true, false, true, false)
        local time = getRealTime()
        local hours = time.hour
        local minutes = time.minute
        local second = time.second
        dxDrawText((hours+1)..":"..minutes.."."..second.." ",screenW * 0.7969, screenH * 0.0333, screenW * 0.8675, screenH * 0.0889, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, false, false)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-04, 18:57


Qwertick

Coming soon...






Wiek: 23
Na forum: 3718 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2727

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

font = dxCreateFont( "font.ttf", 12 )
fonty = dxCreateFont( "font1.ttf", 13 )
fontt = dxCreateFont( "font2.ttf", 12 )
local screenW, screenH = guiGetScreenSize()
local nick = getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x","")

addEventHandler("onClientRender", root, function()
    if isPlayerMapVisible() then return end
if getElementData(localPlayer, "hud") then return end

showPlayerHudComponent ("clock", false)
showPlayerHudComponent ("weapon", true)
showPlayerHudComponent ("health", true)
showPlayerHudComponent ("armour", true)
showPlayerHudComponent("money", false)
showPlayerHudComponent("ammo", true)
    
    local hajs = string.format("%08d", getPlayerMoney(getLocalPlayer()))

        dxDrawText(" "..nick.." ", screenW * 0.8519, screenH * 0.1211, screenW * 0.9356, screenH * 0.1722, tocolor(255,255,255), 1.00, fonty, "center", "top", false, false, false, false, false)   
        dxDrawText("EUR "..hajs..".00", (screenW * 0.7831) + 1, (screenH * 0.1667) + 1, (screenW * 1.0025) + 1, (screenH * 0.2600) + 1, tocolor(0, 0, 0, 255), 1.70, "pricedown", "left", "top", true, true, false, true, false)
        dxDrawText("EUR "..hajs..".00", screenW * 0.7831, screenH * 0.1667, screenW * 1.0025, screenH * 0.2600, tocolor(76, 180, 74, 255), 1.70, "pricedown", "left", "top", true, true, false, true, false)
        local time = getRealTime()
        local hours = time.hour
        local minutes = time.minute
        local second = time.second
        dxDrawText((hours+1)..":"..minutes.."."..second.." ",screenW * 0.7969, screenH * 0.0333, screenW * 0.8675, screenH * 0.0889, tocolor(255, 255, 255, 255), 1, font, "left", "top", false, false, false, false, false)
end)


setElementData(localPlayer, "hud", true) -- ukryj
setElementData(localPlayer, "hud", false) -- schowaj


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-05, 15:41


Xrent

-






Wiek: 22
Na forum: 3188 dni
Posty: 230
Nick w MP: Pazdam

Piwa: 535

Respekt: 295,3
Respekt: 295,3Respekt: 295,3Respekt: 295,3

Ostrzeżeń: 60%
To sama elementData tak czy z skalowaniem?

Postaw piwo autorowi tego posta
 

 
Tagi: skalowanie :: elementdata.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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