Wysłany: 2015-11-12, 17:26
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
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
Wysłany: 2015-11-12, 17:36
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
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?...
Wysłany: 2015-11-12, 17:41
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
Wysłany: 2015-11-12, 17:59
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
Po czym? takim to nie wierz?, ?e nie ma db3...
addEventHandler ( "onClientMarkerHit" , marker , getRootElement , pokazgui )
Zdecyduj si?, marker czy root.
Wysłany: 2015-11-12, 18:12
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
usunelem marker i tera wywala ze nie ma argumentu 3
Wysłany: 2015-11-12, 18:31
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
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.
Wysłany: 2015-11-12, 18:43
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
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
Wysłany: 2015-11-12, 20:06
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
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 )
Wysłany: 2015-11-12, 20:25
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
Ok ale jak klikne hoddog to nic sie nie dzieje
[ Dodano : 2015-11-12, 20:26 ]
39 linijka bad argument 3
Wysłany: 2015-11-12, 21:23
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
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
Tagi: marker :: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: