papam77 Posted April 29, 2013 Share Posted April 29, 2013 Hey, i have gamemode called [lobby] and i made functions for move to next gamemode called [race] GUIEditor = { button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.button[1] = guiCreateButton(0.44, 0.31, 0.15, 0.24, "", true, player,"gamemode","race",true) end ) Why it can't join to race ? Link to comment
PaiN^ Posted April 29, 2013 Share Posted April 29, 2013 Read the wiki !! There is no argument for gamemode with the function guiCreateButton . Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 Read the wiki !!There is no argument for gamemode with the function guiCreateButton . Now GUIEditor = { button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.button[1] = setElementData, guiCreateButton (0.44, 0.31, 0.15, 0.24, "",true, player,"gamemode","deathmatch",true) end ) I added but still nothing Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 This make no sense at all you have to use it when player click it using : onClientGUIClick . Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 This make no sense at all you have to use it when player click it using : onClientGUIClick . GUIEditor = { button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.button[1] = setElementData, guiCreateButton ("onClientGUIClick", 0.44, 0.31, 0.15, 0.24, "", true, player,"gamemode","deathmatch",true) end ) And now i can't see button Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 You didn't understand what i said above . Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 You didn't understand what i said above . I never made buttons Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 Try this and tell me if it output or no . GUIEditor = { button = {} } addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor.button[1] = guiCreateButton ( 0.44, 0.31, 0.15, 0.24, "",true ) addEventHandler("onClientGUIClick",GUIEditor.button[1],Click,false) end ) function Click( ) setElementData(localPlayer,"gamemode","deathmatch",true) outputChatBox( "* Data True !!",0,255,0 ) end Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 Try this and tell me if it output or no . GUIEditor = { button = {} } addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor.button[1] = guiCreateButton ( 0.44, 0.31, 0.15, 0.24, "",true ) addEventHandler("onClientGUIClick",GUIEditor.button[1],Click,false) end ) function Click( ) setElementData(localPlayer,"gamemode","deathmatch",true) outputChatBox( "* Data True !!",0,255,0 ) end yes, output i see in chat *Data True Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 If you get it the data has been set it successfully . Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 If you get it the data has been set it successfully . but Why i am not in gamemode DM ? Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 Will this doesn't make a ' Game Mode 'just a data to help you to script your script . Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 Will this doesn't make a ' Game Mode 'just a data to help you to script your script . And what i must do now for move to gamemode DM from gamemode lobby ? Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 You have to use : string.find -- to find the maps for the gamemode Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 You have to use : string.find -- to find the maps for the gamemode string.find ("gamemode", "race" ) This ? Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 No -.- it's not right it's hard some what . Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 No -.- it's not right it's hard some what . It's not easy ? Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 No -.- it's not right it's hard some what . It's not easy ? No it's not easy to make something like a "FFS Gaming" or "TG Gaming" ..etc You must be a good scripter. Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 No -.- it's not right it's hard some what . It's not easy ? No it's not easy to make something like a "FFS Gaming" or "TG Gaming" ..etc You must be a good scripter. And how can teach it good and fast ? Some tips ? How you started with lua ? Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 I Start learn "LUA"from here : https://forum.multitheftauto.com/viewtopic.php?f=148&t=40809 And don't forget the wiki ! Good luck ! Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 I Start learn "LUA"from here :https://forum.multitheftauto.com/viewtopic.php?f=148&t=40809 And don't forget the wiki ! Good luck ! ok, Thank you Btw: You can make lobby and how long you are learning to script ? Only ask Link to comment
iPrestege Posted April 29, 2013 Share Posted April 29, 2013 Will am working for one but not for race gamemode for play and war gamemode for my own server am working on it from month ago . Link to comment
papam77 Posted April 29, 2013 Author Share Posted April 29, 2013 Will am working for one but not for race gamemode for play and war gamemode for my own server am working on it from month ago . And string.find is server side or client ? Link to comment
PaiN^ Posted April 29, 2013 Share Posted April 29, 2013 Both, It's a predefined function from the LUA lang itself . 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