papam77 Posted April 29, 2013 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 ?
PaiN^ Posted April 29, 2013 Posted April 29, 2013 Read the wiki !! There is no argument for gamemode with the function guiCreateButton .
papam77 Posted April 29, 2013 Author 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
iPrestege Posted April 29, 2013 Posted April 29, 2013 This make no sense at all you have to use it when player click it using : onClientGUIClick .
papam77 Posted April 29, 2013 Author 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
papam77 Posted April 29, 2013 Author Posted April 29, 2013 You didn't understand what i said above . I never made buttons
iPrestege Posted April 29, 2013 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
papam77 Posted April 29, 2013 Author 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
iPrestege Posted April 29, 2013 Posted April 29, 2013 If you get it the data has been set it successfully .
papam77 Posted April 29, 2013 Author Posted April 29, 2013 If you get it the data has been set it successfully . but Why i am not in gamemode DM ?
iPrestege Posted April 29, 2013 Posted April 29, 2013 Will this doesn't make a ' Game Mode 'just a data to help you to script your script .
papam77 Posted April 29, 2013 Author 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 ?
iPrestege Posted April 29, 2013 Posted April 29, 2013 You have to use : string.find -- to find the maps for the gamemode
papam77 Posted April 29, 2013 Author Posted April 29, 2013 You have to use : string.find -- to find the maps for the gamemode string.find ("gamemode", "race" ) This ?
papam77 Posted April 29, 2013 Author Posted April 29, 2013 No -.- it's not right it's hard some what . It's not easy ?
iPrestege Posted April 29, 2013 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.
papam77 Posted April 29, 2013 Author 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 ?
iPrestege Posted April 29, 2013 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 !
papam77 Posted April 29, 2013 Author 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
iPrestege Posted April 29, 2013 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 .
papam77 Posted April 29, 2013 Author 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 ?
PaiN^ Posted April 29, 2013 Posted April 29, 2013 Both, It's a predefined function from the LUA lang itself .
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