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

Wysłany: 2018-08-26, 08:59


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50

Witam, po wgraniu nowego hudu, jak jest panel logowania to wida? ten hud i to przeszkadza, jak zrobi? aby nie by? widoczny w panelu logowania, tylko na serwerze?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-26, 10:33


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Po zalogowaniu na serwer:
setElementData(zmienna_gracza"hud"true)


W HUD daj warunek:
if getElementData(localPlayer"hud"then
--hud
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-26, 10:45


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50

Doda?em to na samym dole hudu
 if getElementData(localPlayer"hud"then
--hud
end

i nic sie nie stalo, hud dalej jest w panelu logowania

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-26, 14:42


Adis.exe

LUA Developer






Wiek: 23
Na forum: 3498 dni
Posty: 292
Nick w MP: Adiś.exe

Piwa: 997

Respekt: 110,3
Respekt: 110,3

Kulegg, w evencie "onClientRender" dodajesz PRZED tym jak renderujesz hud ifa z eldat?, czyli


if getElementData(localPlayer"hud"then
--TUTAJ DO ?RODKA DAJESZ KOD W KT?RYM RENDERUJESZ HUD
end


i w skrypcie z panelem logowania albo gdziekolwiek chcesz np. w onClientPlayerJoint dodajesz sobie setElementData(localPlayer, "hud", false) -- *hud znika* b?d? setElementData(localPlayer, "hud", true) -- *hud sie pojawia*

Podpis

KONTAKT:
GG: 60968224
Discord: Adiś.exe#3828

Użytkownik: 05.11.2016
GTAO Member: 20.02.2019
Support-Team: 25.07.2018
Support-Team: 19.01.2019
Test Mod: 08.02.2019

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-26, 16:20


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50

Po zrobieniu tak w tym hudzie, zniknal on z panelu logowania ale tak?e z gry, czyli wog?le nie ma hudu.

Zrobi?em tak w hudzie:

if getElementData(localPlayer"hud"then
addEventHandler("onClientRender"root, function()
    dxDrawImage(sW 0sH 0sW 1sH 1"Hud.png"000tocolor(255255255255), false)
end)


[ Dodano: 2018-08-26, 16:23 ]
Ca?y skrypt hudu:

 --[[        
                @ResourceF-Hud
                @AuthorFlov

                Copyright (cby @Author 2018                
]]--





---------------------------------------------------------------------------------------


local Czcionka dxCreateFont"w.TTF"15 )


local screenWscreenH guiGetScreenSize()
local sxsy guiGetScreenSize()
local sw,sh guiGetScreenSize()
local playerName getPlayerName(localPlayer)
local hajs getPlayerMoney(localPLayer)
local health getElementHealth(localPlayer)


local sWsH guiGetScreenSize()
setElementData(localPlayer"hud"true)


addEventHandler("onClientRender"root, function()
    dxDrawImage(sW 0sH 0sW 1sH 1"Hud.png"000tocolor(255255255255), false)
end)


---------------------------------------------------------------------------------------


addEventHandler("onClientRender",getRootElement(),function()

--"Nazwa"
    dxDrawText("".. playerName, (screenW * -0.8500) + 1, (screenH 1.8450) + 1, (screenW 1) + 1, (screenH 0.0898) + 1tocolor(255255255255), 0.9Czcionka"center""center"falsefalsefalsefalsefalse)

--"Hajs"
    dxDrawText(hajs.." PLN " or "$0000000"screenW 0.4940screenH 1.8460screenW 0.9846screenH 0.0898tocolor(01700255), 0.9Czcionka"center""center"falsefalsefalsefalsefalse)


--"Hp"
    dxDrawRectangle(screenW 0.1625screenH 0.9460screenW 0.1255screenH 0.0400tocolor(8500150))
    dxDrawRectangle(screenW 0.1625screenH 0.9460screenW 0.1255*getElementHealth(localPlayer)/100screenH 0.0400tocolor(15000150)) -- 1
    dxDrawText(health.."%"sW 0.212sH 1.8946sW 1sH 0.040tocolor(255255255255), 0.9Czcionka"left""center"falsefalsefalsefalsefalse)
end)


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


--"Godzina"
function godzina()
local hours getRealTime().hour
local minutes getRealTime().minute
local seconds getRealTime().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

dxDrawText(hours.." : "..minutes.." : "..seconds, (screenW 0.7860) + 1, (screenH 1.8460) + 1, (screenW 0.9846) + 1, (screenH 0.0898) + 1tocolor(255255255255), 0.9Czcionka"center""center"falsefalsefalsefalsefalse)
end

addEventHandler("onClientRender"rootgodzina)


--"Ping"
function ping()
local screenWscreenH guiGetScreenSize()
local ping getPlayerPing(getLocalPlayer())
dxDrawRectangle(screenW 0.9250screenH 0.8780screenW 0.800screenH 0.0450tocolor(000150))
dxDrawText("P i n g:", (screenW 0.9250) + 1, (screenH 1.7200) + 1, (screenW 0.9846) + 1, (screenH 0.0898) + 1tocolor(255255225255), 0.9Czcionka"center""center"falsefalsefalsefalsefalse)
dxDrawText(ping.." ", (screenW 0.9800) + 1, (screenH 1.7200) + 1, (screenW 0.9846) + 1, (screenH 0.0898) + 1tocolor(255255255255), 0.9Czcionka"center""center"falsefalsefalsefalsefalse)
end

addEventHandler("onClientRender"rootping)


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


function usun()
    setPlayerHudComponentVisible("ammo",false)
    setPlayerHudComponentVisible("armour",false)
    setPlayerHudComponentVisible("clock",false)
    setPlayerHudComponentVisible("health",false)
    setPlayerHudComponentVisible("breath",false)
    setPlayerHudComponentVisible("money",false)
    setPlayerHudComponentVisible("weapon",false)
    setPlayerHudComponentVisible("wanted",false)
end
usun()



------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-26, 17:25


NyAngel







Wiek: 22
Na forum: 3950 dni
Posty: 128
Nick w MP: NyAngel

Piwa: 556

Respekt: 86,8


addEventHandler("onClientRender"root, function()
if getElementData(localPlayer"hud"then
    dxDrawImage(sW 0sH 0sW 1sH 1"Hud.png"000tocolor(255255255255), false)
     end
end)


Podpis
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 » Hud 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