local szam = 0-- Ez történik ha lenyomod a gombot:szam = szam + 1
local szam = 0local megnyomva = false-- Lekérdezheted, hogy megnyomta-e már a gombot:if not megnyomva then szam = szam + 1 megnyomva = trueend-- Vagy ha mondjuk 0-ról akarod 1-re, akkor így is lehet:if tonumber(szam) ~= 1 then szam = szam + 1end-- Vagy ha csak egy bizonyos értékre akarod módosítani, akkor:szam = 1
local aktivgomb = 0-- Ha az egyik gombra kattintasz:aktivgomb = 1-- Ha másikraaktivgomb = 2....function szovegRender()if tonumber(aktivgomb) == 1 then Egyik gomb dxdraw szövegeelseif tonumber(aktivgomb) == 2 then Másik gomb dxdraw szövege....endendaddEventHandler(\"onClientRender\", root, szovegRender)
local screenW, screenH = guiGetScreenSize()local font = dxCreateFont( \"font/myriadproregular.ttf\", 11 )local font1 = dxCreateFont( \"font/OpenSansB.ttf\", 12 )local font2 = dxCreateFont( \"font/OpenSans.ttf\", 12 )local monitorSize = {guiGetScreenSize()}local panelSize = {500, 400}local panelX, panelY = monitorSize[1]/2-panelSize[1]/2, monitorSize[2]/2-panelSize[2]/2local mutat = falselocal jelenAblak = 0local gombkatt = 0local megnyomva = falsefunction isCursorOnBox(xS,yS,wS,hS)if(isCursorShowing()) then XY = {guiGetScreenSize()} local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX*XY[1], cursorY*XY[2] if(cursorX >= xS and cursorX <= xS+wS and cursorY >= yS and cursorY <= yS+hS) then return true else return false endend endfunction dobozbaVan(dX, dY, dSZ, dM, eX, eY)if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then return trueelse return falseendend function rajzol()local id = getElementData(localPlayer, \"char:id\")local name = getElementData(localPlayer, \"acc:name\")local admin = getElementData(localPlayer, \"acc:admin\")local penz = getElementData(localPlayer, \"char:money\")local ig_name = getElementData(localPlayer, \"char:name\")local pp = getElementData(localPlayer, \"char:pp\")local skin = getElementData(localPlayer, \"char:skin\")local vehSlot = getElementData(localPlayer, \"char:vehSlot\")local garageSlot = getElementData(localPlayer, \"char:houseSlot\")local jatszottperc = getElementData(localPlayer, \"char:playedTime\")--if show then--addEventHandler(\"onClientClick\", root, semmisem)----else--end --dxDrawText(\"Skin ID:\", panelX+122, panelY+50, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true) -----dxDrawText(\"#d8a84e\"..skin, panelX+220, panelY+50, 400, 400, tocolor(255,255,255), 1, font2, \"center\", \"center\", true, true, true, true) --dxDrawText(\"#d8a84e\"..pp..\"#ffffffPP\", panelX+145, panelY, 400, 400, tocolor(255,255,255), 1, font2, \"center\", \"center\", true, true, true, true) --dxDrawText(\"#4286f4\"..penz..\" #ffffff$\", panelX+260, panelY-50, 400, 400, tocolor(255,255,255), 1, font2, \"center\", \"center\", true, true, true, true) --dxDrawText(\"#4286f4\"..penz..\"#ffffff$\", panelX+260, panelY-50, 400, 400, tocolor(255,255,255), 1, font2, \"center\", \"center\", true, true, true, true) --dxDrawText(\"Admin:\", panelX+120, panelY+100, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true) ----dxDrawText(\"Autó slotok:\", panelX+120, panelY+100, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true) --dxDrawText(\"Játszott percek:\", panelX+190, panelY+150, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true) --dxDrawText(\"#41f48f\"..jatszottperc..\" #ffffffperc\", panelX+380, panelY+150, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true) dxDrawImage(panelX-170, panelY-77, 24, 24, \"image/info.png\", 0, 0, 0, tocolor(255, 255, 255, 200), true) dxDrawImage(panelX+50, panelY-77, 24, 24, \"image/car_garage.png\", 0, 0, 0, tocolor(255, 255, 255, 200), true) dxDrawImage(panelX+260, panelY-77, 24, 24, \"image/admin.png\", 0, 0, 0, tocolor(255, 255, 255, 200), true) dxDrawImage(panelX+476, panelY-77, 24, 24, \"image/settings.png\", 0, 0, 0, tocolor(255, 255, 255, 200), true) --dxDrawImage(panelX-170, panelY-77, 24, 24, \"image/info.png\", 0, 0, 0, tocolor(255, 255, 255, 150), true) dxDrawRectangle((screenW - 847) / 2, (screenH - 481) / 2, 847, 481, tocolor(0, 0, 0, 247), false) --bg dxDrawLine(297 - 1, 173 - 1, 297 - 1, 199, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(498, 173 - 1, 297 - 1, 173 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(297 - 1, 199, 498, 199, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(498, 199, 498, 173 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(512 - 1, 173 - 1, 512 - 1, 199, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(713, 173 - 1, 512 - 1, 173 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(512 - 1, 199, 713, 199, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(713, 199, 713, 173 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(727 - 1, 173 - 1, 727 - 1, 199, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(928, 173 - 1, 727 - 1, 173 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(727 - 1, 199, 928, 199, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(928, 199, 928, 173 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(943 - 1, 173 - 1, 943 - 1, 199, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(1144, 173 - 1, 943 - 1, 173 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(943 - 1, 199, 1144, 199, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(1144, 199, 1144, 173 - 1, tocolor(0, 0, 0, 255), 1, false) --dxDrawText(\"\", 89, 383, 180, 444, tocolor(255, 255, 255, 255), 1.00, \"default\", \"left\", \"top\", false, false, false, false, false) --dxDrawText(\"\", 89, 383, 180, 444, tocolor(255, 255, 255, 255), 1.00, \"default\", \"left\", \"top\", false, false, false, false, false) --dxDrawText(\"\", 89, 383, 180, 444, tocolor(255, 255, 255, 255), 1.00, \"default\", \"left\", \"top\", false, false, false, false, false) informat = dxDrawRectangle(panelX-173, panelY-77, 201, 26, tocolor(0, 0, 0, 195)) vagyonos = dxDrawRectangle(panelX+42, panelY-77, 201, 26, tocolor(0, 0, 0, 195), false) --2. gomb adminyok = dxDrawRectangle(panelX+257, panelY-77, 201, 26, tocolor(0, 0, 0, 195), false) --3. gomb beall = dxDrawRectangle(panelX+473, panelY-77, 201, 26, tocolor(0, 0, 0, 195), false) --4. gomb dxDrawImage(panelX-145, panelY-10, 128, 256, \"files/Skinek/\"..getElementModel(localPlayer)..\".jpg\", 0, 0, 0, tocolor(255, 255, 255, 255)) ---<[ Skin kép ]>--- dxDrawImage(panelX-151, panelY-17, 256, 512, \"files/Skinek/frame.png\", 0, 0, 0, tocolor(0, 0, 0, 255)) ---<[ Skin kép ]>---if gombkatt == 1 then dxDrawText(\"Név:\", panelX+100, panelY-100, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true) elseif gombkatt == 2 then dxDrawText(\"#d8a84e\"..ig_name, panelX+200, panelY-100, 400, 400, tocolor(255,255,255), 1, font2, \"center\", \"center\", true, true, true, true) elseif gombkatt == 3 thendxDrawText(\"Készpénz:\", panelX+143, panelY-50, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true) elseif gombkatt == 4 thendxDrawText(\"PP:\", panelX+88, panelY, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true) end if(isCursorOnBox(panelX-173, panelY-77, 201, 26)) then dxDrawRectangle(panelX-173, panelY-77, 201, 26, tocolor(60, 114, 201), false)endif(isCursorOnBox(panelX+42, panelY-77, 201, 26)) then dxDrawRectangle(panelX+42, panelY-77, 201, 26, tocolor(60, 114, 201), false) --2. gombendif(isCursorOnBox(panelX+257, panelY-77, 201, 26)) then dxDrawRectangle(panelX+257, panelY-77, 201, 26, tocolor(60, 114, 201), false) --3. gombendif(isCursorOnBox(panelX+473, panelY-77, 201, 26)) then dxDrawRectangle(panelX+473, panelY-77, 201, 26, tocolor(60, 114, 201), false) --4. gombend end -------------------------Klikkelések----------------------------------- function menuClick(gomb,stat,x,y)if jelenAblak == 1 then if megnyomva then if gomb == \"left\" and stat == \"down\" then if (dobozbaVan(panelX+473, panelY-77, 201, 26, x, y)) then gombkatt = gombkatt + 1 elseif (dobozbaVan(panelX+257, panelY-77, 201, 26, x, y)) then gombkatt = gombkatt + 2 elseif (dobozbaVan(panelX+42, panelY-77, 201, 26, x, y)) then gombkatt = gombkatt + 3 elseif (dobozbaVan(panelX-173, panelY-77, 201, 26, x, y)) then gombkatt = gombkatt + 4 end end endendend bindKey(\"home\", \"down\", function()addEventHandler(\"onClientRender\", root, rajzol)toggleControl(\"change_camera\",false)if tonumber(jelenAblak) ~= 1 thenjelenAblak = jelenAblak + 1end addEventHandler(\"onClientClick\", root, menuClick) end) bindKey(\"backspace\", \"down\", function()if tonumber(jelenAblak) ~= 0 thenjelenAblak = jelenAblak - 1endremoveEventHandler(\"onClientRender\", root, rajzol)toggleControl(\"change_camera\",true)end)
if (dobozbaVan(panelX+473, panelY-77, 201, 26, x, y)) thengombkatt = 1elseif (dobozbaVan(panelX+257, panelY-77, 201, 26, x, y)) thengombkatt = 2elseif (dobozbaVan(panelX+42, panelY-77, 201, 26, x, y)) thengombkatt = 3elseif (dobozbaVan(panelX-173, panelY-77, 201, 26, x, y)) thengombkatt = 4end