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

Wysłany: 2018-02-08, 17:37


Kuksss

guwno






Wiek: 22
Na forum: 3781 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
Siema, mam problem ze zrobieniem gui aktualnej broni.
Chodzi o to, ?e pojawia mi si? pi???, ale po zmianie broni nic si? nie zmienia - dalej ona jest.
Z g?ry dzi?ki, za pomoc stawiam piwo.
Kod:
setPlayerHudComponentVisible("ammo"false)
setPlayerHudComponentVisible("armour"false)
setPlayerHudComponentVisible("clock",  false)
setPlayerHudComponentVisible("health"false)
setPlayerHudComponentVisible("money"false)
setPlayerHudComponentVisible("vehicle_name"false)
setPlayerHudComponentVisible("weapon"false)

bindKey("f11""down", function()
    if map == true then
        map false
        setElementData(localPlayer"hud:enabled"true)
        showChat(true)
        showPlayerHudComponent("all"false)
        showPlayerHudComponent("radar"true)
        showPlayerHudComponent("crosshair"true)
    else
        map true
        setElementData(localPlayer"hud:enabled"false)
        showChat(false)
        showPlayerHudComponent("all"false)
    end
end)

local czciona dxCreateFont("font.ttf"20)

local weapon getPedWeapon(localPlayer)
local screenWscreenH guiGetScreenSize()
local sx,sy guiGetScreenSize() -- pobieramy rozdzielczo?? gracza kt?ry widzi gui
local px,py = (sx/1366),(sy/768) -- dzielimy rozdzielczo?? gracza kt?ry widzi gui przez rozdzielczo?? na kt?rej by?o robione gui.
local patch "hud/"..weapon..".png"

