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

Wysłany: 2020-07-28, 12:21


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Witam. Mam problem dotycz?cy gui, chcia?em dorobi? Ulepszenia Silnika do tune, wszystko pi?knie dzia?a tylko w gui nie zmienia si? informacja o tune lub demonta?u

jedyne jak usunie si? not z tej linijki:

if not MK1 then

W gui zmienia sie na tuning


local naped=false;
            local naped_demont false;
            for i,v in ipairs(ulepszenia_pojazdow) do                
                if v[i].name == "MK1" then
                    local MK1 veh1:getData("vehicle:mk1")
                    local a=guiGridListAddRow(GUIEditor.gridlist[1])        
                    if not MK1 then
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"tuning"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    else
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"demtuning - 50%"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost/2), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    end
                elseif v[i].name == "MK2" then
                    local MK2 veh1:getData("vehicle:mk2")
                    local a=guiGridListAddRow(GUIEditor.gridlist[1])        
                    if not MK2 then
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"tuning"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    else
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"demtuning - 50%"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost/2), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    end    
                elseif v[i].name == "MK3" then
                    local MK3 veh1:getData("vehicle:mk3")
                    local a=guiGridListAddRow(GUIEditor.gridlist[1])        
                    if not MK3 then
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"tuning"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    else
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"demtuning - 50%"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost/2), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    end    
                elseif v[i].name == "MK4" then
                    local MK4 veh1:getData("vehicle:mk4")
                    local a=guiGridListAddRow(GUIEditor.gridlist[1])        
                    if not MK4 then
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"tuning"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    else
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"demtuning - 50%"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost/2), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    end    


Podpis


Modern Stories
Discord
https://discord.gg/MRJSYq8
Forum
https://msmta.pl
Panel Gracza
https://panel.msmta.pl
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 16:19


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Opisz dok?adniej problem, bo nie rozumiem troch?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 16:23


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

No to musisz od?wie?y? dane, wykonaj funkcj? tworz?c? i dodaj?c? opcje demonta?u i monta?u ponownie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 19:54


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
"Shuffle" napisał/a:

Opisz dok?adniej problem, bo nie rozumiem troch?


Je?li pojazd ma Mk2 to powinno wy?wietla? sie Demont, je?li pojazd nie ma Mk2 powinno si? wy?wietla? Tuning, a wy?wietla si? tylko demont nawet je?li nie masz Mk2

[ Dodano: 2020-07-28, 19:54 ]
"Wilq" napisał/a:

No to musisz od?wie?y? dane, wykonaj funkcj? tworz?c? i dodaj?c? opcje demonta?u i monta?u ponownie.


Mo?e jaki? przyk?ad? :D

Podpis


Modern Stories
Discord
https://discord.gg/MRJSYq8
Forum
https://msmta.pl
Panel Gracza
https://panel.msmta.pl
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 20:21


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

?adnej filizofii

if getElementData(element,"mk2"then
    guiSetText(element,"DEMONTA?")
else
    guiSetText(element,"TUNING")
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 20:42


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Jest tak ale nie dzia?a
local MK1 veh1:getData("vehicle:mk1")
                    local a=guiGridListAddRow(GUIEditor.gridlist[1])        
                    if not MK1 then
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"tuning"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    else
                        guiGridListSetItemText(GUIEditor.gridlist[1], a1tostring(v[i].name), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a2"Addon"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a3"demtuning - 50%"falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a4tostring(v[i].cost/2), falsefalse)
                        guiGridListSetItemText(GUIEditor.gridlist[1], a5tostring(v[i].desc), falsefalse)
                    end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 20:59


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Ca?y czas pokazuje tuning tak?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 21:01


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Demonta?

[ Dodano: 2020-07-28, 21:01 ]
demtuning - 50% *

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 21:44


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Prawid?owo zmienna "veh1" jest wczesniej w kodzie zdefiniowana, pokaz ten u?amek kodu gdzie jest ta zmienna

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 21:52


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
addEvent("pokazPanelTuningu"true)
addEventHandler("pokazPanelTuningu"localPlayer, function(veh)
    if not veh or not isElement(veh) or getElementType(veh) ~= "vehicle" then
        outputChatBox("* Brak pojazdu!"25500);
        return
    end
    if getVehicleController(veh) == false then
        outputChatBox("* Brak kierowcy!"25500);
        return
    end
    if getVehicleController(veh):getData("offerta:tuning"then
        outputChatBox("* Kierowca aktualnie ma wy?wietlon? ofert?!"25500);
        return
    end
    if not veh:getData('vehicle:id'then 
        outputChatBox("* Ten pojazd nie jest prywatny!"25500);
        return 
    end
    if veh:getData("vehicle:ownedPlayer") ~= getVehicleController(veh):getData("player:sid"then
        outputChatBox("* Ten pojazd nie nale?y do tego kierowcy!"25500)
        return
    end
    if not isElement(GUIEditor.window[1]) then
        if getElementData(veh"vehicle:spawn"then
            showCursor(true)
            veh1 veh
            setElementData(localPlayer"tune:car"veh)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 22:30


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Aby od?wie?y? wykonujesz po prostu jeszcze raz t? sam? funkcj?.

function main()
     main()
end
main()


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 23:47


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Dobra jak to zaimplementowa? do skryptu ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-28, 23:49


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Normalnie, wykonujesz ca?a funkcj? (guiGridListAddRow) oraz ustawianie tym rekordom tekstu jeszcze raz. Co to za filozofia, gotowy przyk?ad masz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-07-29, 21:16


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Filozofia, jak to wklei? do skryptu? Nie rozumiem zabardzo.

[ Dodano: 2020-07-30, 11:28 ]
Nikt nie zamierza pomoc, nie wiem jak zastosowa? t? funkcje by? bym wdzi?czny.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-08-02, 21:09


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Po prostu musisz wykona? CA?? funkcj?, gdzie tworzysz gridlist?, dodajesz do niej elementy z tuningiem itd. itd. itd.

Dalej ciemno?

function createTuningMenu()
    createGridList(dane bla bla bla)
    addGridListRow(dane bla bla bla)
end

event(
   --je?li gracz kliknie montaz tuninguodswiezamy wywo?uj?c funkcjod tworzenia
   createTuningMenu()
)


Ca?kowite uproszczenie, event oczywi?cie onClientGUIClick lub inne co tam masz.

Postaw piwo autorowi tego posta
 

 
Tagi: gui :: tuner :: zmiana
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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