papam77 Posted June 23, 2013 Share Posted June 23, 2013 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
EstrategiaGTA Posted June 23, 2013 Share Posted June 23, 2013 What's does the debugscript 3 say? Link to comment
xXMADEXx Posted June 23, 2013 Share Posted June 23, 2013 function moveToDM2(button) if button == "left" then setElementData (localPlayer,"gamemode","[gamemodes]/[race]/race", true) setElementDimension (localPlayer,2) outputChatBox ("True") end end Link to comment
papam77 Posted June 23, 2013 Author Share Posted June 23, 2013 It doesn't move me to DM. Link to comment
iMr.3a[Z]eF Posted June 23, 2013 Share Posted June 23, 2013 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
MIKI785 Posted June 23, 2013 Share Posted June 23, 2013 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
CapY Posted June 23, 2013 Share Posted June 23, 2013 You gotta be naive as hell... arenas are thousands of lines of code... Not really. Link to comment
MIKI785 Posted June 23, 2013 Share Posted June 23, 2013 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 Link to comment
iMr.3a[Z]eF Posted June 23, 2013 Share Posted June 23, 2013 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
CapY Posted June 23, 2013 Share Posted June 23, 2013 Well, 38 lines aren't enough for sure 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
papam77 Posted June 24, 2013 Author Share Posted June 24, 2013 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 Are'u stupid lol? I don't share my full code... You mad bro. Link to comment
bandi94 Posted June 24, 2013 Share Posted June 24, 2013 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 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now