addEventHandler("onClientRender"root,
    function()
    if getElementData(localPlayer"hud:enabled")  == false then return end
    --[[
        dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000":mr-hud/hud.png"000tocolor(255255255255), false)
        dxDrawText(getPlayerMoney(localPlayer), screenW 0.03screenH 0.9676screenW 0.1031screenH 0.9944tocolor(255255255255), 0.80czciona"left""top"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%.0f"getElementHealth(localPlayer)), screenW 0.1411screenH 0.9657screenW 0.1922screenH 0.9944tocolor(255255255255), 1.00czciona"left""top"falsefalsefalsefalsefalse)
        dxDrawText(getElementData(localPlayer"player:reputation"), screenW 0.2099screenH 0.9639screenW 0.2865screenH 0.9907tocolor(255255255255), 1.00czciona"left""top"falsefalsefalsefalsefalse)
    --]]
        dxDrawImage(0*px0*py1366*px768*py":MR-hud/hud.png"000tocolor(255255255255), false)
        dxDrawText(getPlayerMoney(localPlayer), 42*px743*py127*px758*pytocolor(255255255255), 0.6*pxczciona"left""top"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%.0f"getElementHealth(localPlayer)), 200*px742*py232*px758*pytocolor(255255255255), 0.6*pxczciona"left""top"falsefalsefalsefalsefalse)
        dxDrawText(getElementData(localPlayer"player:reputation"), 291*px742*py358*px758*pytocolor(255255255255), 0.6*pxczciona"left""top"falsefalsefalsefalsefalse)
                if fileExists(patchthen
            dxDrawImage(1278*px668*py78*px65*pypatch000tocolor(255255255255), false)
        end
    end
)


Podpis
c***
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-08, 17:55


NyAngel







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

Piwa: 556

Respekt: 86,8

setPlayerHudComponentVisible("ammo"false)
setPlayerHudComponentVisible("armour"false)
setPlayerHudComponentVisible("clock",  false)
setPlayerHudComponentVisible("health"false)
setPlayerHudComponentVisible("money"false)
setPlayerHudComponentVisible("vehicle_name"false)
setPlayerHudComponentVisible("weapon"false)

bindKey("f11""down", function()
    if map == true then
        map false
        setElementData(localPlayer"hud:enabled"true)
        showChat(true)
        showPlayerHudComponent("all"false)
        showPlayerHudComponent("radar"true)
        showPlayerHudComponent("crosshair"true)
    else
        map true
        setElementData(localPlayer"hud:enabled"false)
        showChat(false)
        showPlayerHudComponent("all"false)
    end
end)

local czciona dxCreateFont("font.ttf"20)

local screenWscreenH guiGetScreenSize()
local sx,sy guiGetScreenSize() -- pobieramy rozdzielczo?? gracza kt?ry widzi gui
local px,py = (sx/1366),(sy/768) -- dzielimy rozdzielczo?? gracza kt?ry widzi gui przez rozdzielczo?? na kt?rej by?o robione gui.

addEventHandler("onClientRender"root,
    function()
    if getElementData(localPlayer"hud:enabled")  == false then return end
    --[[
        dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000":mr-hud/hud.png"000tocolor(255255255255), false)
        dxDrawText(getPlayerMoney(localPlayer), screenW 0.03screenH 0.9676screenW 0.1031screenH 0.9944tocolor(255255255255), 0.80czciona"left""top"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%.0f"getElementHealth(localPlayer)), screenW 0.1411screenH 0.9657screenW 0.1922screenH 0.9944tocolor(255255255255), 1.00czciona"left""top"falsefalsefalsefalsefalse)
        dxDrawText(getElementData(localPlayer"player:reputation"), screenW 0.2099screenH 0.9639screenW 0.2865screenH 0.9907tocolor(255255255255), 1.00czciona"left""top"falsefalsefalsefalsefalse)
    --]]
        dxDrawImage(0*px0*py1366*px768*py":MR-hud/hud.png"000tocolor(255255255255), false)
        dxDrawText(getPlayerMoney(localPlayer), 42*px743*py127*px758*pytocolor(255255255255), 0.6*pxczciona"left""top"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%.0f"getElementHealth(localPlayer)), 200*px742*py232*px758*pytocolor(255255255255), 0.6*pxczciona"left""top"falsefalsefalsefalsefalse)
        dxDrawText(getElementData(localPlayer"player:reputation"), 291*px742*py358*px758*pytocolor(255255255255), 0.6*pxczciona"left""top"falsefalsefalsefalsefalse)
        dxDrawImage(1278*px668*py78*px65*py"hud/"..tostring(getPedWeapon(localPlayer)).. ".png"000tocolor(255255255255), false)
        end
    end
)


Podpis
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Kuksss
Wysłany: 2018-02-08, 18:15


Kuksss

guwno






Wiek: 22
Na forum: 3781 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
NyAngel, Niestety, ale to nie dzia?a :(

Podpis
c***
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-08, 18:20


NyAngel







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

Piwa: 556

Respekt: 86,8

Jaki? b??d? i jak masz to wrzucone te png.

chodzi mi czy jest to zrobione tak : FOLEDER>FOLDER 2 > png czy
FOLDER > PLIKI

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-08, 18:28


Kuksss

guwno






Wiek: 22
Na forum: 3781 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
NyAngel, B??d?w nie ma, wszucone mam to tak:
MR-HUD(folder ze skryptami)>hud(i tutaj wszystkie png)

Podpis
c***
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-08, 18:30


NyAngel







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

Piwa: 556

Respekt: 86,8

Specjalnie dla ciebie sprawdzi?em to i u mnie dzia?a kod ten co ja Ci poda?em.(wrzucilem jakie? grafiki i dzia?a,zrobi?em tak samo jaki da?em tobie kod)


local sx,sy guiGetScreenSize() 
local px,py = (sx/1366),(sy/768)

addEventHandler("onClientRender",root,function()
    dxDrawImage(1278*px668*py78*px65*py"hud/"..tostring(getPedWeapon(localPlayer)).. ".png"000tocolor(255255255255), false)    
end)



Podpis
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Kuksss
Wysłany: 2018-02-08, 18:35


Kuksss

guwno






Wiek: 22
Na forum: 3781 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
NyAngel, O ja pier.. ale ze mnie debil, nie usun??em endu z if'a xd
Dobra, masz piwo i dzi?ki za pomoc :)

Podpis
c***
Postaw piwo autorowi tego posta
 

 
Tagi: zmiana :: broni :: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Zmiana broni w GUI 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