-
Sziasztok! Van egy dxDrawRectlange gombom. onClientClick event handlert, illeve egy function is csináltam már, amibe beleírtam, hol a box, viszont sajnálatos módon nem érzékeli, miért lehet ez? Illetve van egy IsCursorInPosition function-om is, ami annyit csinál, ha valaki ráteszi az egeret szin1-ről szin 2-re változik, majd ha valaki elveszi, akkor vissza. Ez se működik, sőt, még a rectlange is eltűnik.
addEventHandler(\"onClientRender\", root,
function()
dxDrawRectangle((screenW - 243) / 2, (screenH - 353) / 2, 243, 353, tocolor(0, 0, 0, 110), false)
dxDrawRectangle(562, 208, 243, 17, tocolor(0, 0, 0, 110), false)
dxDrawRectangle(574, 259, 221, 30, tocolor(0, 0, 0, 130), false)
dxDrawRectangle(574, 311, 221, 30, tocolor(0, 0, 0, 130), false)
dxDrawRectangle(574, 385, 221, 30, tocolor(0, 0, 0, 130), false)
dxDrawRectangle(574, 429, 221, 30, (isCursorInPosition(574, 429, 221, 30) and tocolor(255, 0, 0) or tocolor(0, 255, 0)))
dxDrawText(\"Üdv az #4286f4Immortal Gaming #ffffffszerverén!\\nKérlek #ff6363 regisztrálj #ffffff vagy #4286f4jelentkezz be!\\n\\n#ffffffTovábbi jó játékot kívánunk!\", 576, 481, 795, 533, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, true, false)
dxDrawRectangle(438, 451, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText(\"#4286f4Bejelentkezés\", 562, 208, 805, 224, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, true, false)
dxDrawText(\"Felhasználónév\", 620, 240, 746, 259, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"Jelszó\", 620, 292, 746, 311, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"Bejelentkezés\", 620, 390, 746, 409, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"Regisztráció\", 620, 435, 746, 454, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, false, false)
showPlayerHudComponentVisible(\"all\", false)
end
)
addEventHandler(\"onClientClick\", getRootElement(), onClickCucc)
function onClickCucc(absoluteX, absoluteY, worldX, worldY, worldZ)
if (absoluteX >= 574) and (absoluteX <= 574+221) and (absoluteY >= 311) and (absoluteY <= 311+30) then
outputChatBox(\"Ráböktél a gombra\")
end
if (absoluteX >= x) and (absoluteX <= x+szelesseg) and (absoluteY >= y) and (absoluteY <= y+magassag) then
outputChatBox(\"Ráböktél a másk gombra\")
end
end
function isCursorInPosition(rectX, rectY, rectW, rectH)
local cursorX, cursorY = getCursorPosition()
cursorX, cursorY = cursorX * screenWidth, cursorY * screenHeight
return (cursorX >= rectX and cursorX <= rectX+rectW) and (cursorY >= rectY and cursorY <= rectY+rectH)
end
-
Az IsCursorInPosition megoldódott, viszont sajnos a kattintás nem.
addEventHandler(\"onClientRender\", root,
function()
dxDrawRectangle((screenW - 243) / 2, (screenH - 353) / 2, 243, 353, tocolor(0, 0, 0, 110), false)
dxDrawRectangle(562, 208, 243, 17, tocolor(0, 0, 0, 110), false)
dxDrawRectangle(574, 259, 221, 30, tocolor(0, 0, 0, 130), false)
dxDrawRectangle(574, 311, 221, 30, tocolor(0, 0, 0, 130), false)
dxDrawRectangle(574, 385, 221, 30, (isCursorInPosition(574, 385, 221, 30) and tocolor(66, 134, 244, 130) or tocolor(0, 0, 0, 130)))
dxDrawRectangle(574, 429, 221, 30, (isCursorInPosition(574, 429, 221, 30) and tocolor(244, 65, 65, 130) or tocolor(0, 0, 0, 130)))
dxDrawText(\"Üdv az #4286f4Immortal Gaming #ffffffszerverén!\\nKérlek #ff6363 regisztrálj #ffffff vagy #4286f4jelentkezz be!\\n\\n#ffffffTovábbi jó játékot kívánunk!\", 576, 481, 795, 533, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, true, false)
dxDrawRectangle(438, 451, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText(\"#4286f4Bejelentkezés\", 562, 208, 805, 224, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, true, false)
dxDrawText(\"Felhasználónév\", 620, 240, 746, 259, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"Jelszó\", 620, 292, 746, 311, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"Bejelentkezés\", 620, 390, 746, 409, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, false, false)
dxDrawText(\"Regisztráció\", 620, 435, 746, 454, tocolor(255, 255, 255, 255), 1.00, \"default-bold\", \"center\", \"center\", false, false, false, false, false)
showPlayerHudComponentVisible(\"all\", false)
addEventHandler(\"onClientClick\", getRootElement(), onClickCucc)
end
)
function isCursorInPosition(rectX, rectY, rectW, rectH)
local cursorX, cursorY = getCursorPosition()
cursorX, cursorY = cursorX * screenWidth, cursorY * screenHeight
return (cursorX >= rectX and cursorX <= rectX+rectW) and (cursorY >= rectY and cursorY <= rectY+rectH)
end
function onClickCucc(button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement)
if (state == \"down\") then
if (absoluteX >= 574) and (absoluteX <= 574+221) and (absoluteY >= 385) and (absoluteY <= 385+30) then
outputChatBox(\"Ráböktél a gombra\")
end
end
end
-
addEventHandler(\"onClientRender\", root,
function()
dxDrawRectangle((screenW - 243) / 2, (screenH - 353) / 2, 243, 353, tocolor(0, 0, 0, 110), false)
dxDrawRectangle(562, 208, 243, 17, tocolor(0, 0, 0, 110), false)
dxDrawRectangle(574, 259, 221, 30, tocolor(0, 0, 0, 130), false)
dxDrawRectangle(574, 311, 221, 30, tocolor(0, 0, 0, 130), false)
dxDrawRectangle(574, 385, 221, 30, tocolor(0, 0, 0, 130), false)
dxDrawRectangle(574, 429, 221, 30, (isCursorInPosition(574, 429, 221, 30) and tocolor(255, 0, 0) or tocolor(0, 255, 0)))
dxDrawText(\"Üdv az #4286f4Immortal Gaming #ffffffszerverén!\\nKérlek #ff6363 regisztrálj #ffffff vagy #4286f4jelentkezz be!\\n\\n#ffffffTovábbi jó játékot kívánunk!\", 576, 481, 795, 533, tocolor(255, 255, 255, 255), 1.00,