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

Wysłany: 2018-04-01, 17:36


PenkY

Mapper






Wiek: 23
Na forum: 3464 dni
Posty: 223
Nick w MP: penky

Piwa: 2210

Respekt: 472
Respekt: 472

Witam!
Ot?? morduje si? z tym problemem ju? godzin? i nie wiem co jest grane. Po naci?ni?ciu przycisku 'Anuluj' zabiera mi paczk? zamiast wy??czy? GUI. Prosze o pomoc, o poprawienie kodu. Za pomoc stawiam R* :piwo:



local praca createMarker(1407.701143.375102.70-1"cylinder"2.025525525580)
local t=createElement("text")
setElementData(t,"name""Praca Dorywcza: Pracownik Magazynu")
setElementPosition(t,1407.701143.375102.70)
setElementDimension(t0)
setElementInterior(t0)

local screenWscreenH guiGetScreenSize()

panel false

local miejscamagazynier = {
    {1410.871156.975102.70}, 
    {1406.321170.665102.70},
    {1406.321170.665102.70},
    {1410.951178.065102.70},
    {1406.381178.065102.70},
    {1418.811185.875102.70},
    {1413.731181.315102.70},
}

function paneldx()
        dxDrawImage(screenW 0.2833screenH 0.2865screenW 0.4334screenH 0.4271"images/bg2.png"000tocolor(255255255255), false)
        dxDrawText("Rozpocznij", (screenW 0.3587) - 1, (screenH 0.6029) - 1, (screenW 0.4414) - 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij", (screenW 0.3587) + 1, (screenH 0.6029) - 1, (screenW 0.4414) + 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij", (screenW 0.3587) - 1, (screenH 0.6029) + 1, (screenW 0.4414) - 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij", (screenW 0.3587) + 1, (screenH 0.6029) + 1, (screenW 0.4414) + 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij"screenW 0.3587screenH 0.6029screenW 0.4414screenH 0.6549tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) - 1, (screenH 0.6094) - 1, (screenW 0.6501) - 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) + 1, (screenH 0.6094) - 1, (screenW 0.6501) + 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) - 1, (screenH 0.6094) + 1, (screenW 0.6501) - 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) + 1, (screenH 0.6094) + 1, (screenW 0.6501) + 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj"screenW 0.5688screenH 0.6094screenW 0.6501screenH 0.6549tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) - 1, (screenH 0.3568) - 1, (screenW 0.5469) - 1, (screenH 0.3971) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) + 1, (screenH 0.3568) - 1, (screenW 0.5469) + 1, (screenH 0.3971) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) - 1, (screenH 0.3568) + 1, (screenW 0.5469) - 1, (screenH 0.3971) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) + 1, (screenH 0.3568) + 1, (screenW 0.5469) + 1, (screenH 0.3971) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera"screenW 0.4553screenH 0.3568screenW 0.5469screenH 0.3971tocolor(19700255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) - 1, (screenH 0.4102) - 1, (screenW 0.5571) - 1, (screenH 0.4466) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) + 1, (screenH 0.4102) - 1, (screenW 0.5571) + 1, (screenH 0.4466) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) - 1, (screenH 0.4102) + 1, (screenW 0.5571) - 1, (screenH 0.4466) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) + 1, (screenH 0.4102) + 1, (screenW 0.5571) + 1, (screenH 0.4466) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy"screenW 0.4414screenH 0.4102screenW 0.5571screenH 0.4466tocolor(255255255255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca polegaj?ca na roznoszeniu paczek z zywno?ci?.\nPo zaniesieniu paczki otrzymamy wynagrodzenie."screenW 0.4451screenH 0.4870screenW 0.5542screenH 0.5404tocolor(255255255255), 1.00"default-bold""center""top"falsefalsefalsefalsefalse)
end

addEventHandler("onClientMarkerHit"praca, function(elmd)
    if el ~= localPlayer then return end
    panel true
    addEventHandler("onClientRender"rootpaneldx)
    showCursor(true)
end)



addEventHandler("onClientResourceStop"resourceRoot, function()
panel false
 setElementData(localPlayer"player:job"false)
end,false,"high")

