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: 20
Na forum: 3361 dni
Posty: 55
Nick w MP: Visteros

Piwa: 304

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: 27
Na forum: 3202 dni
Posty: 1059
Nick w MP: PatryKK.

Piwa: 2331

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: 3095 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: 20
Na forum: 3361 dni
Posty: 55
Nick w MP: Visteros

Piwa: 304

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: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

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: 20
Na forum: 3361 dni
Posty: 55
Nick w MP: Visteros

Piwa: 304

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: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

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

Jakie dok?adnie okna?


--s side
setTimer(function()
    restartResource(resourceRoot)
end, 1000, 0)


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: 20
Na forum: 3361 dni
Posty: 55
Nick w MP: Visteros

Piwa: 304

Respekt: 160
Respekt: 160Respekt: 160

Damian2511, mog? poda? ci kod.

local screenW, screenH = guiGetScreenSize()
local nick = getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x","")
local money = getPlayerMoney(localPlayer)
local health, armor = 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) - 1, screenH * 0.3229, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.9700, (screenH * 0.0586) - 1, (screenW * 0.7211) - 1, (screenH * 0.0586) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.7211) - 1, screenH * 0.3229, screenW * 0.9700, screenH * 0.3229, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.9700, screenH * 0.3229, screenW * 0.9700, (screenH * 0.0586) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.7211, screenH * 0.0586, screenW * 0.2489, screenH * 0.2643, tocolor(19, 125, 69, 178), false)
        dxDrawText(""..nick.."", 1053 - 1, 55 - 1, 1263 - 1, 101 - 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053 + 1, 55 - 1, 1263 + 1, 101 - 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053 - 1, 55 + 1, 1263 - 1, 101 + 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053 + 1, 55 + 1, 1263 + 1, 101 + 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053, 55, 1263, 101, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", screenW * 0.7709, screenH * 0.0716, screenW * 0.9246, screenH * 0.1315, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "top", false, false, false, false, false)
        dxDrawText(""..health.." HP", 1003, 116, 1309, 170, tocolor(254, 31, 15, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText(""..armor.." Armor", 1003, 156, 1309, 196, tocolor(38, 140, 226, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText("$"..money.."", 1004, 192, 1309, 234, tocolor(61, 255, 8, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
    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: 4840 dni
Posty: 372
Nick w MP: Hades

Piwa: 3218

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", 1003, 116, 1309, 170, tocolor(254, 31, 15, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText(""..string.format("%01d",armor).." Armor", 1003, 156, 1309, 196, tocolor(38, 140, 226, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)


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

local screenW, screenH = guiGetScreenSize()
local nick = getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x","")
local money = getPlayerMoney(localPlayer)
local health, armor = 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) - 1, screenH * 0.3229, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.9700, (screenH * 0.0586) - 1, (screenW * 0.7211) - 1, (screenH * 0.0586) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.7211) - 1, screenH * 0.3229, screenW * 0.9700, screenH * 0.3229, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.9700, screenH * 0.3229, screenW * 0.9700, (screenH * 0.0586) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.7211, screenH * 0.0586, screenW * 0.2489, screenH * 0.2643, tocolor(19, 125, 69, 178), false)
        dxDrawText(""..nick.."", 1053 - 1, 55 - 1, 1263 - 1, 101 - 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053 + 1, 55 - 1, 1263 + 1, 101 - 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053 - 1, 55 + 1, 1263 - 1, 101 + 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053 + 1, 55 + 1, 1263 + 1, 101 + 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053, 55, 1263, 101, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", screenW * 0.7709, screenH * 0.0716, screenW * 0.9246, screenH * 0.1315, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "top", false, false, false, false, false)
        dxDrawText(""..string.format("%01d",health).." HP", 1003, 116, 1309, 170, tocolor(254, 31, 15, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText(""..string.format("%01d",armor).." Armor", 1003, 156, 1309, 196, tocolor(38, 140, 226, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText("$"..money.."", 1004, 192, 1309, 234, tocolor(61, 255, 8, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
   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: 20
Na forum: 3361 dni
Posty: 55
Nick w MP: Visteros

Piwa: 304

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: 22
Na forum: 3188 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 screenW, screenH = 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 health, armor = getElementHealth(localPlayer), getPedArmor(localPlayer)

        dxDrawLine((screenW * 0.7211) - 1, (screenH * 0.0586) - 1, (screenW * 0.7211) - 1, screenH * 0.3229, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.9700, (screenH * 0.0586) - 1, (screenW * 0.7211) - 1, (screenH * 0.0586) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.7211) - 1, screenH * 0.3229, screenW * 0.9700, screenH * 0.3229, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.9700, screenH * 0.3229, screenW * 0.9700, (screenH * 0.0586) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.7211, screenH * 0.0586, screenW * 0.2489, screenH * 0.2643, tocolor(19, 125, 69, 178), false)
        dxDrawText(""..nick.."", 1053 - 1, 55 - 1, 1263 - 1, 101 - 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053 + 1, 55 - 1, 1263 + 1, 101 - 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053 - 1, 55 + 1, 1263 - 1, 101 + 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053 + 1, 55 + 1, 1263 + 1, 101 + 1, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", 1053, 55, 1263, 101, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "top", true, false, true, false, false)
        dxDrawText(""..nick.."", screenW * 0.7709, screenH * 0.0716, screenW * 0.9246, screenH * 0.1315, tocolor(255, 255, 255, 255), 2.00, "pricedown", "center", "top", false, false, false, false, false)
        dxDrawText(""..health.." HP", 1003, 116, 1309, 170, tocolor(254, 31, 15, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText(""..armor.." Armor", 1003, 156, 1309, 196, tocolor(38, 140, 226, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
        dxDrawText("$"..money.."", 1004, 192, 1309, 234, tocolor(61, 255, 8, 255), 2.50, "default-bold", "center", "top", false, false, false, false, false)
    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: 26
Na forum: 4171 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