Jump to content

[ RESOLVIDO ] Alpha Dx


Recommended Posts

Galera é o seguinte, estou querendo que o dx fique piscando, diminuindo o alpha e aumentando , porem não estou conseguindo , qual é o problema?

fadeIn = false 
textAlpha = 255 
font = "bankgothic" 
function dxchat() 
        dxDrawBorderedText(""..getPlayerName(localPlayer).." Está assaltando a loja", 197, 215, 197, 383, tocolor(255, 255, 255, textAlpha),1.00, font) 
         dxDrawRectangle(168, 203, 468, 62, tocolor(0, 0, 0, 109), false) 
    end 
  
     
function abrirchat() 
addEventHandler ("onClientRender", root, dxchat) 
  if fadeIn == false then 
    textAlpha = textAlpha - 7 
  elseif fadeIn == true then 
    textAlpha = textAlpha + 7 
  end 
  checkAlpha() 
    setTimer(function() 
        removeEventHandler ("onClientRender", root, dxchat) 
    end, 20000, 1 ) 
  
end 
addEvent ("limparchat", true) 
addEventHandler ("limparchat", root, abrirchat) 
  
function checkAlpha() 
  if textAlpha < 130 then 
    fadeIn = true 
  elseif textAlpha >= 247 and textAlpha <= 255 and fadeIn == true then 
    fadeIn = false 
  end 
end 
  
function dxDrawBorderedText(text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI) 
  dxDrawText(text, x - 2, y - 2, w - 2, h - 2, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false) 
  dxDrawText(text, x + 2, y - 2, w + 2, h - 2, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false) 
  dxDrawText(text, x - 2, y + 2, w - 2, h + 2, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false) 
  dxDrawText(text, x + 2, y + 2, w + 2, h + 2, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false) 
  dxDrawText(text, x - 1, y, w - 1, h, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false) 
  dxDrawText(text, x + 1, y, w + 1, h, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false) 
  dxDrawText(text, x, y - 1, w, h - 1, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false) 
  dxDrawText(text, x, y + 1, w, h + 1, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, false) 
  dxDrawText(text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI) 
end 

Edited by Guest
Link to comment
function dxchat() 
    dxDrawBorderedText(""..getPlayerName(localPlayer).." Está assaltando a loja", 197, 215, 197, 383, tocolor(255, 255, 255, textAlpha),1.00, font) 
    dxDrawRectangle(168, 203, 468, 62, tocolor(0, 0, 0, 109), false) 
      
    if fadeIn == false then 
        textAlpha = textAlpha - 7 
    elseif fadeIn == true then 
        textAlpha = textAlpha + 7 
    end 
     
    checkAlpha() 
end 

Link to comment
function dxchat() 
    dxDrawBorderedText(""..getPlayerName(localPlayer).." Está assaltando a loja", 197, 215, 197, 383, tocolor(255, 255, 255, textAlpha),1.00, font) 
    dxDrawRectangle(168, 203, 468, 62, tocolor(0, 0, 0, 109), false) 
      
    if fadeIn == false then 
        textAlpha = textAlpha - 7 
    elseif fadeIn == true then 
        textAlpha = textAlpha + 7 
    end 
     
    checkAlpha() 
end 

isso mesmo que eu fiz, nao mudou em nada :cry:

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...