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: 4330 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(1081251219335"Jedzenie"false)
hd guiCreateButton(10259754"Hot-Dog\nCena:30z?\n+15HP"falseok)
ha guiCreateButton(112259754"Hamburger\nCena: 25z?\n+10HP"falseok)
hdk guiCreateButton(108919954"Hot-Dog+ Ketchup\nCena:35z?\n+20HP"falseok)
hdm guiCreateButton(1015319954"Hot-Dog+ Musztarda\nCena:35z?\n+20HP"falseok)
zam guiCreateButton(1015319954"ZAMKNIJ"falseok)

guiSetVisible(okfalse)
guiSetVisible(hdfalse)
guiSetVisible(hafalse)
guiSetVisible(hdkfalse)
guiSetVisible(hdmfalse)
guiSetVisible(zamfalse)

addEventHandler("onClientMarkerHit",marker,getRootElement,pokazgui)
function pokazgui ()
guiSetVisible(oktrue)
guiSetVisible(hdtrue)
guiSetVisible(hatrue)
guiSetVisible(hdktrue)
guiSetVisible(hdmtrue)
guiSetVisible(zamtrue)
end



Nie pokazuje sie gui

Postaw piwo autorowi tego posta
 

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


#404







Wiek: 26
Na forum: 4772 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: 4330 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: 26
Na forum: 4772 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: 4330 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: 26
Na forum: 4772 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: 4330 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(1081251219335"Jedzenie"false)
hd guiCreateButton(10259754"Hot-Dog\nCena:30z?\n+15HP"falseok)
ha guiCreateButton(112259754"Hamburger\nCena: 25z?\n+10HP"falseok)
hdk guiCreateButton(108919954"Hot-Dog+ Ketchup\nCena:35z?\n+20HP"falseok)
hdm guiCreateButton(1015319954"Hot-Dog+ Musztarda\nCena:35z?\n+20HP"falseok)
zam guiCreateButton(1030019954"ZAMKNIJ"falseok)

guiSetVisible(okfalse)
guiSetVisible(hdfalse)
guiSetVisible(hafalse)
guiSetVisible(hdkfalse)
guiSetVisible(hdmfalse)
guiSetVisible(zamfalse)


function pokazgui (el,md)
if not md or getElementType(el) ~= "player" then return end
    if el == localPlayer then
guiSetVisible(oktrue)
guiSetVisible(hdtrue)
guiSetVisible(hatrue)
guiSetVisible(hdktrue)
guiSetVisible(hdmtrue)
guiSetVisible(zamtrue)
showCursor(true)
end
end
addEventHandler("onClientMarkerHit",marker,pokazgui)

function zamknijgui ()
guiSetVisible(hdfalse)
guiSetVisible(hafalse)
guiSetVisible(hdkfalse)
guiSetVisible(hdmfalse)
guiSetVisible(zamfalse)
guiSetVisible(okfalse)
showCursor(false)
end
addEventHandler("onClientGUIClick",zam,zamknijgui)

function hd (plr)
    
                if getPlayerMoney(plr) < 30 then
                outputChatBox("Nie sta? Ci? na jedzenie!"plr25500)
                outputChatBox("Jedzenie zakupione! Zap?aci?e? $30!"plr2342340)
                takePlayerMoney(plr30)
                setElementHealth(plrgetElementHealth(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: 26
Na forum: 4772 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(1081251219335"Jedzenie"false)
hd guiCreateButton(10259754"Hot-Dog\nCena:30z?\n+15HP"falseok)
ha guiCreateButton(112259754"Hamburger\nCena: 25z?\n+10HP"falseok)
hdk guiCreateButton(108919954"Hot-Dog+ Ketchup\nCena:35z?\n+20HP"falseok)
hdm guiCreateButton(1015319954"Hot-Dog+ Musztarda\nCena:35z?\n+20HP"falseok)
zam guiCreateButton(1030019954"ZAMKNIJ"falseok)

guiSetVisible(okfalse)


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

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

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

function hd (plr)
    
                if getPlayerMoney(plr) < 30 then
                outputChatBox("Nie sta? Ci? na jedzenie!"plr25500)
                outputChatBox("Jedzenie zakupione! Zap?aci?e? $30!"plr2342340)
                takePlayerMoney(plr30)
                setElementHealth(plrgetElementHealth(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: 4330 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: 26
Na forum: 4772 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