function isMouseInPosition(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*screenW,cy*screenH
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function klik()
    if panel == true then
        if isMouseInPosition(screenW 0.3587screenH 0.6029screenW 0.4414screenH 0.6549then
            if not getElementData(localPlayer"player:job"then
                if panel == false then cancelEvent() end
                local losuj math.random(2#miejscamagazynier)
                setElementData(localPlayer"player:job"true)
                setPedControlState(localPlayer"walk"true)
                toggleControl("crouch",false)
                toggleControl("jump"false)
                toggleControl("sprint"false)
                setPedAnimation localPlayer"CARRY""crry_prtial"1,true )
                removeEventHandler("onClientRender"rootpaneldx)
                showCursor(false)
                panel false

                local skrzynia createObject(1271000)
                attachElements skrzynialocalPlayer00.80.5)
                
                local cel createMarker(miejscamagazynier[losuj][1], miejscamagazynier[losuj][2], miejscamagazynier[losuj][3]-1.0"checkpoint"1.025500)
                local blip createBlipAttachedTo(cel41)
                
                addEventHandler("onClientMarkerHit"cel, function(elmd)
                    if not md or getElementType(el) ~= "player" then return end
                    if el ~= localPlayer then return end

                    if getPedOccupiedVehicle(elthen
                    exports["lr_noti"]:addNotification("* Nie mo?esz tego od?o?y? b?d?c w poje?dzie.")
                        return
                    end


                    destroyElement(blip)
                    setElementFrozen(eltrue)
                    exports["lr_noti"]:addNotification("* K?adziesz skrzynie, odczekaj 5 sekund.")
                    setTimer(function()
                        setElementFrozen(elfalse)
                        destroyElement(skrzynia)
                        destroyElement(cel)
                        setPedControlState(localPlayer"walk"false)
                        setPedAnimation(localPlayerfalse)
                        toggleControl("jump"true)
                        toggleControl("crouch",true)
                        toggleControl("sprint"true)
                        setElementData(el"player:job"false)
                        if getElementData(el,"player:premium"then
                        exports["lr_noti"]:addNotification("* Od?o?y?e?(a?) skrzyni?. Za od?o?enie skrzynii, otrzymujesz 35$.")
                        triggerServerEvent("givePlayerMoney"el250)
                        setElementData(el,"player:srp"getElementData(el,"player:srp")+math.random(0,1))
                        else
                        exports["lr_noti"]:addNotification("* Od?o?y?e?(a?) skrzyni?. Za od?o?enie skrzynii, otrzymujesz 8$.")
                        triggerServerEvent("givePlayerMoney"el80)
                        setElementData(el,"player:srp"getElementData(el,"player:srp")+math.random(0,1))
                        end
                    end40001)
                end)
            else
                exports["lr_noti"]:addNotification("* Posiadasz aktywn? prac?.")
            end
        elseif isMouseInPosition(screenW 0.5688screenH 0.6094screenW 0.6501screenH 0.6549then
            if panel == false then cancelEvent() end
            removeEventHandler("onClientRender"rootpaneldx)
            showCursor(false)
            panel false
        end
    end
end
addEventHandler("onClientClick"rootklik)

fileDelete("praca_c.lua")


Podpis
Discord: p3nky.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:07


NoKill1997

Online






Wiek: 28
Na forum: 3224 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 778

Respekt: 80,5

Spr?buj tak:
        elseif isMouseInPosition(screenW 0.5688screenH 0.6094screenW 0.6501screenH 0.6549then
            if panel == false then cancelEvent() end
            removeEventHandler("onClientRender"rootpaneldx)
            showCursor(false)
            panel false
        end
    end
end
addEventHandler("onClientClick"getRootElement(), klik)


Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:14


PenkY

Mapper






Wiek: 23
Na forum: 3464 dni
Posty: 223
Nick w MP: penky

Piwa: 2210

Respekt: 472
Respekt: 472

NoKill1997, Nadal to samo

Podpis
Discord: p3nky.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:23


NoKill1997

Online






Wiek: 28
Na forum: 3224 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 778

Respekt: 80,5

"PenkY." napisał/a:

NoKill1997, Nadal to samo
Jakie? b??dy w DB3?

Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:27


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Nie rozumiem za bardzo kodu, wyt?umacz co nie dzia?a i co chcia?by? uzyska? aby dzia?a?o bez zarzut?w.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:28


NoKill1997

Online






Wiek: 28
Na forum: 3224 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 778

Respekt: 80,5

"Kalizman" napisał/a:

Nie rozumiem za bardzo kodu, wyt?umacz co nie dzia?a i co chcia?by? uzyska? aby dzia?a?o bez zarzut?w.
Wydaje mi si?, ?e kolega Chce zrobi? funkcje zamkni?cia okna, kt?ra w pewnym stopniu dzia?a, lecz zabiera skrzyni? graczowi. (Chyba dobrze zrozumialem)

Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:30


PenkY

Mapper






Wiek: 23
Na forum: 3464 dni
Posty: 223
Nick w MP: penky

Piwa: 2210

Respekt: 472
Respekt: 472

NoKill1997, Tak dobrze napisa?e? oto mi w?asnie chodzi.

Podpis
Discord: p3nky.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:32


NoKill1997

Online






Wiek: 28
Na forum: 3224 dni
Posty: 183
Nick w MP: Mefedroniarz.PDW

Piwa: 778

Respekt: 80,5

"PenkY." napisał/a:

NoKill1997, Tak dobrze napisa?e? oto mi w?asnie chodzi.
A spr?buj doda? now? funkcj?, odpowiadaj?c?, za zamkniecie GUI. Masz tu przyk?ad:
function Closegui(buttonstate)
    if panel and button == "left" and state == "down" then
           if cursorPosition(screenW 0.5688screenH 0.6094screenW 0.6501screenH 0.6549then
                        removeEventHandler("onClientRender",rootpaneldx)
                        panel false
                        showCursor (false) 
         end
    end
end
addEventHandler("onClientClick"getRootElement(), Closegui)


Podpis
Aktualny projekt: LSgame
Na scenie MTA od: 2015 roku.
Discord: Chwilowoo, brak
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:33


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Powinno dzia?a?. Gdy zamkniesz okno na czacie powinna wy?wietli? si? informacja.

local praca createMarker(1407.701143.375102.70-1"cylinder"2.025525525580)
local t=createElement("text")
setElementData(t,"name""Praca Dorywcza: Pracownik Magazynu")
setElementPosition(t,1407.701143.375102.70)
setElementDimension(t0)
setElementInterior(t0)

local screenWscreenH guiGetScreenSize()

panel false

local miejscamagazynier = {
    {1410.871156.975102.70}, 
    {1406.321170.665102.70},
    {1406.321170.665102.70},
    {1410.951178.065102.70},
    {1406.381178.065102.70},
    {1418.811185.875102.70},
    {1413.731181.315102.70},
}

function paneldx()
        dxDrawImage(screenW 0.2833screenH 0.2865screenW 0.4334screenH 0.4271"images/bg2.png"000tocolor(255255255255), false)
        dxDrawText("Rozpocznij", (screenW 0.3587) - 1, (screenH 0.6029) - 1, (screenW 0.4414) - 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij", (screenW 0.3587) + 1, (screenH 0.6029) - 1, (screenW 0.4414) + 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij", (screenW 0.3587) - 1, (screenH 0.6029) + 1, (screenW 0.4414) - 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij", (screenW 0.3587) + 1, (screenH 0.6029) + 1, (screenW 0.4414) + 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij"screenW 0.3587screenH 0.6029screenW 0.4414screenH 0.6549tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) - 1, (screenH 0.6094) - 1, (screenW 0.6501) - 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) + 1, (screenH 0.6094) - 1, (screenW 0.6501) + 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) - 1, (screenH 0.6094) + 1, (screenW 0.6501) - 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) + 1, (screenH 0.6094) + 1, (screenW 0.6501) + 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj"screenW 0.5688screenH 0.6094screenW 0.6501screenH 0.6549tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) - 1, (screenH 0.3568) - 1, (screenW 0.5469) - 1, (screenH 0.3971) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) + 1, (screenH 0.3568) - 1, (screenW 0.5469) + 1, (screenH 0.3971) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) - 1, (screenH 0.3568) + 1, (screenW 0.5469) - 1, (screenH 0.3971) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) + 1, (screenH 0.3568) + 1, (screenW 0.5469) + 1, (screenH 0.3971) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera"screenW 0.4553screenH 0.3568screenW 0.5469screenH 0.3971tocolor(19700255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) - 1, (screenH 0.4102) - 1, (screenW 0.5571) - 1, (screenH 0.4466) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) + 1, (screenH 0.4102) - 1, (screenW 0.5571) + 1, (screenH 0.4466) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) - 1, (screenH 0.4102) + 1, (screenW 0.5571) - 1, (screenH 0.4466) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) + 1, (screenH 0.4102) + 1, (screenW 0.5571) + 1, (screenH 0.4466) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy"screenW 0.4414screenH 0.4102screenW 0.5571screenH 0.4466tocolor(255255255255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca polegaj?ca na roznoszeniu paczek z zywno?ci?.\nPo zaniesieniu paczki otrzymamy wynagrodzenie."screenW 0.4451screenH 0.4870screenW 0.5542screenH 0.5404tocolor(255255255255), 1.00"default-bold""center""top"falsefalsefalsefalsefalse)
