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

Wysłany: 2018-03-01, 16:12


manieks78

Lua ;)






Wiek: 25
Na forum: 3387 dni
Posty: 97
Nick w MP: Hexan

Piwa: 5

Respekt: 50

Witam, ostatnio sporo bawi? si? z dx' ami i dzisiaj przychodz? do was z jednym problemem. Chc? tutaj dobrze wyt?umaczy? wszystko, aby unikn?? nieporozumie?. Wygl?da to w taki spos?b, ?e mam skrypt na logowanie do PSP, przebieralnie, panel lidera. Tworz? obecnie panel lidera i spostrzeg?em bardzo okropny dla mnie b??d. Chodzi o to, ?e jak nawet nie mam tych dx' ?w pootwieranych, to i tak je?li klikn? w jakie? miejsce i panelu danego nie wida?, to da mi skina, lub zaloguje. W czym tkwi b??d? Do pokazywania i ukrywania dx'?w u?ywam takiego kodu funkcji kt?r? si? samemu tworzy, tak samo robi? z wykrywaniem czy rzeczywi?cie kursor znajduj? si? na danej pozycji. Za pomoc respekt i piwko psss. zimne :D .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-01, 16:22


Ciastuuś

Truck soon...






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

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Poka? kod ;)

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-01, 16:40


manieks78

Lua ;)






Wiek: 25
Na forum: 3387 dni
Posty: 97
Nick w MP: Hexan

Piwa: 5

Respekt: 50

To jest c_side, z tego co wiem tutaj siedzi ca?y problem
local blip createBlip(-1486.85925763.913337.17936,20)
local zaloguj createMarker(-1486.85925763.913337.17936-0.89,"cylinder",1,27,27,27,130)
local wyloguj createMarker(-1485.67859761.059457.17878-0.89,"cylinder",1,27,27,27,130)
local pojazd createVehicle(407,-1522.22595744.421757.18750)
local pojazd1 createVehicle(544,-1515.65552743.125857.18750)

function start()
    removeEventHandler("onClientResourceStart"rootrender)
    showCursor(false)
end
addEventHandler("onClientResourceStart"getRootElement(), start)

