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

Wysłany: 2017-03-06, 16:25


Krzemo1234







Wiek: 27
Na forum: 3892 dni
Posty: 387
Nick w MP: Krzemo

Piwa: 16

Respekt: 40

addEvent("pokazPanelTuningu", true)
addEventHandler("pokazPanelTuningu", localPlayer, function(veh)
    if not isElement(GUIEditor.window[1]) then
        if getElementData(veh, "vehicle:spawn") then
            showCursor(true)
            veh1 = veh
            setElementData(localPlayer, "tune:car", veh)
            local screenW, screenH = guiGetScreenSize()
            GUIEditor.window[1] = guiCreateWindow((screenW - 888) / 2, (screenH - 546) / 2, 888*width, 546*height, "---=== Tuningowanie pojazdu ===---", false)
            guiWindowSetSizable(GUIEditor.window[1], false)
            GUIEditor.button[1] = guiCreateButton(445*width, 484*height, 233*width, 52*height, "TUNINGUJ\nDEMONTUJ", false, GUIEditor.window[1])
            guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
            GUIEditor.button[2] = guiCreateButton(212*width, 484*height, 233*width, 52*height, "ZAMKNIJ OKNO", false, GUIEditor.window[1])
            guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
            GUIEditor.gridlist[1] = guiCreateGridList(31*width, 41*height, 827*width, 390*height, false, GUIEditor.window[1])
            guiGridListAddColumn(GUIEditor.gridlist[1], "ID CZESCI", 0.15)
            guiGridListAddColumn(GUIEditor.gridlist[1], "TYP", 0.15)
            guiGridListAddColumn(GUIEditor.gridlist[1], "AKCJA", 0.15)
            guiGridListAddColumn(GUIEditor.gridlist[1], "KOSZT CZESCI", 0.15)
            guiGridListAddColumn(GUIEditor.gridlist[1], "NAZWA Czesci", 0.15)
        --    a=0
            for i=0,16 do
                if getVehicleUpgradeOnSlot(veh, i) ~= 0 then
                    local a = guiGridListAddRow(GUIEditor.gridlist[1])
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 1, tostring(getVehicleUpgradeOnSlot(veh, i)), false, false)
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 2, tostring(getVehicleUpgradeSlotName(getVehicleUpgradeOnSlot(veh, i))), false, false)
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 3, "demtuning", false, false)
                    if cenaCzesci[getVehicleUpgradeOnSlot(veh,i)] then
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, tostring(tonumber(cenaCzesci[getVehicleUpgradeOnSlot(veh,i)]*9/10)) , false, false)
                    else
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, "--" , false, false)
                    end
                    if nazwaCzesci[getVehicleUpgradeOnSlot(veh,i)] then
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, tostring(nazwaCzesci[getVehicleUpgradeOnSlot(veh,i)]), false, false)
                    else
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, "PuddinG" , false, false)
                    end
                    --    a=a+1
                else
                    for i2,v2 in ipairs(getVehicleCompatibleUpgrades(veh, i)) do
                        if cenaCzesci[v2] then
                            if not wykluczoneCzesci[v2] then
                                if v2 == 1164 then
                                    if getElementModel(veh) == 558 then
                                        local a=guiGridListAddRow(GUIEditor.gridlist[1])
                                        guiGridListSetItemText(GUIEditor.gridlist[1], a, 1, tostring(v2), false, false)
                                        guiGridListSetItemText(GUIEditor.gridlist[1], a, 2, tostring(getVehicleUpgradeSlotName(v2)), false, false)
                                        guiGridListSetItemText(GUIEditor.gridlist[1], a, 3, "tuning", false, false)
                                        guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, tostring(cenaCzesci[v2]), false, false)
                                        if nazwaCzesci[v2] then
                                            guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, tostring(nazwaCzesci[v2]), false, false)
                                        else
                                            guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, "PuddinG" , false, false)
                                        end
                                    end
                                else
                                    local a=guiGridListAddRow(GUIEditor.gridlist[1])
                                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 1, tostring(v2), false, false)
                                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 2, tostring(getVehicleUpgradeSlotName(v2)), false, false)
                                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 3, "tuning", false, false)
                                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, tostring(cenaCzesci[v2]), false, false)
                                    if nazwaCzesci[v2] then
                                        guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, tostring(nazwaCzesci[v2]), false, false)
                                    else
                                        guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, "PuddinG" , false, false)
                                    end
                                --    a=a+1
                                end
                            end
                        end
                    end
                end
            end
            
            
            GUIEditor.progressbar[1] = guiCreateProgressBar(129*width, 436*height, 631*width, 38*height, false, GUIEditor.window[1])
            guiProgressBarSetProgress(GUIEditor.progressbar[1], 0)
        end
    else 
        setElementData(localPlayer, "tune:car",nil)
    end
    
end)


addEvent("ukryjPanelTuningu",true)
addEventHandler("ukryjPanelTuningu", localPlayer, function()
    if GUIEditor.window[1] and isElement(GUIEditor.window[1]) then
        destroyElement(GUIEditor.window[1])
        setElementData(localPlayer, "tune:car",nil)
        showCursor(false)
    end
end)

time=5000

