Jump to content

Why it doesn't move me to DM ?


papam77

Recommended Posts

Posted
    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?

Posted

    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 

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted

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.

Lua Scripter

?ucet=miki_cz

Owner of mshost.cz MTA portal.

Posted
    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

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted
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?

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

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

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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