end

addEventHandler("onClientMarkerHit"praca, function(elmd)
    if el ~= localPlayer then return end
    panel true
    addEventHandler("onClientRender"rootpaneldx)
    showCursor(true)
end)



addEventHandler("onClientResourceStop"resourceRoot, function()
panel false
 setElementData(localPlayer"player:job"false)
end,false,"high")

function isMouseInPosition(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*screenW,cy*screenH
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function klik()
--    if panel == true then
        if isMouseInPosition(screenW 0.3587screenH 0.6029screenW 0.4414screenH 0.6549) and panel == true then
            if not getElementData(localPlayer"player:job"then
                if panel == false then cancelEvent() end
                local losuj math.random(2#miejscamagazynier)
                setElementData(localPlayer"player:job"true)
                setPedControlState(localPlayer"walk"true)
                toggleControl("crouch",false)
                toggleControl("jump"false)
                toggleControl("sprint"false)
                setPedAnimation localPlayer"CARRY""crry_prtial"1,true )
                removeEventHandler("onClientRender"rootpaneldx)
                showCursor(false)
                panel false

                local skrzynia createObject(1271000)
                attachElements skrzynialocalPlayer00.80.5)
                
                local cel createMarker(miejscamagazynier[losuj][1], miejscamagazynier[losuj][2], miejscamagazynier[losuj][3]-1.0"checkpoint"1.025500)
                local blip createBlipAttachedTo(cel41)
                
                addEventHandler("onClientMarkerHit"cel, function(elmd)
                    if not md or getElementType(el) ~= "player" then return end
                    if el ~= localPlayer then return end

                    if getPedOccupiedVehicle(elthen
                    exports["lr_noti"]:addNotification("* Nie mo?esz tego od?o?y? b?d?c w poje?dzie.")
                        return
                    end


                    destroyElement(blip)
                    setElementFrozen(eltrue)
                    exports["lr_noti"]:addNotification("* K?adziesz skrzynie, odczekaj 5 sekund.")
                    setTimer(function()
                        setElementFrozen(elfalse)
                        destroyElement(skrzynia)
                        destroyElement(cel)
                        setPedControlState(localPlayer"walk"false)
                        setPedAnimation(localPlayerfalse)
                        toggleControl("jump"true)
                        toggleControl("crouch",true)
                        toggleControl("sprint"true)
                        setElementData(el"player:job"false)
                        if getElementData(el,"player:premium"then
                        exports["lr_noti"]:addNotification("* Od?o?y?e?(a?) skrzyni?. Za od?o?enie skrzynii, otrzymujesz 35$.")
                        triggerServerEvent("givePlayerMoney"el250)
                        setElementData(el,"player:srp"getElementData(el,"player:srp")+math.random(0,1))
                        else
                        exports["lr_noti"]:addNotification("* Od?o?y?e?(a?) skrzyni?. Za od?o?enie skrzynii, otrzymujesz 8$.")
                        triggerServerEvent("givePlayerMoney"el80)
                        setElementData(el,"player:srp"getElementData(el,"player:srp")+math.random(0,1))
                        end
                    end40001)
                end)
            else
                exports["lr_noti"]:addNotification("* Posiadasz aktywn? prac?.")
            end
        elseif isMouseInPosition(screenW 0.5688screenH 0.6094screenW 0.6501screenH 0.6549) and panel == true then
            removeEventHandler("onClientRender"rootpaneldx)
            showCursor(false)
            panel false
            outputChatBox ("okno zamkni?te")
        end
--    end
end
addEventHandler("onClientClick"rootklik)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:38


PenkY

Mapper






Wiek: 23
Na forum: 3464 dni
Posty: 223
Nick w MP: penky

Piwa: 2210

Respekt: 472
Respekt: 472

Kalizman, Nic z tego zamyka sie okienko ale te? zabiera mi skrzynie.

Podpis
Discord: p3nky.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 18:42


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Powinno ju? dzia?a?, je?eli nie b?dzie trzeba pobawi? si? z dzia?aniem pracy po naci?ni?ciu buttona.
local praca createMarker(1407.701143.375102.70-1"cylinder"2.025525525580)
local t=createElement("text")
setElementData(t,"name""Praca Dorywcza: Pracownik Magazynu")
setElementPosition(t,1407.701143.375102.70)
setElementDimension(t0)
setElementInterior(t0)

local screenWscreenH guiGetScreenSize()

panel false

local miejscamagazynier = {
    {1410.871156.975102.70}, 
    {1406.321170.665102.70},
    {1406.321170.665102.70},
    {1410.951178.065102.70},
    {1406.381178.065102.70},
    {1418.811185.875102.70},
    {1413.731181.315102.70},
}

function paneldx()
        dxDrawImage(screenW 0.2833screenH 0.2865screenW 0.4334screenH 0.4271"images/bg2.png"000tocolor(255255255255), false)
        dxDrawText("Rozpocznij", (screenW 0.3587) - 1, (screenH 0.6029) - 1, (screenW 0.4414) - 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij", (screenW 0.3587) + 1, (screenH 0.6029) - 1, (screenW 0.4414) + 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij", (screenW 0.3587) - 1, (screenH 0.6029) + 1, (screenW 0.4414) - 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij", (screenW 0.3587) + 1, (screenH 0.6029) + 1, (screenW 0.4414) + 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rozpocznij"screenW 0.3587screenH 0.6029screenW 0.4414screenH 0.6549tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) - 1, (screenH 0.6094) - 1, (screenW 0.6501) - 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) + 1, (screenH 0.6094) - 1, (screenW 0.6501) + 1, (screenH 0.6549) - 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) - 1, (screenH 0.6094) + 1, (screenW 0.6501) - 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj", (screenW 0.5688) + 1, (screenH 0.6094) + 1, (screenW 0.6501) + 1, (screenH 0.6549) + 1tocolor(000255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Anuluj"screenW 0.5688screenH 0.6094screenW 0.6501screenH 0.6549tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) - 1, (screenH 0.3568) - 1, (screenW 0.5469) - 1, (screenH 0.3971) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) + 1, (screenH 0.3568) - 1, (screenW 0.5469) + 1, (screenH 0.3971) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) - 1, (screenH 0.3568) + 1, (screenW 0.5469) - 1, (screenH 0.3971) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera", (screenW 0.4553) + 1, (screenH 0.3568) + 1, (screenW 0.5469) + 1, (screenH 0.3971) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca Magazyniera"screenW 0.4553screenH 0.3568screenW 0.5469screenH 0.3971tocolor(19700255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) - 1, (screenH 0.4102) - 1, (screenW 0.5571) - 1, (screenH 0.4466) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) + 1, (screenH 0.4102) - 1, (screenW 0.5571) + 1, (screenH 0.4466) - 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) - 1, (screenH 0.4102) + 1, (screenW 0.5571) - 1, (screenH 0.4466) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy", (screenW 0.4414) + 1, (screenH 0.4102) + 1, (screenW 0.5571) + 1, (screenH 0.4466) + 1tocolor(000255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Opis Pracy"screenW 0.4414screenH 0.4102screenW 0.5571screenH 0.4466tocolor(255255255255), 1.20"default-bold""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Praca polegaj?ca na roznoszeniu paczek z zywno?ci?.\nPo zaniesieniu paczki otrzymamy wynagrodzenie."screenW 0.4451screenH 0.4870screenW 0.5542screenH 0.5404tocolor(255255255255), 1.00"default-bold""center""top"falsefalsefalsefalsefalse)
