Jump to content

Why it doesn't move me to DM ?


papam77

Recommended Posts

    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 (player,"gamemode","[gamemodes]/[race]/race", true) 
    setElementDimension (2) 
    outputChatBox ("True") 
        end     
    end 

I wanna be in DM when i click to the button, and i am not...why?

Link to comment

    local dm = { 
    ["dm"]= guiCreateStaticImage(0.157, 0.19, 0.17, 0.305, "images/areny/dm.png", true, arenas, lobby), 
    } 
    guiSetAlpha ( dm["dm"], 0.75 ) 
     
    addCommandHandler( "system", 
    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 ) 
     
    function moveToDM2(button) 
    if button == "left" then 
    setElementData (player,"gamemode","[gamemodes]/[race]/race", true) 
    setElementDimension (2) 
    outputChatBox ("True") 
        end     
    end 
Link to comment

You're trying to make arenas like this? LoL, you really think that it's this simple? You gotta be naive as hell... arenas are thousands of lines of code... learn Lua first, this is totally advanced thing to do and you can't even do setElementDimension correctly.

Link to comment
    local dm = { 
    ["dm"]= guiCreateStaticImage(0.157, 0.19, 0.17, 0.305, "images/areny/dm.png", true, arenas, lobby), 
    } 
    guiSetAlpha ( dm["dm"], 0.75 ) 
     
    addCommandHandler( "system", 
    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 ) 
     
    function moveToDM2(button) 
    if button == "left" then 
    setElementData (player,"gamemode","[gamemodes]/[race]/race", true) 
    setElementDimension (2) 
    outputChatBox ("True") 
        end     
    end 

@CapY

Link to comment
Well, 38 lines aren't enough for sure :lol:

Neither are 300.

    local dm = { 
    ["dm"]= guiCreateStaticImage(0.157, 0.19, 0.17, 0.305, "images/areny/dm.png", true, arenas, lobby), 
    } 
    guiSetAlpha ( dm["dm"], 0.75 ) 
     
    addCommandHandler( "system", 
    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 ) 
     
    function moveToDM2(button) 
    if button == "left" then 
    setElementData (player,"gamemode","[gamemodes]/[race]/race", true) 
    setElementDimension (2) 
    outputChatBox ("True") 
        end     
    end 

@CapY

You forgot to specify the element at setElementDimension and you have an useless "," at the end of the table.

setElementData should be set to a localPlayer.

And this:

 

addCommandHandler( "system", 
    addEventHandler( "onClientMouseEnter", root, 

What the fuck man?

Link to comment
He's trying to make the same thing as FFS/TG, that is a pretty big project.

Well, 38 lines aren't enough for sure :lol:

Are'u stupid lol?

I don't share my full code... You mad bro.

He mean that such a project (multi gamemode) it's prity complex , hard. And you are asking for help for a simpel thing like "setDimension" , it's less probably that you will finish this project, and it can be used.

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...