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

Wysłany: 2018-01-18, 17:31


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

Chodzi o to ?e robi? prawo jazdy i jestem pod czas tworzenia teori lecz po lecz jak klikn? Kat.a to przenosi do wyboru czy teoria czy praktyka i po klikni?ciu teoria przenosi do pytania nr 1 czyli tak jak ma by? lecz po klikni?ciu w pytaniu nr.1 na oboj?tnie kt?r? odpowiedz lub na X do zamykania okna nic si? nie dzieje prosz? o pomoc i? nie wiem co jest tego przyczyn? a i nie ma ni? w DB3

kawa?ek kodu strona client

function onClientClick(button,state,cX,cY)
    if not isCursorShowing() then
        return
    end
    if button == "left" and state == "up" then
        for k,self in pairs(editBox.instances) do
            if self.visible then
                if self.input then
                    self.input nil
                    self.onOutput()
                end
                local x,y,w,self:getPosition()
                if isMouseInPosition(x,y,w,hthen
                    self.input true
                    self.onInput()
                end
            end
        end
        if rodzaj then
            if isMouseInPosition(x*525,y*375,x*57,y*38then -- Kategoria A
                if not getElementData(localPlayer"Prawko_A"true) or getElementData(localPlayer"Prawko_B"true) or getElementData(localPlayer"Prawko_C"true) or getElementData(localPlayer"Prawko_D"truethen
                    rodzaj false
                    etap true
                    setElementData (localPlayer"Prawko_A"true)
                else
                     outputChatBox("NIE OSZUKUJ") 
                end    
            elseif isMouseInPosition(x*608,y*375,x*57,y*38then -- Kategoria B
                if not getElementData(localPlayer"Prawko_A"true) or getElementData(localPlayer"Prawko_B"true) or getElementData(localPlayer"Prawko_C"true) or getElementData(localPlayer"Prawko_D"truethen
                    rodzaj false
                    etap true
                    setElementData (localPlayer"Prawko_B"true)
                else
                     outputChatBox("NIE OSZUKUJ") 
                end    
            elseif isMouseInPosition(x*693,y*375,x*57,y*38then -- Kategoria C
                if not getElementData(localPlayer"Prawko_A"true) or getElementData(localPlayer"Prawko_B"true) or getElementData(localPlayer"Prawko_C"true) or getElementData(localPlayer"Prawko_D"truethen
                    rodzaj false
                    etap true
                    setElementData (localPlayer"Prawko_C"true)
                else
                     outputChatBox("NIE OSZUKUJ") 
                end
            elseif isMouseInPosition(x*783,y*375,x*57,y*38then -- Kategoria D
                if not getElementData(localPlayer"Prawko_A"true) or getElementData(localPlayer"Prawko_B"true) or getElementData(localPlayer"Prawko_C"true) or getElementData(localPlayer"Prawko_D"truethen
                    rodzaj false
                    etap true
                    setElementData (localPlayer"Prawko_D"true)
                else
                     outputChatBox("NIE OSZUKUJ") 
                end
            elseif isMouseInPosition(x*835,y*440,x*15,y*15then -- Zamkni?cie okna
                showCursor(false)
                removeEventHandler("onClientRender"rootpanel_prawka)
                removeEventHandler("onClientClick",root,onClientClick)
                if getElementData(localPlayer"Prawko_A"truethen
                    setElementData(localPlayer"Prawko_A"false)
                elseif getElementData(localPlayer"Prawko_B"truethen
                    setElementData(localPlayer"Prawko_B"false)
                elseif getElementData(localPlayer"Prawko_C"truethen
                    setElementData(localPlayer"Prawko_C"false)
                  elseif getElementData(localPlayer"Prawko_D"truethen
                       setElementData(localPlayer"Prawko_D"false)
                end    
            end
        elseif etap then
            if isMouseInPosition(x*590,y*335,x*190,y*40then -- Teoria
                if getElementData(localPlayer"Prawko_A"truethen
                    outputChatBox("#FF0000W trakcje Prac"000true)
                elseif getElementData(localPlayer"Prawko_B"truethen
                    etap false
                    pytanie1 true
                elseif getElementData(localPlayer"Prawko_C"truethen
                    outputChatBox("#FF0000W trakcje Prac"000true)
                elseif getElementData(localPlayer"Prawko_D"truethen
                    outputChatBox("#FF0000W trakcje Prac"000true)
                end  
            elseif isMouseInPosition(x*590,y*380,x*190,y*40then -- Praktyka
                outputChatBox("#FF0000W trakcje prac"000true)
            elseif isMouseInPosition(x*590,y*425,x*190,y*40then -- Wstecz
                etap false
                rodzaj true
                if getElementData(localPlayer"Prawko_A"truethen
                    setElementData(localPlayer"Prawko_A"false)
                elseif getElementData(localPlayer"Prawko_B"truethen
                    setElementData(localPlayer"Prawko_B"false)
                elseif getElementData(localPlayer"Prawko_C"truethen
                    setElementData(localPlayer"Prawko_C"false) 
                  elseif getElementData(localPlayer"Prawko_D"truethen
                       setElementData(localPlayer"Prawko_D"false) 
                end        
            elseif isMouseInPosition(x*835,y*440,x*15,y*15then -- Zamknij Panel
                showCursor(false)
                etap false
                removeEventHandler("onClientRender"rootpanel_prawka)
                removeEventHandler("onClientClick",root,onClientClick)
                if getElementData(localPlayer"Prawko_A"truethen
                    setElementData(localPlayer"Prawko_A"false)
                elseif getElementData(localPlayer"Prawko_B"truethen
                    setElementData(localPlayer"Prawko_B"false)
                elseif getElementData(localPlayer"Prawko_C"truethen
                    setElementData(localPlayer"Prawko_C"false)    
                  elseif getElementData(localPlayer"Prawko_D"truethen
                       setElementData(localPlayer"Prawko_D"false)
                end
        elseif pytanie1 then
                if isMouseInPosition(x*585,y*340,x*195,y*35then -- Odpowiedz 1
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*585,y*382,x*195,y*40then -- Odpowiedz 2
                    pytanie1 false
                    pytanie2 true
                elseif isMouseInPosition(x*585,y*425,x*195,y*40then -- Odpowiedz 3
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*835,y*440,x*15,y*15then -- Zamknij Panel
                    showCursor(false)
                    pytanie1 false
                    removeEventHandler("onClientRender"rootpanel_prawka)
                    removeEventHandler("onClientClick",root,onClientClick)          
                end
         elseif pytanie2 then
                if isMouseInPosition(x*585,y*340,x*195,y*35then -- Odpowiedz 1
                    pytanie2 false
                    pytanie3 true
                elseif isMouseInPositionx(x*585,y*382,x*195,y*40then -- Odpowiedz 2
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*585,y*425,x*195,y*40then -- Odpowiedz 3
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*835,y*440,x*15,y*15then -- Zamknij Panel
                    showCursor(false)
                    pytanie2 false
                    removeEventHandler("onClientRender"rootpanel_prawka)
                    removeEventHandler("onClientClick",root,onClientClick)          
                end    
        elseif pytanie3 then
                if isMouseInPosition(x*585,y*340,x*195,y*35then -- Odpowiedz 1
                    pytanie3 false
                    pytanie4 true
                elseif isMouseInPosition(x*585,y*382,x*195,y*40then -- Odpowiedz 2
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*585,y*425,x*195,y*40then -- Odpowiedz 3
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*835,y*440,x*15,y*15then -- Zamknij Panel
                    showCursor(false)
                    pytanie3 false
                    removeEventHandler("onClientRender"rootpanel_prawka)
                    removeEventHandler("onClientClick",root,onClientClick)          
                end    
        elseif pytanie4 then
                if isMouseInPosition(x*585,y*340,x*195,y*35then -- Odpowiedz 1
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*585,y*382,x*195,y*40then -- Odpowiedz 2
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*585,y*425,x*195,y*40then -- Odpowiedz 3
                    pytanie4 false
                    pytanie5 true
                elseif isMouseInPosition(x*835,y*440,x*15,y*15then -- Zamknij Panel
                    showCursor(false)
                    pytanie4 false
                    removeEventHandler("onClientRender"rootpanel_prawka)
                    removeEventHandler("onClientClick",root,onClientClick)          
                end    
        elseif pytanie5 then
                if isMouseInPosition(x*585,y*340,x*195,y*35then -- Odpowiedz 1
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*585,y*382,x*195,y*40then -- Odpowiedz 2
                    outputChatBox("#FF0000Gratulacje zda?e?/a? egzamin teoretyczny teraz mo?esz podej?? do praktycznego."000true)
                    pytanie5 false
                    setElementData(localPlayer"egzamin""teoria")
                    removeEventHandler("onClientRender"rootpanel_prawka)
                    removeEventHandler("onClientClick",root,onClientClick)
                elseif isMouseInPosition(x*585,y*425,x*195,y*40then -- Odpowiedz 3
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*835,y*440,x*15,y*15then -- Zamknij Panel
                    showCursor(false)
                    pytanie5 false
                    removeEventHandler("onClientRender"rootpanel_prawka)
                    removeEventHandler("onClientClick",root,onClientClick)          
                end    
            end
        end
    end
end
addEventHandler("onClientClick"rootonClientClick)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-18, 17:43


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

stworz
local kata false
local katb false
-- i tak dalej

P??niej w if'ie gdzie klikasz zr?b tak
            if isMouseInPosition(x*525,y*375,x*57,y*38) and kata == true then -- Kategoria A
                if not getElementData(localPlayer"Prawko_A"true) or getElementData(localPlayer"Prawko_B"true) or getElementData(localPlayer"Prawko_C"true) or getElementData(localPlayer"Prawko_D"truethen
                    kata true
                    katb false
                    rodzaj false
                    etap true
                    setElementData (localPlayer"Prawko_A"true)
                else
                     outputChatBox("NIE OSZUKUJ") 
                end   

i tak w ka?dym.. mi to przynajmniej dzialalo..

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-18, 17:45


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

Wercio. ale to dzia?a nie dzia?a od tego momentu

        elseif pytanie1 then
                if isMouseInPosition(x*585,y*340,x*195,y*35then -- Odpowiedz 1
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*585,y*382,x*195,y*40then -- Odpowiedz 2
                    pytanie1 false
                    pytanie2 true
                elseif isMouseInPosition(x*585,y*425,x*195,y*40then -- Odpowiedz 3
                    outputChatBox("#FF0000TEST"000true)
                elseif isMouseInPosition(x*835,y*440,x*15,y*15then -- Zamknij Panel
                    showCursor(false)
                    pytanie1 false
                    removeEventHandler("onClientRender"rootpanel_prawka)
                    removeEventHandler("onClientClick",root,onClientClick)          
                end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-18, 17:46


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

To tez spr?buj dac tak jak napisa?em

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-01-18, 17:49


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

tu masz funkcje za tworzenie panelu mam tak zrobione tylko w sw?j spos?b


function panel_prawka()
    local rh,ry interpolateBetween(0, (y*559/2)+y*1050y*559y*1050, (getTickCount()-tick)/1400"Linear")

    if getTickCount()-tick 1 then
        local A tocolor(0,0,0,255)
        if isMouseInPosition(x*525,y*375,x*57,y*38then
            A tocolor(0,78,185,255)
        end
        local B tocolor(0,0,0,255)
        if isMouseInPosition(x*608,y*375,x*57,y*38then
            B tocolor(0,78,185,255)
        end
        local X tocolor(255,255,255,200)
        if isMouseInPosition(x*835,y*440,x*15,y*15then
            X tocolor(0,78,185,255)
        end
        local C tocolor(0,0,0,255)
        if isMouseInPosition(x*693,y*375,x*57,y*38then
            C tocolor(0,78,185,255)
        end
        local D tocolor(0,0,0,255)
        if isMouseInPosition(x*783,y*375,x*57,y*38then
            D tocolor(0,78,185,255)
        end
        local Wstecz tocolor(0,0,0,255)
        if isMouseInPosition(x*590,y*425,x*190,y*40then
            Wstecz tocolor(0,78,185,255)
        end
        local Teoria tocolor(0,0,0,255)
        if isMouseInPosition(x*590,y*335,x*190,y*40then 
            Teoria tocolor(0,78,185,255)
        end
        local Praktyka tocolor(0,0,0,255)
        if isMouseInPosition(x*590,y*380,x*190,y*40then 
            Praktyka tocolor(0,78,185,255)
        end
        local odp1 tocolor(0,0,0,255)
        if isMouseInPosition(x*585,y*340,x*195,y*35then 
            odp1 tocolor(0,78,185,255)
        end
        local odp2 tocolor(0,0,0,255)
        if isMouseInPosition(x*585,y*382,x*195,y*40then 
            odp2 tocolor(0,78,185,255)
        end
        local odp3 tocolor(0,0,0,255)
        if isMouseInPosition(x*585,y*425,x*195,y*40then 
            odp3 tocolor(0,78,185,255)
        end
        
        if rodzaj then --- Wyb?r kategori
            dxDrawImage(0,0,sx,sy,"png/gui.png")
            dxDrawText("A",x*558,y*282,x*552,y*504,A,y*0.9,font2,"center","center")
            dxDrawText("B",x*725,y*282,x*552,y*504,B,y*0.9,font2,"center","center")
            dxDrawText("C",x*892,y*282,x*552,y*504,C,y*0.9,font2,"center","center")
            dxDrawText("D",x*1075,y*282,x*552,y*504,D,y*0.9,font2,"center","center")
            
            dxDrawText("X",x*900,y*260,x*788,y*632,X,y*0.7,font,"center","center")
            
        elseif etap then --- Wyb?r etapu
            dxDrawImage(0,0,sx,sy,"png/gui_etap.png")
            dxDrawText("Teoria",x*815,y*210,x*552,y*504,Teoria,y*1,font2,"center","center")
            dxDrawText("Praktyka",x*820,y*295,x*552,y*504,Praktyka,y*1,font2,"center","center")

            dxDrawText("Wstecz",x*820,y*385,x*552,y*504,Wstecz,y*0.9,font2,"center","center")
            dxDrawText("X",x*900,y*260,x*788,y*632,X,y*0.7,font,"center","center",false,false,false,true)
            
        elseif pytanie1 then --Pytanie 1 kat.B
               dxDrawImage(0,0,sx,sy,"png/pytanie_1.png")
               dxDrawText("A.Na drodze suchej.",x*820,y*210,x*552,y*504,odp1,y*0.8,font2,"center","center")
               dxDrawText("B.Na drodze oblodzonej",x*820,y*300,x*552,y*504,odp2,y*0.7,font2,"center","center")
            dxDrawText("C.Na drodze mokrej.",x*820,y*385,x*552,y*504,odp3,y*0.8,font2,"center","center")
            
            dxDrawText("X",x*900,y*260,x*788,y*632,X,y*0.7,font,"center","center")
            
        elseif pytanie2 then -- Pytanie 2 kat.B
               dxDrawImage(0,0,sx,sy,"png/pytanie_2.png")
               dxDrawText("A",x*820,y*210,x*552,y*504,odp1,y*0.8,font2,"center","center")
               dxDrawText("B",x*820,y*300,x*552,y*504,odp2,y*0.8,font2,"center","center")
            dxDrawText("C",x*820,y*385,x*552,y*504,odp3,y*0.8,font2,"center","center")
            
            dxDrawText("X",x*900,y*260,x*788,y*632,X,y*0.7,font,"center","center")
            
        elseif pytanie3 then -- pytanie 3 kat.B
               dxDrawImage(0,0,sx,sy,"png/pytanie_3.png")
               dxDrawText("A",x*820,y*210,x*552,y*504,odp1,y*0.8,font2,"center","center")
               dxDrawText("B",x*820,y*300,x*552,y*504,odp2,y*0.8,font2,"center","center")
            dxDrawText("C",x*820,y*385,x*552,y*504,odp3,y*0.8,font2,"center","center")
            
            dxDrawText("X",x*900,y*260,x*788,y*632,X,y*0.7,font,"center","center")
            
        elseif pytanie4 then -- pytanie 4 kat.B
               dxDrawImage(0,0,sx,sy,"png/pytanie_4.png")
               dxDrawText("A",x*820,y*210,x*552,y*504,odp1,y*0.8,font2,"center","center")
               dxDrawText("B",x*820,y*300,x*552,y*504,odp2,y*0.8,font2,"center","center")
            dxDrawText("C",x*820,y*385,x*552,y*504,odp3,y*0.8,font2,"center","center")
            
            dxDrawText("X",x*900,y*260,x*788,y*632,X,y*0.7,font,"center","center")
            
        elseif pytanie5 then -- pytanie 5 kat.B
               dxDrawImage(0,0,sx,sy,"png/pytanie_5.png")
               dxDrawText("A",x*820,y*210,x*552,y*504,odp1,y*0.8,font2,"center","center")
               dxDrawText("B",x*820,y*300,x*552,y*504,odp2,y*0.8,font2,"center","center")
            dxDrawText("C",x*820,y*385,x*552,y*504,odp3,y*0.8,font2,"center","center")
            
            dxDrawText("X",x*900,y*260,x*788,y*632,X,y*0.7,font,"center","center")
        end
    end
end


[ Dodano: 2018-01-18, 22:06 ]
Czyli tak jak by nie reagowa? na klikanie w odpowiedz ale wydaje mi si? ?e wszystko dobrze napisa?em

[ Dodano: 2018-01-19, 16:56 ]
po d?ugim sprawdzaniu uda?o mi si? naprawi? wina w jednym ma?ym end
@locl

Postaw piwo autorowi tego posta
 

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