end

addEventHandler("onClientMarkerHit"praca, function(elmd)
    if el ~= localPlayer then return end
    panel true
    addEventHandler("onClientRender"rootpaneldx)
    showCursor(true)
end)



addEventHandler("onClientResourceStop"resourceRoot, function()
panel false
 setElementData(localPlayer"player:job"false)
end,false,"high")

function isMouseInPosition(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*screenW,cy*screenH
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function klik()
--    if panel == true then
        if isMouseInPosition(screenW 0.3587screenH 0.6029screenW 0.4414screenH 0.6549) and panel == true then
            if not getElementData(localPlayer"player:job"then
                local losuj math.random(2#miejscamagazynier)
                setElementData(localPlayer"player:job"true)
                setPedControlState(localPlayer"walk"true)
                toggleControl("crouch",false)
                toggleControl("jump"false)
                toggleControl("sprint"false)
                setPedAnimation localPlayer"CARRY""crry_prtial"1,true )
                removeEventHandler("onClientRender"rootpaneldx)
                showCursor(false)
                panel false

                local skrzynia createObject(1271000)
                attachElements skrzynialocalPlayer00.80.5)
                
                local cel createMarker(miejscamagazynier[losuj][1], miejscamagazynier[losuj][2], miejscamagazynier[losuj][3]-1.0"checkpoint"1.025500)
                local blip createBlipAttachedTo(cel41)
                
                addEventHandler("onClientMarkerHit"cel, function(elmd)
                    if not md or getElementType(el) ~= "player" then return end
                    if el ~= localPlayer then return end

                    if getPedOccupiedVehicle(elthen
                    exports["lr_noti"]:addNotification("* Nie mo?esz tego od?o?y? b?d?c w poje?dzie.")
                        return
                    end


                    destroyElement(blip)
                    setElementFrozen(eltrue)
                    exports["lr_noti"]:addNotification("* K?adziesz skrzynie, odczekaj 5 sekund.")
                    setTimer(function()
                        setElementFrozen(elfalse)
                        destroyElement(skrzynia)
                        destroyElement(cel)
                        setPedControlState(localPlayer"walk"false)
                        setPedAnimation(localPlayerfalse)
                        toggleControl("jump"true)
                        toggleControl("crouch",true)
                        toggleControl("sprint"true)
                        setElementData(el"player:job"false)
                        if getElementData(el,"player:premium"then
                        exports["lr_noti"]:addNotification("* Od?o?y?e?(a?) skrzyni?. Za od?o?enie skrzynii, otrzymujesz 35$.")
                        triggerServerEvent("givePlayerMoney"el250)
                        setElementData(el,"player:srp"getElementData(el,"player:srp")+math.random(0,1))
                        else
                        exports["lr_noti"]:addNotification("* Od?o?y?e?(a?) skrzyni?. Za od?o?enie skrzynii, otrzymujesz 8$.")
                        triggerServerEvent("givePlayerMoney"el80)
                        setElementData(el,"player:srp"getElementData(el,"player:srp")+math.random(0,1))
                        end
                    end40001)
                end)
            else
                exports["lr_noti"]:addNotification("* Posiadasz aktywn? prac?.")
            end
        elseif isMouseInPosition(screenW 0.5688screenH 0.6094screenW 0.6501screenH 0.6549) and panel == true then
            removeEventHandler("onClientRender"rootpaneldx)
            showCursor(false)
            panel false
            outputChatBox ("okno zamkni?te")
        end
--    end
end
addEventHandler("onClientClick"rootklik)


Postaw piwo autorowi tego posta
 

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


PenkY

Mapper






Wiek: 23
Na forum: 3464 dni
Posty: 223
Nick w MP: penky

Piwa: 2210

Respekt: 472
Respekt: 472

Kalizman, No niestety to samo...

Podpis
Discord: p3nky.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 19:30


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Zr?b Sobie osobny przycisk na 'Anuluj',

addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseInPosition(screenW 0.5688screenH 0.6094screenW 0.6501screenH 0.6549then
        showCursor(false)
        removeEventHandler("onClientRender"rootpaneldx)
        panel false
        end
    end
end)


Jakie? b??dy w /debugscript 3 po naci?ni?ciu w przycisk?

Podpis
Truck soon...
Ostatnio zmieniony przez Ciastuuś 2018-04-01, 20:10, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 20:09


PenkY

Mapper






Wiek: 23
Na forum: 3464 dni
Posty: 223
Nick w MP: penky

Piwa: 2210

Respekt: 472
Respekt: 472

Ciastuu?, Niestety ta opcja te? nie dzia?a.

Podpis
Discord: p3nky.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-01, 20:10


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Jakie? b??dy po naci?ni?ciu w przycisk? /debugscript 3

Podpis
Truck soon...
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 » GUI 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