Jump to content

bad skull

Members
  • Posts

    9
  • Joined

  • Last visited

bad skull's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. entendi sim mano, foi um erro bem besta sksks, obrigado
  2. local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) local showdx = false local randomColors = 0 cor = {} cor2 = {} cor3 = {} cor4 = {} cor5 = {} cor6 = {} cor7 = {} cor8 = {} cor9 = {} function dxbutton() cor[1] = tocolor(255, 255, 255, 255) if isCursorOnElement(x*35, y*410, x*105, y*85) then cor[1] = tocolor(0, 255, 0, 255) if showdx == true then dxDrawRectangle(x*35, y*410, x*105, y*85, cor[1], false) end end end addEventHandler("onClientRender",root,dxbutton) function opendx() if showdx == true then removeEventHandler("onClientRender",root,dxbutton) showCursor(false) showdx = false else addEventHandler("onClientRender",root,dxbutton) showCursor(true) showdx = true end end bindKey("z","down",opendx) ---------------------------------------------------------------------------------------------------------- function isCursorOnElement ( 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 ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end to aprendendo script, fiz um pequeno script de um botao dx, quando o player passa o mause na posicao do botao muda de cor, mais o botao ta invisivel quando aperto a tecla pra abrir, ele só fica visivel quando eu passo o mause em cima da posicão, alguém me ajude?
  3. kkkkkkkkkkkkkkkkkk complicado ....
  4. estou com um pouco de dúvida em algumas funçoes por ex: como funciona o getTickCount como funciona o math.min e como funciona o sistema de "cordenadas" do interpolate between entendi mais ou menos como ele funciona mais ainda tenho umas duvidas eis aqui um exemplo de script q usa os 3 citados acima!, é uma simples janela em dx q abre em efeito de fade, ( me mandaram esse script a alguns dias ) local screenH, screenW = guiGetScreenSize() local x,y = (screenH/1366),(screenW/768) local effect = { alpha = 0, tick = getTickCount(), state = false } function pdx() local progress = math.min((getTickCount()-effect.tick)/3000,1) if effect.state then effect.alpha = interpolateBetween(effect.alpha,0,0,1,0,0,progress,"Linear") else effect.alpha = interpolateBetween(effect.alpha,0,0,0,0,0,progress,"Linear") if progress >= 0.9 then removeEventHandler("onClientRender",root,pdx) end end dxDrawRectangle(x*300,y*221,x*323,y*248,tocolor(0,0,0,255*effect.alpha)) end function abrirdx() effect.state = not effect.state effect.tick = getTickCount() showCursor(effect.state) if effect.state then removeEventHandler("onClientRender",root,pdx) addEventHandler("onClientRender",root,pdx) end end bindKey("x","down",abrirdx) se alguém puder me ajudar vou ficar muito agradecido!, e desculpe tanto post é que aq é o unico lugar q consigo tirar minhas duvidas obs: ja li tudo na wiki! , entendo ela mais ou menos mais n sei ler bem a wiki
  5. n entendi a parte do effect.state e do effect.tick me desculpe kkkkkkkkk, agora eu entendi, tava dentro da tabela, srry
  6. alguém me fala onde estou errando?, o código funciona para abrir o painel dx lentamente ( efeito de fade ) mais pra fechar não funciona, ele fecha direto e quando vou abrir dnv ja abre com o alpha no maximo, me ajudem :c local screenH, screenW = guiGetScreenSize() local x, y = (screenH/1366), (screenW/768) mostrar = false local alpha = 0 -------------------------------------------- function pdx() if mostrar == true then dxDrawRectangle(x * 300, y*221, x*323, y*248, tocolor(0, 0, 0, alpha), false) if alpha < 230 then alpha = alpha + 4 else alpha >= 230 then alpha = alpha - 4 end end end addEventHandler("onClientRender", root, pdx) function abrirdx() if mostrar == false then showCursor(true) mostrar = true addEventHandler("onClientRender", root,pdx) else showCursor(false) mostrar = false removeEventHandler("onClientRender", root, pdx) end end bindKey("x", "down", abrirdx)
  7. como faço pra animar um painel dx?, quando eu apertar uma tecla pra abrir ele abrir com alguma animação esse é meu codigo : local mostrar = false cor = {} function pdx() if mostrar == true then dxDrawRectangle(575, 230, 217, 309, tocolor(11, 11, 11, 178), false) dxDrawRectangle(575, 230, 217, 28, tocolor(21, 21, 21, 255), false) cor [1] = tocolor(0, 0, 0, 255) if isMouseInPosition(631, 369, 104, 29) then cor [1] = tocolor(0, 255, 0, 120) end dxDrawRectangle(631, 369, 104, 29, cor [1], false) dxDrawText("PEGAR", 631, 369, 736, 398, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) dxDrawRectangle(575, 511, 217, 28, tocolor(21, 21, 21, 255), false) end end addEventHandler("onClientRender", root, pdx) function abrirdx() if mostrar == false then showCursor(true) mostrar = true addEventHandler("onClientRender", root,pdx) else showCursor(false) mostrar = false removeEventHandler("onClientRender", root, pdx) end end bindKey("x", "down", abrirdx) 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 ) return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) ) end
  8. esse exemplo ai foi bem mais simples e funcional, vlw amigo
  9. oque posso estar fazendo pra quando um player colocar o mouse em cima de um botao dx ele mudar de cor? ja tentei usar o isMouseInPosition mais sem sucesso, espero q me ajudem :c, sou novo em scripting queria saber também q funções posso estar utilizando pra quando eu abrir meu painel ele abrir com algum tipo de "animação" obs: não tenho interesses em paineis GUI obrigado
×
×
  • Create New...