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

Wysłany: 2020-03-28, 09:39


AsaXx







Wiek: 20
Na forum: 2412 dni
Posty: 74
Nick w MP: AsaXx

Piwa: 413

Respekt: 50

Cze??. To znowu ja. Wgra?em sobie na serwer tuner, ale kiedy klikam, ?eby zmieni? kolor to odpala mi si? panel pomocy. Jakie? pomys?y jak to naprawi??

EDIT: Okaza?o si?, ?e jak w??cz? kursor i klikn? w jedno miejsce, to te? si? pojawi.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-28, 09:46


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Poka? kod. Pewnie u?ywasz funkcji isCursorOnElement bez sprawdzenia, czy np. panel pomocy jest wy?wietlany.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-28, 10:25


AsaXx







Wiek: 20
Na forum: 2412 dni
Posty: 74
Nick w MP: AsaXx

Piwa: 413

Respekt: 50

Tak. Te? do tego doszed?em, ale nie bardzo wiem jak to naprawi?.
Kod:
--+--------------------------------------+--
--| SkryptDashboard                     |--
--| DlaOneRPG                          |--
--| AutorAsaXx                           |--
--+--------------------------------------+--

screenWscreenH guiGetScreenSize()
sx,syguiGetScreenSize()
px,py=(sx/1280), (sy/720)

panel false

kursor false

srp getElementData(localPlayer"player:srp")

id getElementData(localPlayer"id")

name getPlayerName(localPlayer)

lvl getElementData(localPlayer"player:lvl")

sid getElementData(localPlayer"player:sid")

frakcja getElementData(localPlayer"player:faction")

local sw,sh guiGetScreenSize()
local scale 1280 sw

function isMouseInPosition xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    
    return ( ( cx >= and cx <= width ) and ( cy >= and cy <= height ) )
end


local font3 dxCreateFont("f/Roboto-Regular.ttf"12)
local font4 dxCreateFont("f/Roboto-Regular.ttf"10)
local font5 dxCreateFont("f/Roboto-Medium.ttf"10)
local font6 dxCreateFont("f/Roboto-Medium.ttf"14)

function dashboard()
-- G?RA
    dxDrawRectangle(375/scale150/scale725/scale450/scaletocolor(121212245), false)
    dxDrawRectangle(175/scale100/scale200/scale500/scaletocolor(171717245), false)
    dxDrawRectangle(375/scale100/scale725/scale50/scaletocolor(171717245), false)
-- PRZYCIEMNIENIE
    if isMouseInPosition(175/scale160/scale200/scale50/scalethen 
        dxDrawRectangle(175/scale160/scale200/scale50/scaletocolor(171717245), false)
    elseif isMouseInPosition(175/scale210/scale200/scale50/scalethen 
        dxDrawRectangle(175/scale210/scale200/scale50/scaletocolor(171717245), false)
    elseif isMouseInPosition(175/scale260/scale200/scale50/scalethen 
        dxDrawRectangle(175/scale260/scale200/scale50/scaletocolor(171717245), false)
    elseif isMouseInPosition(175/scale310/scale200/scale50/scalethen 
        dxDrawRectangle(175/scale310/scale200/scale50/scaletocolor(171717245), false)
    end
-- PANEL BOCZNY
    dxDrawText("Panel pomocy"210/scale, -200/scale950/scale450/scaletocolor(188200204a), 1.00font6"left""center"falsefalsefalsefalsefalse)
    dxDrawImage(187/scale175/scale25/scale25/scale"i/chmura.png")
    dxDrawText("Strona g??wna"230/scale, -75/scale950/scale450/scaletocolor(188200204a), 1.00font4"left""center"falsefalsefalsefalsefalse)
--   dxDrawImage(187/scale220/scale25/scale25/scale"i/user.png")
--    dxDrawText("Gracz"230/scale25/scale950/scale450/scaletocolor(188200204a), 1.00font4"left""center"falsefalsefalsefalsefalse)
    dxDrawImage(184/scale220/scale33/scale33/scale"i/pytanie.png")
    dxDrawText("Jak zacz???"230/scale25/scale950/scale450/scaletocolor(188200204a), 1.00font4"left""center"falsefalsefalsefalsefalse)
    dxDrawImage(187/scale270/scale25/scale25/scale"i/gwiazda.png")
    dxDrawText("Ranga Premium+"230/scale125/scale950/scale450/scaletocolor(188200204a), 1.00font4"left""center"falsefalsefalsefalsefalse)
    dxDrawImage(190/scale323/scale25/scale25/scale"i/komendy.png")
    dxDrawText("Komendy"230/scale225/scale950/scale450/scaletocolor(188200204a), 1.00font4"left""center"falsefalsefalsefalsefalse)
-- STRONA G??WNA
    dxDrawText("4 edycja serwera One RPG wprowadza wiele nowych oraz innowacyjnych funkcji oraz system?w. \nSerwer jest tworzony z my?l? o graczach, kt?rzy szukaj? nowoczesnej rozgrywki. \nG??wna akcja serwera dzieje si? w mie?cie San Fierro."1350/scale400/scale100/scale100/scaletocolor(188200204a), 1.00font4"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Za?o?yciele:\n\nkrzysiek3006,\nBlAcK,\nAsaXx"400/scale575/scale950/scale450/scaletocolor(188200204a), 1.00font4"left""center"falsefalsefalsefalsefalse)
    dxDrawText("Odno?niki:\n\nDiscord: https://discord.gg/cEJGfMB"800/scale550/scale950/scale450/scaletocolor(188200204a), 1.00font4"left""center"falsefalsefalsefalsefalse)

end

function uruchom2(elmd)n
    if isMouseInPosition(175/scale160/scale200/scale50/scalethen 
        removeEventHandler("onClientRender"rootkom)
        removeEventHandler("onClientRender"rootjak2)
        removeEventHandler("onClientRender"rootpremium)
        addEventHandler("onClientRender"rootdashboard)
    end
end
addEventHandler("onClientClick"rooturuchom2)

function uruchom3(elmd)
    if isMouseInPosition(175/scale210/scale200/scale50/scalethen 
        removeEventHandler("onClientRender"rootdashboard)
        removeEventHandler("onClientRender"rootkom)
        removeEventHandler("onClientRender"rootpremium)
        addEventHandler("onClientRender"rootjak2) 
    end 
end
addEventHandler("onClientClick"rooturuchom3)

function uruchom4(elmd)
    if isMouseInPosition(175/scale260/scale200/scale50/scalethen 
        removeEventHandler("onClientRender"rootdashboard)
        removeEventHandler("onClientRender"rootjak2)
        removeEventHandler("onClientRender"rootkom)
        addEventHandler("onClientRender"rootpremium)
    end
end
addEventHandler("onClientClick"rooturuchom4)


function uruchom5(elmd)
    if isMouseInPosition(175/scale310/scale200/scale50/scalethen 
        removeEventHandler("onClientRender"rootdashboard)
        removeEventHandler("onClientRender"rootjak2)
        removeEventHandler("onClientRender"rootpremium)
        addEventHandler("onClientRender"rootkom)
    end
end
addEventHandler("onClientClick"rooturuchom5)

function uruchom(el ,md)
    if panel == false then
        addEventHandler("onClientRender"rootdashboard)
        panel true
        showCursor(true)
        showChat(false)
    else
        panel false
        showChat(true)
        showCursor(false)
        removeEventHandler("onClientRender"rootdashboard)
        removeEventHandler("onClientRender"rootjak2)
        removeEventHandler("onClientRender"rootpremium)
        removeEventHandler("onClientRender"rootkom)
    end
end
bindKey("f1""down"uruchom)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-28, 10:34


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Podczas funkcji isMouseInPosition sprawdzaj r?wnie? czy zmienna 'panel' zwraca warto?? 'true'.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-28, 16:10


AsaXx







Wiek: 20
Na forum: 2412 dni
Posty: 74
Nick w MP: AsaXx

Piwa: 413

Respekt: 50

Dzi?kuj?, dzia?a

Postaw piwo autorowi tego posta
 

 
Tagi: otwierające :: się :: 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 » Otwierające się 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