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

Wysłany: 2015-06-17, 22:40


Dryfter







Wiek: 36
Na forum: 4428 dni
Posty: 27

Piwa: 6

Respekt: 50

Siema. Tworzy?em sobie skrypt, panel mechanika i w Gui Editorze idzie mi ca?kiem ok ale mam problem ze zrobieniem Gird list'y. Nie wiem jak wrzuci? do niej np. ko?a. A druga sprawa to taka ?e w??czy?em sobie ten gui kt?ry zrobi?em ?eby sprawdzi? czy jest ok i w db3 wyskakuje mi takie co?:
ERROR:[DN]menuauta/c.lua:86: attempt to index fiel "girdlist" (a nil value)
ERROR:[DN]menuauta/c.lua:94: attempt to index fiel "girdlist" (a nil value)
Domy?lam si? ?e chodzi o jak?? warto?? z linijki 86 i 94. Ta cz??? kodu wygl?da tak:
function interakcja ( type )
if not type or type == nil then return end
type = tonumber(type)
if type == 1 then
for i,v in ipairs ( GUIEditor.button ) do
guiSetVisible ( GUIEditor.button[i], true )
guiSetVisible ( GUIEditor.window[1], true )
guiSetVisible ( GUIEditor.memo[1], true )
guiSetVisible ( GUIEditor.girdlist[1], true ) <---linijka 86
showCursor ( true )
end
elseif type == 2 then
for i,v in ipairs ( GUIEditor.button ) do
guiSetVisible ( GUIEditor.button[i], false )
guiSetVisible ( GUIEditor.window[1], false )
guiSetVisible ( GUIEditor.memo[1], false )
guiSetVisible ( GUIEditor.girdlist[1], false ) <---linijka 94
showCursor ( false )
end
end
end


PS:Wspomagam si? troche innymi skryptami wi?c prosz? nie m?wi? ?e co? kopiuje od innych.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Bartek123456
Wysłany: 2015-06-17, 23:39


PolskiSebek12

Programista






Wiek: 28
Na forum: 4488 dni
Posty: 343
Nick w MP: CrosRoad95

Piwa: 3887

Respekt: 288,8
Respekt: 288,8Respekt: 288,8Respekt: 288,8

Ostrzeżeń: 100%
"Ta cz??? kodu wygl?da tak:"
ten kawa?ek kodu jest dobry i tyle ci moge powiedziec, musisz da? ca?y skrypt abym m?g? ci pom?c

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-18, 09:23


Dryfter







Wiek: 36
Na forum: 4428 dni
Posty: 27

Piwa: 6

Respekt: 50

Reszta kodu:
BUTTON = LALT

GUIEditor = {

    gridlist = {},

    window = {},

    button = {},

    memo = {}

}

addEventHandler("onClientResourceStart", resourceRoot,

    function()

        GUIEditor.window[1] = guiCreateWindow(267, 123, 858, 533, "Panel Mechanika", false)

        guiWindowSetSizable(GUIEditor.window[1], false)


addEventHandler ( "onClientGUIClick", GUIEditor.window[1], function()
wykonaj ( 1 )
end, false)

        GUIEditor.button[1] = guiCreateButton(594, 130, 176, 66, "Napraw", false, GUIEditor.window[1])
addEventHandler ( "onClientGUIClick", GUIEditor.button[1], function()
wykonaj ( 1 )
end, false)


        GUIEditor.button[2] = guiCreateButton(594, 32, 176, 66, "Zamknij", false, GUIEditor.window[1])
addEventHandler ( "onClientGUIClick", GUIEditor.button[2], function()
wykonaj ( 2 )
end, false)

        GUIEditor.memo[1] = guiCreateMemo(84, 50, 274, 146, "Zalogowany jako mechanik:\nNaprawiane auto:\n\n", false, GUIEditor.window[1])
addEventHandler ( "onClientGUIClick", GUIEditor.button[1], function()
wykonaj ( 1 )
end, false)

        GUIEditor.gridlist[1] = guiCreateGridList(66, 241, 718, 236, false, GUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "Nazwa", 0.5)

        guiGridListAddColumn(GUIEditor.gridlist[1], "Cena", 0.5)

addEventHandler ( "onClientGUIClick", GUIEditor.button[1], function()
wykonaj ( 1 )
end, false)


        GUIEditor.button[3] = guiCreateButton(405, 32, 146, 164, "Za??? wybran? cz???", false, GUIEditor.window[1])
addEventHandler ( "onClientGUIClick", GUIEditor.button[3], function()
wykonaj ( 3 )
end, false)
for i,v in ipairs ( GUIEditor.button ) do
guiSetVisible ( GUIEditor.button[i], false )
end
end)


bindKey ( BUTTON, "down", function()
auto = getPedOccupiedVehicle ( getLocalPlayer() )
if not auto or not getVehicleController ( auto ) then
outputChatBox ( "*Nie jeste? pracownikiem warztatu!", 255, 255, 255 ) return end
interakcja ( 1 )
end)

bindKey ( BUTTON, "up", function()
interakcja ( 2 )
end)


function interakcja ( type )
if not type or type == nil then return end
type = tonumber(type)
if type == 1 then
for i,v in ipairs ( GUIEditor.button ) do
guiSetVisible ( GUIEditor.button[i], true )
guiSetVisible ( GUIEditor.window[1], true )
guiSetVisible ( GUIEditor.memo[1], true )
guiSetVisible ( GUIEditor.girdlist[1], state )
showCursor ( true )
end
elseif type == 2 then
for i,v in ipairs ( GUIEditor.button ) do
guiSetVisible ( GUIEditor.button[i], false )
guiSetVisible ( GUIEditor.window[1], false )
guiSetVisible ( GUIEditor.memo[1], false )
guiSetVisible ( GUIEditor.girdlist[1], false )
showCursor ( false )
end
end
end


function wykonaj ( number )
if not number or number == nil then return end
number = tonumber(number)
if number == 1 then
triggerServerEvent ( "GUIEditor.button[1]", getLocalPlayer() )
elseif number == 2 then
triggerServerEvent ( "GUIEditor.button[2]", getLocalPlayer() )
elseif number == 3 then
triggerServerEvent ( "GUIEditor.button[3]", getLocalPlayer() )
elseif number == 4 then
triggerServerEvent ( "GUIEditor.girdlist[1]", getLocalPlayer() )

end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-18, 18:17


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Bo Ty masz stworzon? gridlist? a nie girdlist? ... Popraw to i daj zna?

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-18, 21:39


Dryfter







Wiek: 36
Na forum: 4428 dni
Posty: 27

Piwa: 6

Respekt: 50

Wielkie dzi?ki;) Teraz dzia?a. Ale chcia?bym jeszcze ponowi? drugie pytanie. Jak wrzuci? do gridlisty np. ko?a?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-18, 21:43


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Tworzysz sobie jakie? osobne przedzia?ki w tej gridli?cie, po czym nazywasz je tak jak ko?a nosz? nazw? a potem musisz z tabeli pobiera? czy to co klikasz czyli np.

Ahab == ID_ahabow

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

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