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

Wysłany: 2018-07-26, 17:48


Visteros

Mapper






Wiek: 19
Na forum: 3220 dni
Posty: 55
Nick w MP: Visteros

Piwa: 302

Respekt: 160
Respekt: 160Respekt: 160

Tak jak w temacie. Robi? w?asny HUD do serwera. Zrobi?em nazw? gracza oraz ilo?? hajsu. Brakuje mi ilo?? HP oraz Kamizelki. Pomo?e kto??

Podpis
Początkujący Mapper
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-26, 17:54


PatryKK.

Emeryt LUA






Wiek: 26
Na forum: 3060 dni
Posty: 1060
Nick w MP: PatryKK.

Piwa: 2322

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Visteros
Wysłany: 2018-07-26, 18:03


Adaskokieblasko







Wiek: 23
Na forum: 2954 dni
Posty: 101

Piwa: 18

Respekt: 100
Respekt: 100

getElementHealth getPedArmor

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Visteros
Wysłany: 2018-07-26, 18:07


Visteros

Mapper






Wiek: 19
Na forum: 3220 dni
Posty: 55
Nick w MP: Visteros

Piwa: 302

Respekt: 160
Respekt: 160Respekt: 160

Dzi?ki za pomoc. Zimne :piwo: obu wam!

Podpis
Początkujący Mapper
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-26, 18:08


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4699 dni
Posty: 372
Nick w MP: Hades

Piwa: 3214

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8


Więcej informacji znajdziesz w Wikipedii MTA:


getElementHealth



Więcej informacji znajdziesz w Wikipedii MTA:


getPedArmor


Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Visteros
Wysłany: 2018-07-26, 18:34


Visteros

Mapper






Wiek: 19
Na forum: 3220 dni
Posty: 55
Nick w MP: Visteros

Piwa: 302

Respekt: 160
Respekt: 160Respekt: 160

I jak mo?ecie to napiszcie kod na wy??czanie okna.

[ Dodano: 2018-07-26, 18:36 ]
I jeszcze jak zrobi? automatyczne resetowanie HUD co 1s?

Podpis
Początkujący Mapper
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-26, 18:42


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4699 dni
Posty: 372
Nick w MP: Hades

Piwa: 3214

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

Jakie dok?adnie okna?


--s side
setTimer(function()
    restartResource(resourceRoot)
end10000)


Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-26, 20:18


Visteros

Mapper






Wiek: 19
Na forum: 3220 dni
Posty: 55
Nick w MP: Visteros

Piwa: 302

Respekt: 160
Respekt: 160Respekt: 160

Damian2511, mog? poda? ci kod.

local screenWscreenH guiGetScreenSize()
local nick getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x","")
local money getPlayerMoney(localPlayer)
local healtharmor getElementHealth(localPlayer), getPedArmor(localPlayer)



    showPlayerHudComponent("clock"false)
    showPlayerHudComponent("health"false)
    showPlayerHudComponent("money"false)
    showPlayerHudComponent("armour"false)
    showPlayerHudComponent("weapon"false)
    showPlayerHudComponent("ammo"false)
    showPlayerHudComponent("wanted",false)
    showPlayerHudComponent("breath",false)
    
addEventHandler("onClientRender"root,
    function()
        dxDrawLine((screenW 0.7211) - 1, (screenH 0.0586) - 1, (screenW 0.7211) - 1screenH 0.3229tocolor(000255), 1false)
        dxDrawLine(screenW 0.9700, (screenH 0.0586) - 1, (screenW 0.7211) - 1, (screenH 0.0586) - 1tocolor(000255), 1false)
        dxDrawLine((screenW 0.7211) - 1screenH 0.3229screenW 0.9700screenH 0.3229tocolor(000255), 1false)
        dxDrawLine(screenW 0.9700screenH 0.3229screenW 0.9700, (screenH 0.0586) - 1tocolor(000255), 1false)
        dxDrawRectangle(screenW 0.7211screenH 0.0586screenW 0.2489screenH 0.2643tocolor(1912569178), false)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053551263101tocolor(255255255255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""screenW 0.7709screenH 0.0716screenW 0.9246screenH 0.1315tocolor(255255255255), 2.00"pricedown""center""top"falsefalsefalsefalsefalse)
        dxDrawText(""..health.." HP"10031161309170tocolor(2543115255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText(""..armor.." Armor"10031561309196tocolor(38140226255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("$"..money..""10041921309234tocolor(612558255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
    end
)


[ Dodano: 2018-07-26, 20:39 ]


Co zrobic, zeby pokazywalo poprawna ilosc HP oraz Armor bez tych liczb?

Podpis
Początkujący Mapper
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-26, 22:15


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4699 dni
Posty: 372
Nick w MP: Hades

Piwa: 3214

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8

nie u?ywaj showPlayerHudComponent to jest stara funkcja teraz si? u?ywa

Więcej informacji znajdziesz w Wikipedii MTA:


setPlayerHudComponentVisible


co do liczb

        dxDrawText(""..string.format("%01d",health).." HP"10031161309170tocolor(2543115255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText(""..string.format("%01d",armor).." Armor"10031561309196tocolor(38140226255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)


[ Dodano: 2018-07-26, 22:17 ]
A je?li chodzi ci o zamykanie hudu to zr?b tak:

local screenWscreenH guiGetScreenSize()
local nick getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x","")
local money getPlayerMoney(localPlayer)
local healtharmor getElementHealth(localPlayer), getPedArmor(localPlayer)
local hud=true

bindKey("f4""down", function()
if hud == true then
 hud=false
else
 hud=true
end
end)


    showPlayerHudComponent("clock"false)
    showPlayerHudComponent("health"false)
    showPlayerHudComponent("money"false)
    showPlayerHudComponent("armour"false)
    showPlayerHudComponent("weapon"false)
    showPlayerHudComponent("ammo"false)
    showPlayerHudComponent("wanted",false)
    showPlayerHudComponent("breath",false)
    
addEventHandler("onClientRender"root,
    function()
if hud then
        dxDrawLine((screenW 0.7211) - 1, (screenH 0.0586) - 1, (screenW 0.7211) - 1screenH 0.3229tocolor(000255), 1false)
        dxDrawLine(screenW 0.9700, (screenH 0.0586) - 1, (screenW 0.7211) - 1, (screenH 0.0586) - 1tocolor(000255), 1false)
        dxDrawLine((screenW 0.7211) - 1screenH 0.3229screenW 0.9700screenH 0.3229tocolor(000255), 1false)
        dxDrawLine(screenW 0.9700screenH 0.3229screenW 0.9700, (screenH 0.0586) - 1tocolor(000255), 1false)
        dxDrawRectangle(screenW 0.7211screenH 0.0586screenW 0.2489screenH 0.2643tocolor(1912569178), false)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053551263101tocolor(255255255255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""screenW 0.7709screenH 0.0716screenW 0.9246screenH 0.1315tocolor(255255255255), 2.00"pricedown""center""top"falsefalsefalsefalsefalse)
        dxDrawText(""..string.format("%01d",health).." HP"10031161309170tocolor(2543115255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText(""..string.format("%01d",armor).." Armor"10031561309196tocolor(38140226255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("$"..money..""10041921309234tocolor(612558255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
   end
    end
)


Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Visteros
Wysłany: 2018-07-26, 22:51


Visteros

Mapper






Wiek: 19
Na forum: 3220 dni
Posty: 55
Nick w MP: Visteros

Piwa: 302

Respekt: 160
Respekt: 160Respekt: 160

Damian2511, Damian chodzi?o mi o gdy np. dostaniemy kamizelke to odrazu si? pojawia 100 Armor'a

Podpis
Początkujący Mapper
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-07-26, 23:08


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%
"Visteros" napisał/a:

Damian2511, Damian chodzi?o mi o gdy np. dostaniemy kamizelke to odrazu si? pojawia 100 Armor'a



local screenWscreenH guiGetScreenSize()


    showPlayerHudComponent("clock"false)
    showPlayerHudComponent("health"false)
    showPlayerHudComponent("money"false)
    showPlayerHudComponent("armour"false)
    showPlayerHudComponent("weapon"false)
    showPlayerHudComponent("ammo"false)
    showPlayerHudComponent("wanted",false)
    showPlayerHudComponent("breath",false)
    
addEventHandler("onClientRender"root,
    function()

local nick getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x","")
local money getPlayerMoney(localPlayer)
local healtharmor getElementHealth(localPlayer), getPedArmor(localPlayer)

        dxDrawLine((screenW 0.7211) - 1, (screenH 0.0586) - 1, (screenW 0.7211) - 1screenH 0.3229tocolor(000255), 1false)
        dxDrawLine(screenW 0.9700, (screenH 0.0586) - 1, (screenW 0.7211) - 1, (screenH 0.0586) - 1tocolor(000255), 1false)
        dxDrawLine((screenW 0.7211) - 1screenH 0.3229screenW 0.9700screenH 0.3229tocolor(000255), 1false)
        dxDrawLine(screenW 0.9700screenH 0.3229screenW 0.9700, (screenH 0.0586) - 1tocolor(000255), 1false)
        dxDrawRectangle(screenW 0.7211screenH 0.0586screenW 0.2489screenH 0.2643tocolor(1912569178), false)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053 155 11263 1101 1tocolor(000255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""1053551263101tocolor(255255255255), 2.00"pricedown""center""top"truefalsetruefalsefalse)
        dxDrawText(""..nick..""screenW 0.7709screenH 0.0716screenW 0.9246screenH 0.1315tocolor(255255255255), 2.00"pricedown""center""top"falsefalsefalsefalsefalse)
        dxDrawText(""..health.." HP"10031161309170tocolor(2543115255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText(""..armor.." Armor"10031561309196tocolor(38140226255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("$"..money..""10041921309234tocolor(612558255), 2.50"default-bold""center""top"falsefalsefalsefalsefalse)
    end
)


do rendera zawsze dawaj

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Visteros
Wysłany: 2018-07-27, 14:51


FrosteR

Grafik






Wiek: 25
Na forum: 4029 dni
Posty: 355
Nick w MP: FrosteR

Piwa: 488

Respekt: 571
Respekt: 571

Z innymi problemami napisz w innym temacie, poniewa? nazwa tematu wci?? prezentuje pomoc z pierwszym skryptem.

Postaw piwo autorowi tego posta
 

 
Tagi: jak :: zdobyć :: ilość :: życia :: oraz :: ilość :: kamizelki :: gracza?
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Jak zdobyć ilość życia oraz ilość kamizelki u gracza? 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