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

Wysłany: 2019-01-27, 22:25


smigi







Wiek: 23
Na forum: 3367 dni
Posty: 60
Nick w MP: smigi

Piwa: 2

Respekt: 50

Witam mam pytanie...
Wi?c tak na serwerze mam wgrana paczk? pysa 3.0 je?li chce wgra? inny hud z innej paczki on si? w??cza lecz si? nie wy?wietla nikomu co mam zrobi??

Czy to mo?e by? co? od element daty?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-27, 23:34


Mikołajj







Wiek: 22
Na forum: 2885 dni
Posty: 303
Nick w MP: Mikołaj

Piwa: 132

Respekt: 91

Tak, prawdopodobie?stwo innych element dat wynosi 99.9%.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-28, 19:23


Xrent

-






Wiek: 21
Na forum: 3047 dni
Posty: 230
Nick w MP: Pazdam

Piwa: 535

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

Ostrzeżeń: 60%
Daj kod od hudu

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-28, 21:13


OCBSlim







Wiek: 26
Na forum: 2703 dni
Posty: 43
Nick w MP: OCBSlim

Piwa: 415

Respekt: 60

Zmie? element daty na te z PYStories'a.

Podpis
Może kiedyś wrócę z nowym projektem! ;-) Pozdrawiam!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-28, 22:03


smigi







Wiek: 23
Na forum: 3367 dni
Posty: 60
Nick w MP: smigi

Piwa: 2

Respekt: 50

Kod:

local sw, sh=guiGetScreenSize()





local components = { "weapon", "ammo", "health", "clock", "money", "breath", "armour", "wanted", "vehicle_name", "area_name", "radio" }

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
function ()
for _, component in ipairs( components ) do
setPlayerHudComponentVisible( component, false )
end
end)


local fps = false
function getCurrentFPS()
return fps
end

local function updateFPS(msSinceLastFrame)
fps = (1 / msSinceLastFrame) * 1000
end
addEventHandler("onClientPreRender", root, updateFPS)

local function drawFPS()
if not getCurrentFPS() then
return
end
if getElementData(localPlayer,"licznik:fps") then
local roundedFPS = math.floor(getCurrentFPS())
dxDrawText(roundedFPS.." FPS", sw-40 - dxGetTextWidth(roundedFPS), 0)
end
end
addEventHandler("onClientHUDRender", root, drawFPS)

function sx(po)
return (po/1680)*sw
end

function sy(po)
return (po/1050)*sh
end

local font=exports["srpg-gui"]:czcionka(sx(14))

addEventHandler("onClientRender", getRootElement(), function()
if getElementData(localPlayer,"hud:visible") then
local money=convertNumber(getPlayerMoney(localPlayer))
local hp=getElementHealth(localPlayer)
local glod=getElementData(localPlayer,"player:glod") or 0
local time = getRealTime()
local hours = time.hour
local minutes = time.minute

dxDrawImage(sx(1426), sy(14), sx(239), sy(40), ":srpg-hud/i/bg_glod.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(sx(1173), sy(14), sx(239), sy(40), ":srpg-hud/i/bg_zycie.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(sx(1177+197), sy(18), sx(-197)*hp/100, sy(32), ":srpg-hud/i/stanzycie.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(sx(1430+197), sy(18), sx(-197)*glod/100, sy(32), ":srpg-hud/i/stanglod.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)

ramka2(sx(1592), sy(67), sx(70), sy(70), exports["srpg-avatars"]:loadAvatar(getElementData(localPlayer,"player:uid")), 0, 0, 0, tocolor(255, 255, 255, 255), false)

shadowText(string.format("%02d", hours)..":"..string.format("%02d",minutes), sx(1388), sy(92), sx(1581), sy(120), tocolor(210, 210, 210, 255), font)
shadowText(money.." PLN", sx(1388), sy(110), sx(1581), sy(138), tocolor(210, 210, 210, 255), font)
end
end)

setTimer(function()
if not getElementData(localPlayer,"player:logged") then return end
setElementData(localPlayer,"player:glod", getElementData(localPlayer,"player:glod")-0.50)
if getElementData(localPlayer, "player:glod") <= 0 then
setElementHealth(localPlayer, getElementHealth(localPlayer)-5)
end
end, 120000, 0)

addEventHandler("onClientElementDataChange", root, function(data, oldValue)
if not getElementData(localPlayer,"player:logged") then return end
if data == "player:glod" then
if getElementData(localPlayer, "player:glod") <= 0 then
setElementHealth(localPlayer, getElementHealth(localPlayer)-5)
end
elseif getElementData(localPlayer, "player:glod") >= 100 then
setElementData(localPlayer, "player:glod", 100)
end
end)


function addElementHealth(element, value)
if not tonumber(value) then return end
local healthElement=getElementHealth(element)
setElementHealth(element, healthElement+value)
end

function ramka2(x, y, w, h, img)
local color2 = tocolor(34, 83, 157)
dxDrawRectangle(x-3, y-3, w+6, h+6, color2, false)
dxDrawImage(x, y, w, h, img, 0, 0, 0, tocolor(255, 255, 255, 255), false)
end

function shadowText(text, x, y, w, h, color, ffont)
dxDrawText(text, x+1, y+1, w+1, h+1, tocolor(0, 0, 0, 255), 1, ffont, "right", "center", false, false, false, false, false)
dxDrawText(text, x, y, w, h, color, 1, ffont, "right", "center", false, false, false, false, false)
end

function convertNumber (number)

local formatted = number

while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if ( k==0 ) then
break
end
end

return formatted

end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-28, 22:38


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

W linijce
if getElementData(localPlayer,"hud:visible"then

podmie? elementDat? na tak?, kt?r? ustawiasz jako 'true' po zalogowaniu.

Postaw piwo autorowi tego posta
 

 
Tagi: hud
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