Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: hudzie
1. kasa w hudzie
Robie hud na serwer ale kasa mi sie nie odejmuje dopiero jak zrestartuje skrypt

Kod:

local kasa = getElementData(localPlayer, "pieniadze")


Kod:

dxDrawText(kasa.." PLN", screenW * 0.8147, screenH * 0.1927, screenW * 0.9485, screenH * 0.2174, tocolor(255, 255, 255, 255), 1.3, "default", "center", "center", false, false, false, false, false)
2. Brak koloru nicku na hudzie
Witam mam problem z hudem, gdy? nie wy?wietla on koloru nicku tylko hex. Prosz? o pomoc.
3. nakładające się napisy w hudzie
siema zrobi?em sobie hud kt?ry wy?wietla si? po wej?ciu do czo?gu, pokazuje on nick gracza ,nazw? pojazdu , ilo?? hp pojazdu i jego pr?dko?? . Z tymi ostatnimi 2 rzeczami mam problem mianowicie po wej?ciu do czo?gu hud si? pokazuje ale pr?dko?ci nie da si? odczyta? bo jeden napis nak?ada si? na drugi , tak samo jest z paskiem hp .



function tank_data() 
    
GUIEditor = { 
        
label = { } ,
        
staticimage = { }         
    }    
    

        if 
show == true then
        tank 
getPedOccupiedVehicle(localPlayer) -- definicja obiektu tank
        hp 
getElementHealth(tank)               -- hp obiektu tank
        speed 
getElementSpeed(tank,"km/h")      -- pr?dko?? obiektu tank
        
        GUIEditor
.staticimage[1] = guiCreateStaticImage15880hp20"hp.png"false)  -- tworzenie paska hp

        GUIEditor
.label[3] = guiCreateLabel(159209415speed .."km/h"false)         -- tworzenie linijki z pr?dko?cipojazdu
        guiSetFont
(GUIEditor.label[3], "default-bold-small")
        
    
end


end
addEventHandler
("onClientRender"roottank_data)


4. nie działą zapisywanie się prawojazdy i kasy w hudzie
Jak w tytule nie zapisuje sie kasa repputacja oraz prawo jazdy
:piwo: :piwo: :piwo:
5. Wyświetlanie kasy w hudzie z mysql
Chcia?bym zrobi?, aby w hudzie na bie??co aktualizowala sie kwota, kt?ra jest w bazie danych zapisana jako bank_money i tabela o nazwie: gl_users .

Kod z ladowania graczy:
function loadPlayerData(plr)
    
local result=exports["gl-db"]:dbGet("SELECT * FROM gl_users WHERE id=?"getElementData(plr,"player:sid"))
    if 
result and #result > 0 then
        
local v=result[1]
                
setElementData(plr,"player:bank",v.bank_money)


Kod z hudu:
local bank convertNumber(getElementData(localPlayer"player:bank") or "0")
6. przecinek w hudzie np 1,000,000
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, ...
7. Przecinki w hudzie #2
Witam ot?? doda?em przecinki do hudu i wyskakuje taki b??d
W DB3
[lua]hud/c_gui.lua:39: attempt to call global 'przecinek' (a nil value)[/lua]
kod
c_gui
[lua]--[[
Skrypt: HUD
Autor: Venteer
Dla GTAO.pl
]]

--Dane

local sW, sH=guiGetScreenSize() -- /1920*sW /1080*sH
local font = dxCreateFont ("files/czcionka.ttf", 30)
setElementData(localPlayer, "hud", true)

--HUD



