Jullul7000 Posted January 26, 2013 Share Posted January 26, 2013 (edited) If got this code: --[[The function below is the spawn window itself. If you have any previous experience with scripting, even HTML, some of this should make sense to you.--]] function openVehicleSpawnClient() local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 233, 104 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 showCursor(true) vehSpawnWin = guiCreateWindow(left, top, windowWidth, windowHeight, "Vehicle Spawner", false) guiWindowSetSizable(vehSpawnWin, false) sampleLabel = guiCreateLabel(15, 25, 201, 20, "Sample Vehicle Spawner", false, vehSpawnWin) guiLabelSetHorizontalAlign(sampleLabel, "center", false) guiLabelSetVerticalAlign(sampleLabel, "center") -- The lineEdit is where you type the modelID you want to spawn. lineEdit = guiCreateEdit(12, 45, 211, 20, "", false, vehSpawnWin) guiEditSetMaxLength(lineEdit, 32767) -- After entering the modelID you wish to spawn, you press the button "Spawn Vehicle" -- The button triggers the next function we use: spawnVehicleClient spawnBtn = guiCreateButton(14, 75, 211, 23, "Spawn Vehicle", false, vehSpawnWin) addEventHandler("onClientGUIClick", spawnBtn, spawnVehicleClient, false) end addEvent("openVehicleSpawn",true) addEventHandler("openVehicleSpawn",localPlayer,openVehicleSpawnClient) --[[This function gets the modelID you entered in the window, checks if it exists,- - and if the model does exist, it will trigger a serverside event. If the vehicle does not exist, you will get a message with an error warning.--]] function spawnVehicleClient() local id = guiGetText(lineEdit) triggerServerEvent("spawnVehicleServer",localPlayer,id) showCursor(false) guiSetVisible(vehSpawnWin,false) end But i wanna add this GUI: GUIEditor = { radiobutton = {}, button = {}, label = {}, window = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(251, 127, 144, 150, "Spawn Vehicle", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.73) GUIEditor.label[1] = guiCreateLabel(34, 32, 88, 24, "", false, GUIEditor.window[1]) GUIEditor.radiobutton[1] = guiCreateRadioButton(17, 36, 101, 22, "PizzaBoy", false, GUIEditor.window[1]) guiRadioButtonSetSelected(GUIEditor.radiobutton[1], true) GUIEditor.button[1] = guiCreateButton(19, 81, 107, 45, "Create", false, GUIEditor.window[1]) end ) How can i do that?? IDK how to script. Edited January 26, 2013 by Guest Link to comment
xXMADEXx Posted January 26, 2013 Share Posted January 26, 2013 you should put in --LUA not Code Link to comment
Jullul7000 Posted January 26, 2013 Author Share Posted January 26, 2013 you should put in --LUA not Code Thanks Link to comment
Lloyd Logan Posted January 26, 2013 Share Posted January 26, 2013 Both of them are GUI, what are you trying to do? Link to comment
Jullul7000 Posted January 26, 2013 Author Share Posted January 26, 2013 Both of them are GUI, what are you trying to do? I try to make a blue marker where i can spawn cars Link to comment
Lloyd Logan Posted January 26, 2013 Share Posted January 26, 2013 Both of them are GUI, what are you trying to do? I try to make a blue marker where i can spawn cars So you want to replace the GUI? Link to comment
Jullul7000 Posted January 27, 2013 Author Share Posted January 27, 2013 Both of them are GUI, what are you trying to do? I try to make a blue marker where i can spawn cars So you want to replace the GUI? Yes. Do you have skype?? I need a scripter for my server.. Pls.. Add me when you have julian.knoeperd If you wanna help you get Co-Owner Link to comment
Ab-47 Posted January 27, 2013 Share Posted January 27, 2013 --[[The function below is the spawn window itself. If you have any previous experience with scripting, even HTML, some of this should make sense to you.--]] function openVehicleSpawnClient() local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 233, 104 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 showCursor(true) vehSpawnWin = guiCreateWindow(251, 127, 144, 150, "Spawn Vehicle", false) guiWindowSetSizable(vehSpawnWin, false) guiSetAlpha(vehSpawnWin, 0.73) sampleLabel = guiCreateLabel(34, 32, 88, 24, "", false, vehSpawnWin) radiobutton = guiCreateRadioButton(17, 36, 101, 22, "PizzaBoy", false, vehSpawnWin) guiRadioButtonSetSelected(radiobutton, true) CreateButton = guiCreateButton(19, 81, 107, 45, "Create", false, vehSpawnWin) -- The lineEdit is where you type the modelID you want to spawn. lineEdit = guiCreateEdit(12, 45, 211, 20, "", false, vehSpawnWin) guiEditSetMaxLength(lineEdit, 32767) -- After entering the modelID you wish to spawn, you press the button "Spawn Vehicle" -- The button triggers the next function we use: spawnVehicleClient spawnBtn = guiCreateButton(14, 75, 211, 23, "Spawn Vehicle", false, vehSpawnWin) addEventHandler("onClientGUIClick", spawnBtn, spawnVehicleClient, false) end addEvent("openVehicleSpawn",true) addEventHandler("openVehicleSpawn",localPlayer,openVehicleSpawnClient) --[[This function gets the modelID you entered in the window, checks if it exists,- - and if the model does exist, it will trigger a serverside event. If the vehicle does not exist, you will get a message with an error warning.--]] function spawnVehicleClient() local id = guiGetText(lineEdit) triggerServerEvent("spawnVehicleServer",localPlayer,id) showCursor(false) guiSetVisible(vehSpawnWin,false) end 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