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: 4287 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: 4346 dni
Posty: 343
Nick w MP: CrosRoad95

Piwa: 3883

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: 4287 dni
Posty: 27

Piwa: 6

Respekt: 50

Reszta kodu:
BUTTON LALT

GUIEditor = {

    gridlist = {},

    window = {},

    button = {},

    memo = {}

}

addEventHandler("onClientResourceStart"resourceRoot,

    function()

        GUIEditor.window[1] = guiCreateWindow(267123858533"Panel Mechanika"false)

        guiWindowSetSizable(GUIEditor.window[1], false)


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

        GUIEditor.button[1] = guiCreateButton(59413017666"Napraw"falseGUIEditor.window[1])
addEventHandler "onClientGUIClick"GUIEditor.button[1], function()
wykonaj )
endfalse)


        GUIEditor.button[2] = guiCreateButton(5943217666"Zamknij"falseGUIEditor.window[1])
addEventHandler "onClientGUIClick"GUIEditor.button[2], function()
wykonaj )
endfalse)

        GUIEditor.memo[1] = guiCreateMemo(8450274146"Zalogowany jako mechanik:\nNaprawiane auto:\n\n"falseGUIEditor.window[1])
addEventHandler "onClientGUIClick"GUIEditor.button[1], function()
wykonaj )
endfalse)

        GUIEditor.gridlist[1] = guiCreateGridList(66241718236falseGUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "Nazwa"0.5)

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

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


        GUIEditor.button[3] = guiCreateButton(40532146164"Za??? wybran? cz???"falseGUIEditor.window[1])
addEventHandler "onClientGUIClick"GUIEditor.button[3], function()
wykonaj )
endfalse)
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!"255255255 ) return end
interakcja )
end)

bindKey BUTTON"up", function()
interakcja )
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: 4838 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: 4287 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: 4838 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