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

Wysłany: 2019-07-12, 13:18


kerfyn

Hyp3R






Wiek: 25
Na forum: 2739 dni
Posty: 121
Nick w MP: Hyp3R

Piwa: 2

Respekt: 50

Mam problem bo nie wiem jak zrobi? przecinki w hudzie Wiem ?e du?o Jest temat?w o tym ale tamte kody Nie dzia?aj? Mi a mam hud pys 3.0 :

[lua]local sx,sy=guiGetScreenSize()
local screenW, screenH=guiGetScreenSize()
function renderHUD()
if getElementData(localPlayer,"notshowhud") then return end
dxSetAspectRatioAdjustmentEnabled( true )

local realtime = getRealTime()
local hour = realtime.hour
local minute = realtime.minute

local x,y,z=getElementPosition(localPlayer)

--%08d
--dxDrawRectangle(screenW * 0.7079, screenH * 0.0417, screenW * 0.2848, screenH * 0.1536, tocolor(0, 0, 0, 155), false)

--dxDrawText(string.format("%02d",hour).." : "..string.format("%02d", minute), sx*1089/1280+1, sy*(30+1)/720, sx*1251/1280+1, sy*92/720+1, tocolor(255, 255, 255, 255), 2, "pricedown", "center", "center", false)
--dxDrawText(string.format("%02d",hour).." : "..string.format("%02d", minute), sx*1089/1280, sy*(30)/720, sx*1251/1280, sy*92/720, tocolor(255, 255, 255, 255), 2, "pricedown", "center", "center", false)

dxDrawText(string.format("PLN %06d", getPlayerMoney()), sx*996/1280+1, sy*60/720+1, sx*1218/1280+1, sy*209/720+1, tocolor(0, 0, 0, 255), 1.50, "pricedown", "center", "center", false)
dxDrawText(string.format("PLN %06d", getPlayerMoney()), sx*996/1280, sy*60/720, sx*1218/1280, sy*209/720, tocolor(10, 106, 40, 217), 1.50, "pricedown", "center", "center", false)
dxDrawText("| FPS: "..getElementData(localPlayer,"fps").." | PING: "..getPlayerPing(localPlayer).." |", screenW * 0.8097+1, screenH * 0.0143+1, screenW * 0.9575+1, screenH * 0.0456+1, tocolor(0, 0, 0, 255), 1.5, "default-bold", "center", "top", false, false, false, false, false)
dxDrawText("| FPS: "..getElementData(localPlayer,"fps").." | PING: "..getPlayerPing(localPlayer).." |", screenW * 0.8097, screenH * 0.0143, screenW * 0.9575, screenH * 0.0456, tocolor(255, 255, 255, 255), 1.5, "default-bold", "center", "top", false, false, false, false, false)


----------------------PREMKA I NON PREMKA :D
--[[if not getElementData(localPlayer,"player:premium") then
tekst=string.format("%s [%d] [UID: %d]",lokalny_nick,lokalne_id,lokalne_uid)
else
tekst=string.format("★ %s [%d] [UID: %d]",lokalny_nick,lokalne_id,lokalne_uid)
end
if not getElementData(localPlayer,"player:premium") then
local rozmiar = 1.00
dxDrawText(tekst, (screenW * 0.7236) - 1, (screenH * 0.0575) - 1, (screenW * 0.9693) - 1, (screenH * 0.1276) - 1, tocolor(0, 0, 0, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText(tekst, (screenW * 0.7236) + 1, (screenH * 0.0575) - 1, (screenW * 0.9693) + 1, (screenH * 0.1276) - 1, tocolor(0, 0, 0, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText(tekst, (screenW * 0.7236) - 1, (screenH * 0.0575) + 1, (screenW * 0.9693) - 1, (screenH * 0.1276) + 1, tocolor(0, 0, 0, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText(tekst, (screenW * 0.7236) + 1, (screenH * 0.0575) + 1, (screenW * 0.9693) + 1, (screenH * 0.1276) + 1, tocolor(0, 0, 0, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText(tekst, screenW * 0.7236, screenH * 0.0575, screenW * 0.9693, screenH * 0.1276, tocolor(255, 255, 255, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
else
dxDrawText(tekst, (screenW * 0.7236) - 1, (screenH * 0.0575) - 1, (screenW * 0.9693) - 1, (screenH * 0.1276) - 1, tocolor(0, 0, 0, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText(tekst, (screenW * 0.7236) + 1, (screenH * 0.0575) - 1, (screenW * 0.9693) + 1, (screenH * 0.1276) - 1, tocolor(0, 0, 0, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText(tekst, (screenW * 0.7236) - 1, (screenH * 0.0575) + 1, (screenW * 0.9693) - 1, (screenH * 0.1276) + 1, tocolor(0, 0, 0, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText(tekst, (screenW * 0.7236) + 1, (screenH * 0.0575) + 1, (screenW * 0.9693) + 1, (screenH * 0.1276) + 1, tocolor(0, 0, 0, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText(tekst, screenW * 0.7236, screenH * 0.0575, screenW * 0.9693, screenH * 0.1276, tocolor(249, 224, 75, 255), rozmiar, "default-bold", "left", "top", false, false, false, false, false)
end--]]
----------------------PREMKA I NON PREMKA :D


--[[if getElementData(localPlayer,"player:premium") then
konto = "#FFFFFFKONTO #E28800PREMIUM"
elseif getElementData(localPlayer,"player:level",1) then
konto = "#FFFFFFKONTO #01bf34MOD"
elseif getElementData(localPlayer,"player:level",2) then
konto = "#FFFFFFKONTO #ff0000ADMIN"
elseif getElementData(localPlayer,"player:level",3) then
konto = "#FFFFFFKONTO #a31303ROOT"
elseif getElementData(localPlayer,"player:level",4) then
konto = "#FFFFFFKONTO #8F00FFW?A?CICIEL"
--else
--konto = "#FFFFFFKONTO #FFFFFFGRACZ"
end
local tekst= string.format("\n\n\n\n\n\n\n\n\n\n #FFFFFF[%s#FFFFFF]",konto)
dxDrawText(tekst, screenW * 0.8000, screenH * 0.0, screenW * 1.0000, screenH * 0.05, tocolor(255, 255, 255, 210), 1.45, "default-bold", "center", "center", false, false, true, true, false)--]]

--[[if getElementData(localPlayer,"player:premium") then
konto = "#FFFFFFKONTO #FFFF00PREMIUM#FFFFFF"
elseif getElementData(localPlayer, "player:level",1) then
konto = "#FFFFFFKONTO #01BF34MODERATOR#FFFFFF"
elseif getElementData(localPlayer, "player:level",2) then
konto = "#FFFFFFKONTO #FF0000ADMIN#FFFFFF"
elseif getElementData(localPlayer, "player:level",3) then
konto = "#FFFFFFKONTO #A31303RCON#FFFFFF"
else
konto = "#FFFFFFKONTO #919191GRACZ#FFFFFF"
end

--if getElementData(localPlayer,"player:premium") then
--konto = "#ffff00PREMIUM#ffffff"
--else
--konto = "ZWYKLE"
--end
local tekst= string.format("(%s)",konto)
dxDrawText(tekst, screenW * 0.8000, screenH * 0.0, screenW * 1.0000, screenH * 0.05, tocolor(255, 255, 255, 210), 2, default-bold, "center", "center", false, false, true, true, false)--]]
end

--
addEventHandler("onClientRender", root, function()
if not getElementData(localPlayer,"player:logged") then return end
if dxSetAspectRatioAdjustmentEnabled then dxSetAspectRatioAdjustmentEnabled(true) end
renderHUD() -- set new hud
end)

addEventHandler("onClientResourceStart", resourceRoot, function()
showPlayerHudComponent("all",false)
showPlayerHudComponent("radar",true)
showPlayerHudComponent("crosshair",true)
showPlayerHudComponent("weapon",true)
showPlayerHudComponent("health",true)
showPlayerHudComponent("breath",true)
showPlayerHudComponent("armour",true)
showPlayerHudComponent("clock",true)
showPlayerHudComponent("ammo",true)
end)


addCommandHandler("qkx.gp",function()
outputChatBox("Interior: " .. getElementInterior(localPlayer) .. " Dimension: " .. getElementDimension(localPlayer))
local x,y,z=getElementPosition(localPlayer)
local _,_,a=getElementRotation(localPlayer)
p=string.format("%.2f, %.2f, %.2f",x,y,z)
setClipboard(p)
outputChatBox("Pozycja gracza: " .. p)
local veh=getPedOccupiedVehicle(localPlayer)
if veh then
local x,y,z=getElementPosition(veh)
local rx,ry,rz=getElementRotation(veh)
p=string.format("%.2f, %.2f, %.2f, %.1f, %.1f, %.1f",x,y,z,rx,ry,rz)
setClipboard(p)
outputChatBox("Pozycja pojazdu: " .. p)
end
end)


fileDelete("c_gui.lua") -- usuwamy[/lua]

Ostatnio zmieniony przez Dawidos. 2019-07-14, 15:19, w całości zmieniany 6 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-12, 13:50


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Nie m?w, ?e ci nie dzia?a kod bo nigdzie go tutaj nie ma.
Tak ci??ko wpisa? to co chcesz w wyszukiwarce?
Ten kod dzia?a na pewno, wystarczy z g?ow? go przepisa?: https://gtao.pl/hud-z-przecinkami-vt125528.htm

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
kerfyn
Wysłany: 2019-07-12, 15:31


kerfyn

Hyp3R






Wiek: 25
Na forum: 2739 dni
Posty: 121
Nick w MP: Hyp3R

Piwa: 2

Respekt: 50

No wlasnie tutaj patrzy?em i jak kopiuje kod potem zmienam Sw Sh na swoje to Gui przestaje dzia?a?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-12, 16:29


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Po co zmieniasz jakie? sw sh, po co guieditor. Tutaj tylko kopiujesz funkcje przecinek z linku powy?ej.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
kerfyn
Wysłany: 2019-07-12, 17:58


kerfyn

Hyp3R






Wiek: 25
Na forum: 2739 dni
Posty: 121
Nick w MP: Hyp3R

Piwa: 2

Respekt: 50

dxDrawText(przecinek(money)("PLN %06d", getPlayerMoney()), sx*996/1280, sy*60/720, sx*1218/1280, sy*209/720, tocolor(10, 106, 40, 217), 1.50, "pricedown", "center", "center", false) i nie dziala

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-12, 20:17


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Nie rozumiem czemu da?e? przecinek(money) I te swoje stare formatowanie. Albo jedno albo drugie. Masz zdefiniowana zmienn? money, ?e kopiujesz na pa???

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
kerfyn
Wysłany: 2019-07-13, 10:07


kerfyn

Hyp3R






Wiek: 25
Na forum: 2739 dni
Posty: 121
Nick w MP: Hyp3R

Piwa: 2

Respekt: 50

Wilq To ja nie wiem jak mam to zrobi?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-13, 14:00


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

kerfyn daj kod w tagach
 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-13, 19:05


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

To w jaki spos?b napisa?e? reszt? kodu, je?li z tak ?atwym problemem nie mo?esz sobie poradzi??
W kodzie masz
"przecinek(money)"
i
"("PLN %06d", getPlayerMoney())"

Albo u?ywasz jednego, albo drugiego.
Czy masz zdefiniowan? zmienn? money, ?e u?ywasz jej zamiast bezpo?redniego pobierania stanu pieni?dzy za pomoc? getPlayerMoney?

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
kerfyn
Wysłany: 2019-07-13, 21:02


kerfyn

Hyp3R






Wiek: 25
Na forum: 2739 dni
Posty: 121
Nick w MP: Hyp3R

Piwa: 2

Respekt: 50

Nie no naprawde nie wiem co ?le robi? To jest dziwne Zrobi?em Gui w?asne a takiej banalnej rzeczy nie umiem xd :
[code]dxDrawText(przecinek(money),"PLN %06d", sW * 0.627, sH * 0, sW * 1, sH * 0.040, tocolor(255, 255, 255, 255), 1.0, font, "left", "center", false, false, false, false, false)[/code],

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-13, 21:25


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Zadam pytanie jeszcze raz: czy masz zdefiniowan? zmienn? 'money', ?e jej u?ywasz zamiast bezpo?redniego pobierania pieni?dzy za pomoc? funkcji?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-13, 21:35


kerfyn

Hyp3R






Wiek: 25
Na forum: 2739 dni
Posty: 121
Nick w MP: Hyp3R

Piwa: 2

Respekt: 50

Nie wiem o co chodzi z t? zmienn?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-13, 21:36


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Cytat:

zmienn? 'money'


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-13, 22:05


kerfyn

Hyp3R






Wiek: 25
Na forum: 2739 dni
Posty: 121
Nick w MP: Hyp3R

Piwa: 2

Respekt: 50

to chyba mam No nie wiem nie mo?esz poprostu napisa? funkcji przecinkiem..
dxDrawText(przecinek(money), getPlayerMoney()), sx*996/1280, sy*60/720, sx*1218/1280, sy*209/720, tocolor(10, 106, 40, 217), 1.50, "pricedown", "center", "center", false) Kombinuje na r??ne sposoby i nie wiem naprawde inne rzeczy umiem tej nie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-13, 22:20


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Ju? bli?ej.
Funkcj?, kt?ra pobierasz stan pieni?dzy gracza wstawiasz zamiast tej ZMIENNNEJ, Z KT?REJ NIE KORZYSTASZ I KTORA NIE JEST ZDEFINIOWANA.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
kerfyn
Tagi: przecinek :: hudzie :: 000 :: 000
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