function render()
        dxDrawLine(384 1214 1384 1533tocolor(000255), 1false)
        dxDrawLine(925214 1384 1214 1tocolor(000255), 1false)
        dxDrawLine(384 1533925533tocolor(000255), 1false)
        dxDrawLine(925533925214 1tocolor(000255), 1false)
        dxDrawRectangle(384214541319tocolor(373737255), false)
        dxDrawLine(410 1214 1410 1533tocolor(000255), 1false)
        dxDrawLine(900214 1410 1214 1tocolor(000255), 1false)
        dxDrawLine(410 1533900533tocolor(000255), 1false)
        dxDrawLine(900533900214 1tocolor(000255), 1false)
        dxDrawRectangle(410214490319tocolor(128128128255), false)
        dxDrawImage(557210205221":lss-psp/images/logo.png"000tocolor(255255255255), false)
        dxDrawLine(424 1466 1424 1523tocolor(000255), 1false)
        dxDrawLine(602466 1424 1466 1tocolor(000255), 1false)
        dxDrawLine(424 1523602523tocolor(000255), 1false)
        dxDrawLine(602523602466 1tocolor(000255), 1false)
        dxDrawRectangle(42446617857tocolor(747474255), false)
        dxDrawLine(712 1466 1712 1523tocolor(000255), 1false)
        dxDrawLine(890466 1712 1466 1tocolor(000255), 1false)
        dxDrawLine(712 1523890523tocolor(000255), 1false)
        dxDrawLine(890523890466 1tocolor(000255), 1false)
        dxDrawRectangle(71246617857tocolor(747474255), false)
        dxDrawText("Zaloguj"423465602523tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zamknij"711465890523tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
    end

function logowanie(hitElement)
    if hitElement ~= localPlayer then return end
    showGUI(true)
end
addEventHandler("onClientMarkerHit"zalogujlogowanie)

function wylogowanie(hitElement)
    if hitElement ~= localPlayer then return end
    triggerServerEvent("wyloguj"localPlayer)
end
addEventHandler("onClientMarkerHit"wylogujwylogowanie)

function zamknij(btnstate)
    if btn == "left" and state == "up" then
        if isMouseInPosition(71246617857then
            showGUI(false)
        end
    end
end
addEventHandler("onClientClick"rootzamknij)

function zaloguj(btn,state)
    local tak1 getElementData(localPlayer"mozna:tak")
    if btn == "left" and state == "up" then
        if isMouseInPosition(42446617857then
                showGUI(false)
                triggerServerEvent("zaloguj"localPlayer)
            end
        end

    end

end

addEventHandler("onClientClick"rootzaloguj)

function showGUI(value)
    if value then
        addEventHandler("onClientRender"rootrender)
        showCursor(true)
    else
        removeEventHandler("onClientRender"rootrender)
        showCursor(false)
    end
end

function isMouseInPosition(x,y,width,height)
    if not isCursorShowing() then return false end
    
    local sx,sy guiGetScreenSize()
    local cx,cy getCursorPosition()
    local cx,cy = (cx sx), (cy sy)
    if (cx >= and cx <= width) and (cy >= and cy <= heightthen
        return true
    else
        return false
    end
end


Podpis
Jeśli ci pomogłem wynagrodź mnie ;)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-01, 16:53


Ciastuuś

Truck soon...






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

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Zobacz,

local blip createBlip(-1486.85925763.913337.17936,20)
local zaloguj createMarker(-1486.85925763.913337.17936-0.89,"cylinder",1,27,27,27,130)
local wyloguj createMarker(-1485.67859761.059457.17878-0.89,"cylinder",1,27,27,27,130)
local pojazd createVehicle(407,-1522.22595744.421757.18750)
local pojazd1 createVehicle(544,-1515.65552743.125857.18750)

showGUI false

function start()
    removeEventHandler("onClientResourceStart"rootrender)
    showCursor(false)
end
addEventHandler("onClientResourceStart"getRootElement(), start)

function render()
        dxDrawLine(384 1214 1384 1533tocolor(000255), 1false)
        dxDrawLine(925214 1384 1214 1tocolor(000255), 1false)
        dxDrawLine(384 1533925533tocolor(000255), 1false)
        dxDrawLine(925533925214 1tocolor(000255), 1false)
        dxDrawRectangle(384214541319tocolor(373737255), false)
        dxDrawLine(410 1214 1410 1533tocolor(000255), 1false)
        dxDrawLine(900214 1410 1214 1tocolor(000255), 1false)
        dxDrawLine(410 1533900533tocolor(000255), 1false)
        dxDrawLine(900533900214 1tocolor(000255), 1false)
        dxDrawRectangle(410214490319tocolor(128128128255), false)
        dxDrawImage(557210205221":lss-psp/images/logo.png"000tocolor(255255255255), false)
        dxDrawLine(424 1466 1424 1523tocolor(000255), 1false)
        dxDrawLine(602466 1424 1466 1tocolor(000255), 1false)
        dxDrawLine(424 1523602523tocolor(000255), 1false)
        dxDrawLine(602523602466 1tocolor(000255), 1false)
        dxDrawRectangle(42446617857tocolor(747474255), false)
        dxDrawLine(712 1466 1712 1523tocolor(000255), 1false)
        dxDrawLine(890466 1712 1466 1tocolor(000255), 1false)
        dxDrawLine(712 1523890523tocolor(000255), 1false)
        dxDrawLine(890523890466 1tocolor(000255), 1false)
        dxDrawRectangle(71246617857tocolor(747474255), false)
        dxDrawText("Zaloguj"423465602523tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zamknij"711465890523tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
    end

function logowanie(hitElement)
    if hitElement ~= localPlayer then return end
    showGUI true
    addEventHandler("onClientRender",getRootElement(),render)
end
addEventHandler("onClientMarkerHit"zalogujlogowanie)

function wylogowanie(hitElement)
    if hitElement ~= localPlayer then return end
    triggerServerEvent("wyloguj"localPlayer)
    addEventHandler("onClientRender",getRootElement(),render)
end
addEventHandler("onClientMarkerHit"wylogujwylogowanie)

function zamknij(btnstate)
    if btn == "left" and state == "down" then
     if isMouseInPosition(71246617857then
            showGUI false
            removeEventHandler("onClientRender",getRootElement(),render)
        end
    end
end
addEventHandler("onClientClick"rootzamknij)

function zaloguj(btn,state)
    local tak1 getElementData(localPlayer"mozna:tak")
    if btn == "left" and state == "down" then
     if isMouseInPosition(42446617857then
                showGUI false
                triggerServerEvent("zaloguj"localPlayer)
                removeEventHandler("onClientRender",getRootElement(),render)
            end
        end
    end
end

addEventHandler("onClientClick"rootzaloguj)

function isMouseInPosition(x,y,width,height)
    if not isCursorShowing() then return false end
    
    local sx,sy guiGetScreenSize()
    local cx,cy getCursorPosition()
    local cx,cy = (cx sx), (cy sy)
    if (cx >= and cx <= width) and (cy >= and cy <= heightthen
        return true
    else
        return false
    end
end


Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-01, 17:01


manieks78

Lua ;)






Wiek: 25
Na forum: 3387 dni
Posty: 97
Nick w MP: Hexan

Piwa: 5

Respekt: 50

Poczekaj zaraz sprawdz?.

[ Dodano: 2018-03-01, 17:07 ]
No teraz to nawet markera usun??o, blipa itd.

Podpis
Jeśli ci pomogłem wynagrodź mnie ;)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-01, 17:08


Ciastuuś

Truck soon...






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

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"manieks78" napisał/a:

Poczekaj zaraz sprawdz?.

[ Dodano: 2018-03-01, 17:07 ]
No teraz to nawet markera usun??o, blipa itd.


Mo?e do??cz ca?y kod c i s to Sobie b?d? testowa? bo tak to pisa?em z g?owy

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-01, 17:10


manieks78

Lua ;)






Wiek: 25
Na forum: 3387 dni
Posty: 97
Nick w MP: Hexan

Piwa: 5

Respekt: 50

c-side
local blip createBlip(-1486.85925763.913337.17936,20)
local zaloguj createMarker(-1486.85925763.913337.17936-0.89,"cylinder",1,27,27,27,130)
local wyloguj createMarker(-1485.67859761.059457.17878-0.89,"cylinder",1,27,27,27,130)
local pojazd createVehicle(407,-1522.22595744.421757.18750)
local pojazd1 createVehicle(544,-1515.65552743.125857.18750)

showGUI false

function start()
    removeEventHandler("onClientResourceStart"rootrender)
    showCursor(false)
end
addEventHandler("onClientResourceStart"getRootElement(), start)

function render()
        dxDrawLine(384 1214 1384 1533tocolor(000255), 1false)
        dxDrawLine(925214 1384 1214 1tocolor(000255), 1false)
        dxDrawLine(384 1533925533tocolor(000255), 1false)
        dxDrawLine(925533925214 1tocolor(000255), 1false)
        dxDrawRectangle(384214541319tocolor(373737255), false)
        dxDrawLine(410 1214 1410 1533tocolor(000255), 1false)
        dxDrawLine(900214 1410 1214 1tocolor(000255), 1false)
        dxDrawLine(410 1533900533tocolor(000255), 1false)
        dxDrawLine(900533900214 1tocolor(000255), 1false)
        dxDrawRectangle(410214490319tocolor(128128128255), false)
        dxDrawImage(557210205221":lss-psp/images/logo.png"000tocolor(255255255255), false)
        dxDrawLine(424 1466 1424 1523tocolor(000255), 1false)
        dxDrawLine(602466 1424 1466 1tocolor(000255), 1false)
        dxDrawLine(424 1523602523tocolor(000255), 1false)
        dxDrawLine(602523602466 1tocolor(000255), 1false)
        dxDrawRectangle(42446617857tocolor(747474255), false)
        dxDrawLine(712 1466 1712 1523tocolor(000255), 1false)
        dxDrawLine(890466 1712 1466 1tocolor(000255), 1false)
        dxDrawLine(712 1523890523tocolor(000255), 1false)
        dxDrawLine(890523890466 1tocolor(000255), 1false)
        dxDrawRectangle(71246617857tocolor(747474255), false)
        dxDrawText("Zaloguj"423465602523tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zamknij"711465890523tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
    end

function logowanie(hitElement)
    if hitElement ~= localPlayer then return end
    showGUI true
    addEventHandler("onClientRender",getRootElement(),render)
end
addEventHandler("onClientMarkerHit"zalogujlogowanie)

function wylogowanie(hitElement)
    if hitElement ~= localPlayer then return end
    triggerServerEvent("wyloguj"localPlayer)
    addEventHandler("onClientRender",getRootElement(),render)
end
addEventHandler("onClientMarkerHit"wylogujwylogowanie)

function zamknij(btnstate)
    if btn == "left" and state == "down" then
     if isMouseInPosition(71246617857then
            showGUI false
            removeEventHandler("onClientRender",getRootElement(),render)
        end
    end
end
addEventHandler("onClientClick"rootzamknij)

function zaloguj(btn,state)
    if btn == "left" and state == "down" then
     if isMouseInPosition(42446617857then
                showGUI false
                triggerServerEvent("zaloguj"localPlayer)
                removeEventHandler("onClientRender",getRootElement(),render)
            end
        end
    end
end

addEventHandler("onClientClick"rootzaloguj)

function isMouseInPosition(x,y,width,height)
    if not isCursorShowing() then return false end
    
    local sx,sy guiGetScreenSize()
    local cx,cy getCursorPosition()
    local cx,cy = (cx sx), (cy sy)
    if (cx >= and cx <= width) and (cy >= and cy <= heightthen
        return true
    else
        return false
    end
end

s_side
addEvent("zaloguj"true)
addEventHandler("zaloguj"root, function()
    local acc getAccountName getPlayerAccount source ) )
    if isObjectInACLGroup ("user."..accaclGetGroup "PSP" ) ) then
        setElementDatasource"duty:PSP"true)
        outputChatBox("#272727*#FFFFFFZalogowano cie ".. acc .." na duty...#272727*"source676767,true)
    else
    if open == true then
        outputChatBox("#272727*#FFFFFFNie jeste? pracownikiem frakcji PSP#272727*"source,67,67,67,true)
        if isObjectInACLGroup ("user."..accaclGetGroup "Admin" ) ) then
            outputChatBox("#272727*#FFFFFFZalogowano ci? jako Administratora na duty PSP#272727*",source,255,255,255,true)
end
end
end
end)

addEvent("wyloguj"true)
addEventHandler("wyloguj"root, function()
    local duty getElementData(source,"duty:PSP")
    if duty == true then
        setElementData(source"duty:PSP"false)
        outputChatBox("Wylogowano z duty PSP",source)
    else
        outputChatBox("Nie jestes zalogowany na duty PSP!",source)
    end
end)


[ Dodano: 2018-03-01, 17:35 ]
Pomo?e kto??

Podpis
Jeśli ci pomogłem wynagrodź mnie ;)
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-02, 14:40


SeveNiak







Wiek: 26
Na forum: 4076 dni
Posty: 23

Piwa: 63

Respekt: 70

local blip createBlip(-1486.85925763.913337.17936,20)
local zaloguj createMarker(-1486.85925763.913337.17936-0.89,"cylinder",1,27,27,27,130)
local wyloguj createMarker(-1485.67859761.059457.17878-0.89,"cylinder",1,27,27,27,130)
local pojazd createVehicle(407,-1522.22595744.421757.18750)
local pojazd1 createVehicle(544,-1515.65552743.125857.18750)

showGUI false

function start()
    removeEventHandler("onClientResourceStart"rootrender)
    showCursor(false)
end
addEventHandler("onClientResourceStart"getRootElement(), start)

function render()
    dxDrawLine(384 1214 1384 1533tocolor(000255), 1false)
    dxDrawLine(925214 1384 1214 1tocolor(000255), 1false)
    dxDrawLine(384 1533925533tocolor(000255), 1false)
    dxDrawLine(925533925214 1tocolor(000255), 1false)
    dxDrawRectangle(384214541319tocolor(373737255), false)
    dxDrawLine(410 1214 1410 1533tocolor(000255), 1false)
    dxDrawLine(900214 1410 1214 1tocolor(000255), 1false)
    dxDrawLine(410 1533900533tocolor(000255), 1false)
    dxDrawLine(900533900214 1tocolor(000255), 1false)
    dxDrawRectangle(410214490319tocolor(128128128255), false)
    dxDrawImage(557210205221":lss-psp/images/logo.png"000tocolor(255255255255), false)
    dxDrawLine(424 1466 1424 1523tocolor(000255), 1false)
    dxDrawLine(602466 1424 1466 1tocolor(000255), 1false)
    dxDrawLine(424 1523602523tocolor(000255), 1false)
    dxDrawLine(602523602466 1tocolor(000255), 1false)
    dxDrawRectangle(42446617857tocolor(747474255), false)
    dxDrawLine(712 1466 1712 1523tocolor(000255), 1false)
    dxDrawLine(890466 1712 1466 1tocolor(000255), 1false)
    dxDrawLine(712 1523890523tocolor(000255), 1false)
    dxDrawLine(890523890466 1tocolor(000255), 1false)
    dxDrawRectangle(71246617857tocolor(747474255), false)
    dxDrawText("Zaloguj"423465602523tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Zamknij"711465890523tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
end

function logowanie(hitElement)
    if hitElement ~= localPlayer then return end
    showGUI true
    showCursor(true)
    addEventHandler("onClientRender",getRootElement(),render)
end
addEventHandler("onClientMarkerHit"zalogujlogowanie)

function wylogowanie(hitElement)
    if hitElement ~= localPlayer then return end
    triggerServerEvent("wyloguj"localPlayer)
end
addEventHandler("onClientMarkerHit"wylogujwylogowanie)

function zamknij(btnstate)
    if btn == "left" and state == "down" then
        if logowanie then
            if isMouseInPosition(71246617857then
            showGUI false
            showCursor(false)
            removeEventHandler("onClientRender",getRootElement(),render)
            end
        end
    end
end
addEventHandler("onClientClick"rootzamknij)

function zaloguj(btn,state)
    if btn == "left" and state == "down" then
        if logowanie then
            if isMouseInPosition(42446617857then
            showGUI false
            showCursor(false)
            triggerServerEvent("zaloguj"localPlayer)
            removeEventHandler("onClientRender",getRootElement(),render)
            end
        end
    end
end

addEventHandler("onClientClick"rootzaloguj)

function isMouseInPosition(x,y,width,height)
    if not isCursorShowing() then return false end
    
    local sx,sy guiGetScreenSize()
    local cx,cy getCursorPosition()
    local cx,cy = (cx sx), (cy sy)
    if (cx >= and cx <= width) and (cy >= and cy <= heightthen
        return true
    else
        return false
    end
end


Niewiem czy o to chodzi?o , wi?c je?eli b?dziesz mia? czas to sprawd? i daj zna? :) [c-side]

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
manieks78
Wysłany: 2018-03-03, 20:33


manieks78

Lua ;)






Wiek: 25
Na forum: 3387 dni
Posty: 97
Nick w MP: Hexan

Piwa: 5

Respekt: 50

Dzi?ki! O to mi w?a?nie chodzi?o.

Podpis
Jeśli ci pomogłem wynagrodź mnie ;)
Postaw piwo autorowi tego posta
 

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