function onClientGUIClick()
    if GUIEditor.button[2] and isElement(GUIEditor.button[2]) and source == GUIEditor.button[2] then
        if GUIEditor.window[1] and isElement(GUIEditor.window[1]) then
            destroyElement(GUIEditor.window[1])
            showCursor(false)
        end
    elseif GUIEditor.button[1] and isElement(GUIEditor.button[1]) and source == GUIEditor.button[1] then

        if GUIEditor.progressbar[1] and isElement(GUIEditor.progressbar[1]) and GUIEditor.gridlist[1] and isElement(GUIEditor.gridlist[1]) then
            if guiProgressBarGetProgress(GUIEditor.progressbar[1]) == 0 or guiProgressBarGetProgress(GUIEditor.progressbar[1]) == 100 then
            b=0
            local x,y = guiGridListGetSelectedItem(GUIEditor.gridlist[1])
                if y == 1 then 
                    removeEventHandler("onClientGUIClick",resourceRoot, onClientGUIClick)
                    
                    setTimer(function()
                        b=b+1
                        if GUIEditor.progressbar[1] and isElement(GUIEditor.progressbar[1]) then
                            guiProgressBarSetProgress(GUIEditor.progressbar[1], b)
                        end
                    end,time/100,100)
                    
                    setTimer(function()
                        addEventHandler("onClientGUIClick",resourceRoot, onClientGUIClick)
                        local text1 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 1) -- ID
                        local text2 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 2) -- TYP
                        local text3 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 3) -- AKCJA
                        local text4 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 4) -- CENA
                        local text5 = guiGridListGetItemText(GUIEditor.gridlist[1], x, 5) -- nazwa
                        if text1 and tonumber(text1) and text4 and tonumber(text4) and text3 and tostring(text3) then
--                        if not wykluczoneCzesci[tonumber(text1)] then
                                if cenaCzesci[tonumber(text1)] then
                                    if veh1 and isElement(veh1) and getElementType(veh1) == "vehicle" then
                                        triggerServerEvent("montazElementu", root, veh1, text3, text1, text4, text5)
                                    end
                                end
                            end
--                        end
                    end,time*1.14,1)
                end
            end
        end
    end
end

addEventHandler("onClientGUIClick",resourceRoot, onClientGUIClick)




Za pomoc oczywi?cie :piwo:

[ Dodano: 2017-03-06, 16:26 ]
Dok?adnie
addEvent("pokazPanelTuningu", true)
addEventHandler("pokazPanelTuningu", localPlayer, function(veh)
    if not isElement(GUIEditor.window[1]) then
        if getElementData(veh, "vehicle:spawn") then
            showCursor(true)
            veh1 = veh
            setElementData(localPlayer, "tune:car", veh)
            local screenW, screenH = guiGetScreenSize()
            GUIEditor.window[1] = guiCreateWindow((screenW - 888) / 2, (screenH - 546) / 2, 888*width, 546*height, "---=== Tuningowanie pojazdu ===---", false)
            guiWindowSetSizable(GUIEditor.window[1], false)
            GUIEditor.button[1] = guiCreateButton(445*width, 484*height, 233*width, 52*height, "TUNINGUJ\nDEMONTUJ", false, GUIEditor.window[1])
            guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
            GUIEditor.button[2] = guiCreateButton(212*width, 484*height, 233*width, 52*height, "ZAMKNIJ OKNO", false, GUIEditor.window[1])
            guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
            GUIEditor.gridlist[1] = guiCreateGridList(31*width, 41*height, 827*width, 390*height, false, GUIEditor.window[1])
            guiGridListAddColumn(GUIEditor.gridlist[1], "ID CZESCI", 0.15)
            guiGridListAddColumn(GUIEditor.gridlist[1], "TYP", 0.15)
            guiGridListAddColumn(GUIEditor.gridlist[1], "AKCJA", 0.15)
            guiGridListAddColumn(GUIEditor.gridlist[1], "KOSZT CZESCI", 0.15)
            guiGridListAddColumn(GUIEditor.gridlist[1], "NAZWA Czesci", 0.15)
        --    a=0
            for i=0,16 do
                if getVehicleUpgradeOnSlot(veh, i) ~= 0 then
                    local a = guiGridListAddRow(GUIEditor.gridlist[1])
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 1, tostring(getVehicleUpgradeOnSlot(veh, i)), false, false)
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 2, tostring(getVehicleUpgradeSlotName(getVehicleUpgradeOnSlot(veh, i))), false, false)
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 3, "demtuning", false, false)
                    if cenaCzesci[getVehicleUpgradeOnSlot(veh,i)] then
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, tostring(tonumber(cenaCzesci[getVehicleUpgradeOnSlot(veh,i)]*9/10)) , false, false)
                    else
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 4, "--" , false, false)
                    end
                    if nazwaCzesci[getVehicleUpgradeOnSlot(veh,i)] then
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, tostring(nazwaCzesci[getVehicleUpgradeOnSlot(veh,i)]), false, false)
                    else
                    guiGridListSetItemText(GUIEditor.gridlist[1], a, 5, "PuddinG" , false, false)
                    end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 16:29


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

jaki? b??d db3?

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 16:46


Krzemo1234







Wiek: 27
Na forum: 3892 dni
Posty: 387
Nick w MP: Krzemo

Piwa: 16

Respekt: 40

Tu jest problem ,?e nima

Podpis
Jeśli ci pomogłem zostaw zimne :piwo:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 16:48


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4291 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

addEventHandler("onClientGUIClick",root,function()
if source == GUIEditor.button[2] then
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
end
end)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 17:05


Krzemo1234







Wiek: 27
Na forum: 3892 dni
Posty: 387
Nick w MP: Krzemo

Piwa: 16

Respekt: 40

A gdzie to wklei? bo nie chce zepsu? rok temu robi?em skrypty teraz pozapomina?em par? rzeczy takich wa?nych

Podpis
Jeśli ci pomogłem zostaw zimne :piwo:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-06, 17:15


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4291 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

Pomy?l logicznie Skrypterze

Mo?e by? nawet na samym dole.

dodaj sobie
Więcej informacji znajdziesz w Wikipedii MTA:

guiGridListClear
by czysci?o liste.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Tagi: nie :: mogę :: zamknąć :: okna
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