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

Wysłany: 2015-11-12, 17:26


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4471 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

marker = createMarker(-2033.24,471.15,34.50,"cylinder",1.0,0,245,234,255)

ok = guiCreateWindow(1081, 251, 219, 335, "Jedzenie", false)
hd = guiCreateButton(10, 25, 97, 54, "Hot-Dog\nCena:30z?\n+15HP", false, ok)
ha = guiCreateButton(112, 25, 97, 54, "Hamburger\nCena: 25z?\n+10HP", false, ok)
hdk = guiCreateButton(10, 89, 199, 54, "Hot-Dog+ Ketchup\nCena:35z?\n+20HP", false, ok)
hdm = guiCreateButton(10, 153, 199, 54, "Hot-Dog+ Musztarda\nCena:35z?\n+20HP", false, ok)
zam = guiCreateButton(10, 153, 199, 54, "ZAMKNIJ", false, ok)

guiSetVisible(ok, false)
guiSetVisible(hd, false)
guiSetVisible(ha, false)
guiSetVisible(hdk, false)
guiSetVisible(hdm, false)
guiSetVisible(zam, false)

addEventHandler("onClientMarkerHit",marker,getRootElement,pokazgui)
function pokazgui ()
guiSetVisible(ok, true)
guiSetVisible(hd, true)
guiSetVisible(ha, true)
guiSetVisible(hdk, true)
guiSetVisible(hdm, true)
guiSetVisible(zam, true)
end



Nie pokazuje sie gui

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-12, 17:36


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
BlackTen, magiczna kula od wr??a Macieja...

Mo?e zobacz sobie do db3 z czym Ci wyskakuje problem ? Gdyby? to zrobi? jestem przekonany, ?e znacznie szybciej otrzyma?by? swoj? odpowied?, a by? mo?e nawet sam by? to naprawi?...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-12, 17:41


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4471 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Nie ma db3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-12, 17:59


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Po czym? takim to nie wierz?, ?e nie ma db3...

addEventHandler("onClientMarkerHit",marker,getRootElement,pokazgui)


Zdecyduj si?, marker czy root.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-12, 18:12


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4471 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

usunelem marker i tera wywala ze nie ma argumentu 3 :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-12, 18:31


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
BlackTen, zapewne da?e? to tak:


addEventHandler("onClientMarkerHit",getRootElement,pokazgui)


Rozczaruj? Cie i ode?l? na wiki, aby? sprawdzi? jak si? w takiej formie pobiera root'a
https://wiki.multitheftauto.com/wiki/Root#Tree_elements

Dalej - funkcja musi by? przed eventem - no chyba ?e dasz j? w takiej formie:


addEventHandler("event", element, function()

end
)


Druga sprawa, je?eli przyciski, edity, labele i inne s? przyczepione do okna wystarczy pokaza?/ukry? jedynie okno.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-12, 18:43


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4471 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Dzieki dziala masz pifko, ale nie zamykaj

[ Dodano: 2015-11-12, 18:53 ]
no i tera mam takie cos :
marker = createMarker(-2033.24,471.15,34.50,"cylinder",1.0,0,245,234,255)

ok = guiCreateWindow(1081, 251, 219, 335, "Jedzenie", false)
hd = guiCreateButton(10, 25, 97, 54, "Hot-Dog\nCena:30z?\n+15HP", false, ok)
ha = guiCreateButton(112, 25, 97, 54, "Hamburger\nCena: 25z?\n+10HP", false, ok)
hdk = guiCreateButton(10, 89, 199, 54, "Hot-Dog+ Ketchup\nCena:35z?\n+20HP", false, ok)
hdm = guiCreateButton(10, 153, 199, 54, "Hot-Dog+ Musztarda\nCena:35z?\n+20HP", false, ok)
zam = guiCreateButton(10, 300, 199, 54, "ZAMKNIJ", false, ok)

guiSetVisible(ok, false)
guiSetVisible(hd, false)
guiSetVisible(ha, false)
guiSetVisible(hdk, false)
guiSetVisible(hdm, false)
guiSetVisible(zam, false)


function pokazgui (el,md)
if not md or getElementType(el) ~= "player" then return end
    if el == localPlayer then
guiSetVisible(ok, true)
guiSetVisible(hd, true)
guiSetVisible(ha, true)
guiSetVisible(hdk, true)
guiSetVisible(hdm, true)
guiSetVisible(zam, true)
showCursor(true)
end
end
addEventHandler("onClientMarkerHit",marker,pokazgui)

function zamknijgui ()
guiSetVisible(hd, false)
guiSetVisible(ha, false)
guiSetVisible(hdk, false)
guiSetVisible(hdm, false)
guiSetVisible(zam, false)
guiSetVisible(ok, false)
showCursor(false)
end
addEventHandler("onClientGUIClick",zam,zamknijgui)

function hd (plr)
    
                if getPlayerMoney(plr) < 30 then
                outputChatBox("Nie sta? Ci? na jedzenie!", plr, 255, 0, 0)
                outputChatBox("Jedzenie zakupione! Zap?aci?e? $30!", plr, 234, 234, 0)
                takePlayerMoney(plr, 30)
                setElementHealth(plr, getElementHealth(plr) + 15)
                
        end
    end
addEventHandler("onClientGUIClick",hd,zamknijgui)



I takie db : 33, 22 linijka cos z guisetvisible

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-12, 20:06


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Ehh ju? pisa?em Ci to xD


marker = createMarker(-2033.24,471.15,34.50,"cylinder",1.0,0,245,234,255)

ok = guiCreateWindow(1081, 251, 219, 335, "Jedzenie", false)
hd = guiCreateButton(10, 25, 97, 54, "Hot-Dog\nCena:30z?\n+15HP", false, ok)
ha = guiCreateButton(112, 25, 97, 54, "Hamburger\nCena: 25z?\n+10HP", false, ok)
hdk = guiCreateButton(10, 89, 199, 54, "Hot-Dog+ Ketchup\nCena:35z?\n+20HP", false, ok)
hdm = guiCreateButton(10, 153, 199, 54, "Hot-Dog+ Musztarda\nCena:35z?\n+20HP", false, ok)
zam = guiCreateButton(10, 300, 199, 54, "ZAMKNIJ", false, ok)

guiSetVisible(ok, false)


function pokazgui (el,md)
if not md or getElementType(el) ~= "player" then return end
    if el == localPlayer then
guiSetVisible(ok, true)

showCursor(true)
end
end
addEventHandler("onClientMarkerHit",marker,pokazgui)

function zamknijgui ()
guiSetVisible(ok, false)
showCursor(false)
end
addEventHandler("onClientGUIClick",zam,zamknijgui)

function hd (plr)
    
                if getPlayerMoney(plr) < 30 then
                outputChatBox("Nie sta? Ci? na jedzenie!", plr, 255, 0, 0)
                outputChatBox("Jedzenie zakupione! Zap?aci?e? $30!", plr, 234, 234, 0)
                takePlayerMoney(plr, 30)
                setElementHealth(plr, getElementHealth(plr) + 15)
                
        end
    end
addEventHandler("onClientGUIClick",hd,zamknijgui)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-12, 20:25


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4471 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Ok ale jak klikne hoddog to nic sie nie dzieje :(

[ Dodano: 2015-11-12, 20:26 ]
39 linijka bad argument 3 :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-12, 21:23


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
BlackTen, ci??ko aby Ci to dzia?a?o skoro w stronie client'a u?ywasz funkcji z serwer'a... A przynajmniej z takimi argumentami...

PS: Sprawd? sobie co zwraca ten event, to te? masz ?le


Więcej informacji znajdziesz w Wikipedii MTA:

onClientGUIClick


Postaw piwo autorowi tego posta
 

 
Tagi: marker :: 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 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