papam77 Posted July 7, 2013 Share Posted July 7, 2013 Hello, i have problem with lobby i am trying to setElementData ( player, xxxxxxxxxxxxxxxxxxxx) but when i add race to lobby meta then race start before lobby i wanna start race for the local player when he click to the button. How can do it? dm.lua addEvent ("moveToDM", true) 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 function moveToDM2(button) if button == "left" then setElementData (player,"gamemode","[gamemodes]/[race]/race", true) setElementDimension (2) outputChatBox ("You have been move to DM!") playSound ( "sound/click.mp3" ) end end addEventHandler("moveToDM", getRootElement(), moveToDM) Link to comment
iMr.3a[Z]eF Posted July 7, 2013 Share Posted July 7, 2013 Replace this setElementData (player,"gamemode","[gamemodes]/[race]/race", true) with this setElementData (localPlayer,"gamemode","[gamemodes]/[race]/race", true) Link to comment
iMr.3a[Z]eF Posted July 7, 2013 Share Posted July 7, 2013 (edited) Also you missed end for the function "moveToDM" and you put two events for the function "moveToDM2" and you put end under the event "onClientGuiClick" Edited July 7, 2013 by Guest Link to comment
papam77 Posted July 7, 2013 Author Share Posted July 7, 2013 Yes, but race gamemode must be start for move to the race, you can't move to race if race isn't started. And if i start the race it is before lobby. btw: Why event for moveToDM2 ? It work correctly when i click "You have been move to DM!" But only doesn't move me to DM because dm isn't started. Link to comment
iMr.3a[Z]eF Posted July 7, 2013 Share Posted July 7, 2013 In other words, the whole codes are 100% errors Link to comment
denny199 Posted July 7, 2013 Share Posted July 7, 2013 You need to make a costum race, For F*ck Sake don't start a project without knowing what to do. Link to comment
bandi94 Posted July 7, 2013 Share Posted July 7, 2013 Multtgamemode is a singel game mode like race , but he have multiple game's inside. You can't just start race gamemode for one player and for the other one the play gamemode........... You need to recreate the whole gamemode's in one gamemode . Link to comment
ixjf Posted July 7, 2013 Share Posted July 7, 2013 bandi94: No, there are other approaches you can take to do it (there is a very easy one which I once used). papam77: Don't attempt to copy it - you don't have the knowledge for it nor are you going to win a medal for that (even if you ever do it, it will probably be no bug-free thing). 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