addEventHandler("onClientRender", root, function()
setPlayerHudComponentVisible("ammo", false)
setPlayerHudComponentVisible("area_name", false)
setPlayerHudComponentVisible("armour", false)
setPlayerHudComponentVisible("breath", false)
setPlayerHudComponentVisible("clock", false)
setPlayerHudComponentVisible("health", false)
setPlayerHudComponentVisible("money", false)
setPlayerHudComponentVisible("vehicle_name", false)
setPlayerHudComponentVisible("weapon", false)
setPlayerHudComponentVisible("radio", false)
setPlayerHudComponentVisible("wanted", false)
if not getElementData(localPlayer, "hud") then return end
local health = getElementHealth(localPlayer)
health = math.floor(health)
local rp = getElementData(localPlayer, "player:reputation") or 0 -- Tu zmie? elementdate rp na w?asn?
local mp = getElementData(localPlayer, "player:movep") or 0 -- ...
8. Przecinki w hudzie
Witam pomocy, doda? by mi kto? przecinki co 3 cyfry do hudu? Za pomoc daj? respekt oraz zimne piwsko !
kod
[lua]-Dane

local sW, sH=guiGetScreenSize() -- /1920*sW /1080*sH
local font = dxCreateFont ("files/czcionka.ttf", 30)
setElementData(localPlayer, "hud", true)

--HUD



addEventHandler("onClientRender", root, function()
setPlayerHudComponentVisible("ammo", false)
setPlayerHudComponentVisible("area_name", false)
setPlayerHudComponentVisible("armour", false)
setPlayerHudComponentVisible("breath", false)
setPlayerHudComponentVisible("clock", false)
setPlayerHudComponentVisible("health", false)
setPlayerHudComponentVisible("money", false)
setPlayerHudComponentVisible("vehicle_name", false)
setPlayerHudComponentVisible("weapon", false)
setPlayerHudComponentVisible("radio", false)
setPlayerHudComponentVisible("wanted", false)
if not getElementData(localPlayer, "hud") then return end
local health = getElementHealth(localPlayer)
health = math.floor(health)
local rp = getElementData(localPlayer, "player:reputation") or 0 -- Tu zmie? elementdate rp na w?asn?
local mp = getElementData(localPlayer, "player:movep") or 0 -- Tu zmie? elementdate rp na w?asn?
local money = getPlayerMoney()
dxDrawImage(sW * 0, sH * 0, sW * 1, sH * 1, "files/hud.png", 0, 0, 0,...
9. Jak usunąć kolory gracza na hudzie
Hejka.
Mam pytanie, bo chcia?bym wy??czy? rzecz, kt?ra pokazuje si? na mapie.
w sensie s? takie kwadraciki i to jest gracz - jak to wy??czy??
10. Brak pieniędzy w STANDARDOWYM HUD'zie
Witam, tak jak w temacie. Nie wy?wietla mi pieni?dzy w Standardowym HUD'zie. Pow?d jest taki, ?e mam inn? ElementDate. Chcia?bym ?eby ten HUD by? standardowy lecz nie wiem jak zmieni? z getPlayerMoney na Swoj? element dat? poniewa? nie mam skryptu na "STANDARDOWY HUD". Prosze o jak?? pomoc, kt?ra rozwi??e ten problem.

Za poprawn? odpowied? wynagrodz? piwkiem oraz Respektem :)
11. czcionka czasu na hudzie
witam jak zrobi? czcionk? (podmieni? czcionk?) pod czas na hudzie? takie co?: http://imgur.com/Wicjm0x

pod dan? nazwe czcionki?

tutaj podaje sw?j skrypt na realny czas:
[lua]
function updateTime()
local offset = tonumber(get("offset"))
local realtime = getRealTime()
hour = realtime.hour + offset
if hour >= 24 then
hour = hour - 24
elseif hour < 0 then
hour = hour + 24
end

minute = realtime.minute

setTime(hour, minute)

nextupdate = (60-realtime.second) * 1000
setMinuteDuration( nextupdate )
setTimer( setMinuteDuration, nextupdate + 5, 1, 60000 )
end

addEventHandler("onResourceStart", getResourceRootElement(), updateTime )

setTimer( updateTime, 1800000, 0 )


local sw,sh = guiGetScreenSize()
myFont = dxCreateFont( "font.ttf", 25 )


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

showPlayerHudComponent("clock", false)

local pieniadze = string.format("%08d", getPlayerMoney(getLocalPlayer()))

dxDrawText(""..pieniadze.."", 1116/1440*sw, 199/900*sh, 1354/1440*sw, 248/900*sh, tocolor(0, 0, 0, 255), 0.90, myFont, "left", "top", false, false, false, false, false)
dxDrawText(""..pieniadze.."", 1116/1440*sw, 199/900*sh, 1354/1440*sw, 240/900*sh, tocolor(0, 0, 0, 255), 0.90, myFont, "left", "top", false, ...