dordor150 Posted April 5, 2014 Posted April 5, 2014 Hi guys, i have worked with GUI editor alittle bit and i dont know how to make the script work as soon as the local player spawn and i what that after i picked a car model and click the butten ill be in the car and locked inside it ill do it my self but im pritty new the Lua Script and having hard time learning it, well tnx GUIEditor = { button = {}, window = {}, label = {}, combobox = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(437, 135, 173, 127, "You're Cars", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(8, 28, 109, 19, "Select You're Car", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") GUIEditor.combobox[1] = guiCreateComboBox(9, 57, 154, 21, "", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "Balista Compact") guiComboBoxAddItem(GUIEditor.combobox[1], "Club") GUIEditor.button[1] = guiCreateButton(18, 88, 135, 26, "Let's Go", false, GUIEditor.window[1]) end )
gghvcffcv Posted April 5, 2014 Posted April 5, 2014 Hi guys, i have worked with GUI editor alittle bit and i dont know how to make the script work as soon as the local player spawnand i what that after i picked a car model and click the butten ill be in the car and locked inside it ill do it my self but im pritty new the Lua Script and having hard time learning it, well tnx GUIEditor = { button = {}, window = {}, label = {}, combobox = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(437, 135, 173, 127, "You're Cars", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(8, 28, 109, 19, "Select You're Car", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") GUIEditor.combobox[1] = guiCreateComboBox(9, 57, 154, 21, "", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "Balista Compact") guiComboBoxAddItem(GUIEditor.combobox[1], "Club") GUIEditor.button[1] = guiCreateButton(18, 88, 135, 26, "Let's Go", false, GUIEditor.window[1]) end ) Mate, Do you have a meta.xml? other thing you need script.lua and put them in the meta.xml other thing you can add a (addCommandHandler Like this [code=text] GUIEditor = { button = {}, window = {}, label = {}, combobox = {} } function Start() GUIEditor.window[1] = guiCreateWindow(437, 135, 173, 127, "You're Cars", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(8, 28, 109, 19, "Select You're Car", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") GUIEditor.combobox[1] = guiCreateComboBox(9, 57, 154, 21, "", false, GUIEditor.window[1]) guiComboBoxAddItem(GUIEditor.combobox[1], "Balista Compact") guiComboBoxAddItem(GUIEditor.combobox[1], "Club") GUIEditor.button[1] = guiCreateButton(18, 88, 135, 26, "Let's Go", false, GUIEditor.window[1]) end addCommandHandler ("startscript ", Start) --- It means when you do in the server /startscript it starts. --- And for that use: warpPedIntoVehicle ( ped thePed, vehicle theVehicle, [ int seat=0 ] )
dordor150 Posted April 5, 2014 Author Posted April 5, 2014 yeah, i have all that staff just wanted to add a gui at the start + your code dosent work 0.0
gghvcffcv Posted April 5, 2014 Posted April 5, 2014 yeah, i have all that staff just wanted to add a gui at the start + your code dosent work 0.0 addCommandHandler ("startscript", Start) ---- Sorry i left A little space between "startscript " and Add to the function (player, commandName)
dordor150 Posted April 5, 2014 Author Posted April 5, 2014 lol nice, but it dosent work again 0.0 after i type /startscript noting happned and if i use other commands the other commands works great + do you have a nice place to learn MTA Lua in english ?
gghvcffcv Posted April 6, 2014 Posted April 6, 2014 lol nice, but it dosent work again 0.0after i type /startscript noting happned and if i use other commands the other commands works great + do you have a nice place to learn MTA Lua in english ? Some error?
gghvcffcv Posted April 6, 2014 Posted April 6, 2014 lol nice, but it dosent work again 0.0after i type /startscript noting happned and if i use other commands the other commands works great + do you have a nice place to learn MTA Lua in english ? Some error in server console?
Moderators Citizen Posted April 6, 2014 Moderators Posted April 6, 2014 + do you have a nice place to learn MTA Lua in english ? The wiki (this is where I started to learn): https://wiki.multitheftauto.com/wiki/Main_Page (Check the right section "Scripting")
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