Jump to content

What's wrong??


papam77

Recommended Posts

    -- Move To DD !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
        function moveToDD() 
        local dd = { 
     ["dd"]= guiCreateStaticImage(0.331, 0.19, 0.17, 0.305, "images/areny/dd.png", true, arenas, lobby), 
    } 
    guiSetAlpha ( dd["dd"], 0.75 ) 
     
    addEventHandler( "onClientMouseEnter", root, 
    function(aX, aY) 
    for key,gui in pairs (dd) do 
              if gui == source then 
                  guiSetAlpha ( source, 1 ) 
                  playSound("sound/btn.mp3") 
                  return 
              end 
        end 
    end 
    ) 
    
    addEventHandler( "onClientMouseLeave", root, 
    function(aX, aY) 
    for key,gui in pairs (dd) do 
              if gui == source then 
              guiSetAlpha ( source, 0.75 ) 
                  return 
              end 
        end 
    end 
    ) 
     
    addEventHandler ( "onClientGUIClick", dd["dd"], moveToDD, false ) 
    end 
    addCommandHandler( "system", moveToDD ) 
    function moveToDD2(button) 
    if button == "left" then 
    setElementData (localPlayer,"gamemode","dd", true) 
    setElementDimension (localPlayer,3) 
        outputChatBox ("True") 
    end     
end 
  

When i am clicking to it button has bigger and bigger alpha, but why?

This is DM but this works correct.

    -- Move To DM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    function moveToDM() 
    local dm = { 
    ["dm"]= guiCreateStaticImage(0.157, 0.19, 0.17, 0.305, "images/areny/dm.png", true, arenas, lobby), 
    } 
    guiSetAlpha ( dm["dm"], 0.75 ) 
     
    addEventHandler( "onClientMouseEnter", root, 
    function(aX, aY) 
    for key,gui in pairs (dm) do 
              if gui == source then 
                  guiSetAlpha ( source, 1 ) 
                  playSound("sound/btn.mp3") 
                  return 
              end 
        end 
    end 
    ) 
    
    addEventHandler( "onClientMouseLeave", root, 
    function(aX, aY) 
    for key,gui in pairs (dm) do 
              if gui == source then 
              guiSetAlpha ( source, 0.75 ) 
                  return 
              end 
        end 
    end 
    ) 
     
    addEventHandler ( "onClientGUIClick", dm["dm"], moveToDM2, false ) 
    end 
    addCommandHandler( "system", moveToDM ) 
   function moveToDM2(button) 
    if button == "left" then 
    setElementData (localPlayer,"gamemode","race", true) 
        setElementDimension (localPlayer,2) 
        outputChatBox ("True") 
    end     
end 
  

Link to comment

Try:

dd = { }  
dd["dd"]= guiCreateStaticImage(0.331, 0.19, 0.17, 0.305, "images/areny/dd.png", true, arenas, lobby) 
guiSetAlpha ( dd["dd"], 0.75 ) 
  
addEventHandler( "onClientMouseEnter", root, function ( ) 
    if ( source == dd["dd"] ) then 
        guiSetAlpha ( source, 1 ) 
        playSound("sound/btn.mp3") 
    end 
end ) 
  
addEventHandler( "onClientMouseLeave", dd["dd"], function( ) 
    guiSetAlpha ( source, 0.75 ) 
end ) 
  
addEventHandler ( "onClientGUIClick", dd["dd"], moveToDD, false ) 
  
function moveToDD2(button) 
    if button == "left" then 
        setElementData (localPlayer,"gamemode","dd", true) 
        setElementDimension (localPlayer,3) 
        outputChatBox ("True") 
    end     
end 
  

Edited by Guest
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...