Szerző Téma: Dashboard, kattintás  (Megtekintve 351 alkalommal)

Dashboard, kattintás
« Dátum: 2017. Február 19. - 11:38:47 »
0 Show voters
Sziasztok! Egy dashboard készítése közben elakadtam! Nem sikerült megcsinálnom, hogy csak akkor tudjak rákattintani a gombra, ha a dashboard elővan hozva és minden gombnál más dolgot hozzon elő. Tudna valaki segíteni?
 

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]/2
local mutat = false
local jelenAblak = 0
function 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
   end
end   
end
function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
   return true
else
   return false
end
end
 
 
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(\"Név:\", panelX+100, panelY-100, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true)         
   dxDrawText(\"#d8a84e\"..ig_name, panelX+200, panelY-100, 400, 400, tocolor(255,255,255), 1, font2, \"center\", \"center\",  true, true, true, true)         
   dxDrawText(\"Készpénz:\", panelX+143, panelY-50, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true)         
   dxDrawText(\"PP:\", panelX+88, panelY, 400, 400, tocolor(255,255,255), 1, font1, \"center\", \"center\", true, true, true, true)         
   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)
      dxDrawRectangle(panelX-173, panelY-77, 201, 26, tocolor(0, 0, 0, 195))
      dxDrawRectangle(panelX+42, panelY-77, 201, 26, tocolor(0, 0, 0, 195), false) --2. gomb
      dxDrawRectangle(panelX+257, panelY-77, 201, 26, tocolor(0, 0, 0, 195), false) --3. gomb
      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(isCursorOnBox(panelX-173, panelY-77, 201, 26)) then   
dxDrawRectangle(panelX-173, panelY-77, 201, 26, tocolor(60, 114, 201), false)
end
if(isCursorOnBox(panelX+42, panelY-77, 201, 26)) then   
dxDrawRectangle(panelX+42, panelY-77, 201, 26, tocolor(60, 114, 201), false) --2. gomb
end
if(isCursorOnBox(panelX+257, panelY-77, 201, 26)) then   
dxDrawRectangle(panelX+257, panelY-77, 201, 26, tocolor(60, 114, 201), false) --3. gomb
end
if(isCursorOnBox(panelX+473, panelY-77, 201, 26)) then   
dxDrawRectangle(panelX+473, panelY-77, 201, 26, tocolor(60, 114, 201), false) --4. gomb
end
 
end
 

function as()
end
 
 
-------------------------Klikkelések-----------------------------------      
   
function menuClick(gomb,stat,x,y)
if jelenAblak == 1 then
if gomb == \"left\" and stat == \"down\" then

if (dobozbaVan(panelX+473, panelY-77, 201, 26, x, y)) then
   outputChatBox(\"#ffffffSettings-re kattoltál!\", 124, 197, 118, true)
end
if (dobozbaVan(panelX+257, panelY-77, 201, 26, x, y)) then
   outputChatBox(\"#ffffffAdmin-ra kattoltál!\", 124, 197, 118, true)
end
if (dobozbaVan(panelX+42, panelY-77, 201, 26, x, y)) then
   outputChatBox(\"#ffffffVagyon-ra kattoltál!\", 124, 197, 118, true)
end
if (dobozbaVan(panelX-173, panelY-77, 201, 26, x, y)) then
   outputChatBox(\"#ffffffInfo-ra kattoltál!\", 124, 197, 118, true)
end
end
end


end
 
addEventHandler(\"onClientClick\", root, menuClick)
 
   
bindKey(\"home\", \"down\", function()
addEventHandler(\"onClientRender\", root, rajzol)
toggleControl(\"change_camera\",false)
jelenAblak = jelenAblak + 1
addEventHandler(\"onClientClick\", root, menuClick)
 
end)
 
bindKey(\"backspace\", \"down\", function()
--JelenAblak = JelenAblak - 1
removeEventHandler(\"onClientRender\", root, rajzol)
toggleControl(\"change_camera\",true)
end)

 
 

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal