GerardWay Posted December 29, 2013 Posted December 29, 2013 This Spawn GUI is not showing, I'd appreciate any help, thanks. client.lua GUIEditor = { button = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(5, 122, 1366, 498, "Backup Server - Spawn System", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(54, 96, 558, 137, "Military", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FE06") GUIEditor.button[2] = guiCreateButton(749, 96, 558, 137, "Resistance", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFE0000") GUIEditor.edit[1] = guiCreateEdit(45, 265, 567, 223, "Players spawned in the Military Class must protect the people of SA from the Zombie Infection.", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(744, 260, 567, 223, "Players spawned in the Resistance Class must destroy the Military Troops, and take control of SA.", false, GUIEditor.window[1]) showCursor(true) end ) showCursor (false) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.button[1] then triggerServerEvent("Military", source) guiSetVisible(GUIEditor_window[1], false) showCursor(false) else if source == GUIEditor.button[2] then triggerServerEvent("Resistance", source) guiSetVisible(GUIEditor_window[1], false) showCursor(false) addEvent("setSpawnVisible",true) addEventHandler("setSpawnVisible",root, function () guiSetVisible( GUIEditor_window[1], true ) setTimer( function () showCursor( true ) end, 1000,1) end ) server.lua addEvent("Military", true) addEventHandler("Military", root, function() team1 = createTeam ("Military Forces", 0, 255, 0) setPlayerTeam (source, team1) spawnPlayer (source, 207.90919, 1865.12842, 13.14063, 196, 0, 0) setElementModel (source, 196) setPlayerNametagColor (source, 0, 255, 0) fadeCamera (source, true) setCameraTarget (source, source) giveWeapon (source, 28, 2000) giveWeapon (source, 23, 2000) end ) addEvent("Resistance", true) addEventHandler("Resistance", root, function() resisteam = createTeam ("Resistances", 255, 0, 0) setPlayerTeam (source, resisteam) spawnPlayer (source, 1091.63159, 2111.34351, 15.35040, 7, 0, 0) outputChatBox ( "You have spawned as a 'Resistance Member'!", source, 255, 0, 0, true ) setElementModel (source, 7) setPlayerNametagColor (source, 255, 0, 0) fadeCamera (source, true) setCameraTarget (source,source) giveWeapon (source, 28, 2000,true) giveWeapon (source, 23, 2000) end ) addEventHandler ( "onPlayerLogin", root, addEventHandler ( "onPlayerWasted", root, function ( ) triggerClientEvent ( source, "setSpawnVisible", source, true ) end )
Castillo Posted December 29, 2013 Posted December 29, 2013 GUIEditor = { button = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(5, 122, 1366, 498, "Backup Server - Spawn System", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(54, 96, 558, 137, "Military", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FE06") GUIEditor.button[2] = guiCreateButton(749, 96, 558, 137, "Resistance", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFE0000") GUIEditor.edit[1] = guiCreateEdit(45, 265, 567, 223, "Players spawned in the Military Class must protect the people of SA from the Zombie Infection.", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(744, 260, 567, 223, "Players spawned in the Resistance Class must destroy the Military Troops, and take control of SA.", false, GUIEditor.window[1]) showCursor(true) end ) showCursor ( false ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[1] ) then triggerServerEvent ( "Military", localPlayer ) guiSetVisible ( GUIEditor_window[1], false ) showCursor ( false ) elseif ( source == GUIEditor.button[2] ) then triggerServerEvent ( "Resistance", localPlayer ) guiSetVisible ( GUIEditor_window[1], false ) showCursor ( false ) end end ) addEvent("setSpawnVisible",true) addEventHandler("setSpawnVisible",root, function () guiSetVisible( GUIEditor_window[1], true ) setTimer( function () showCursor( true ) end, 1000,1) end )
GerardWay Posted December 29, 2013 Author Posted December 29, 2013 Now the GUI Shows, but it shows as soon as the Resource Starts instead of when the player dies and logs in and the buttons do not function
pa3ck Posted December 30, 2013 Posted December 30, 2013 GUIEditor = { button = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(5, 122, 1366, 498, "Backup Server - Spawn System", false) guiSetVisible( GUIEditor_window[1], false ) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(54, 96, 558, 137, "Military", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FE06") GUIEditor.button[2] = guiCreateButton(749, 96, 558, 137, "Resistance", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFE0000") GUIEditor.edit[1] = guiCreateEdit(45, 265, 567, 223, "Players spawned in the Military Class must protect the people of SA from the Zombie Infection.", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(744, 260, 567, 223, "Players spawned in the Resistance Class must destroy the Military Troops, and take control of SA.", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.button[1] then triggerServerEvent("Military", source) guiSetVisible(GUIEditor_window[1], false) showCursor(false) elseif source == GUIEditor.button[2] then triggerServerEvent("Resistance", source) guiSetVisible(GUIEditor_window[1], false) showCursor(false) end end) end ) addEvent("setSpawnVisible",true) addEventHandler("setSpawnVisible",root, function () guiSetVisible( GUIEditor_window[1], true ) setTimer( function () showCursor( true ) end, 1000,1) end ) Did not test it tho.
GerardWay Posted December 30, 2013 Author Posted December 30, 2013 Now the buttons aren't showing up at all, and the GUI still shows when the resource starts
Castillo Posted December 30, 2013 Posted December 30, 2013 -- client side: GUIEditor = { button = { }, window = { }, edit = { } } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) GUIEditor.window[1] = guiCreateWindow(5, 122, 1366, 498, "Backup Server - Spawn System", false) guiSetVisible ( GUIEditor.window[1], false ) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(54, 96, 558, 137, "Military", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FE06") GUIEditor.button[2] = guiCreateButton(749, 96, 558, 137, "Resistance", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFE0000") GUIEditor.edit[1] = guiCreateEdit(45, 265, 567, 223, "Players spawned in the Military Class must protect the people of SA from the Zombie Infection.", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(744, 260, 567, 223, "Players spawned in the Resistance Class must destroy the Military Troops, and take control of SA.", false, GUIEditor.window[1]) end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[1] ) then triggerServerEvent ( "Military", localPlayer ) guiSetVisible ( GUIEditor_window[1], false ) showCursor ( false ) elseif ( source == GUIEditor.button[2] ) then triggerServerEvent ( "Resistance", localPlayer ) guiSetVisible ( GUIEditor_window[1], false ) showCursor ( false ) end end ) addEvent ( "setSpawnVisible", true ) addEventHandler ( "setSpawnVisible",root, function ( ) guiSetVisible ( GUIEditor_window[1], true ) setTimer ( function ( ) showCursor ( true ) end ,1000, 1 ) end ) -- server side: addEvent("Military", true) addEventHandler("Military", root, function() team1 = createTeam ("Military Forces", 0, 255, 0) setPlayerTeam (source, team1) spawnPlayer (source, 207.90919, 1865.12842, 13.14063, 196, 0, 0) setElementModel (source, 196) setPlayerNametagColor (source, 0, 255, 0) fadeCamera (source, true) setCameraTarget (source, source) giveWeapon (source, 28, 2000) giveWeapon (source, 23, 2000) end ) addEvent("Resistance", true) addEventHandler("Resistance", root, function() resisteam = createTeam ("Resistances", 255, 0, 0) setPlayerTeam (source, resisteam) spawnPlayer (source, 1091.63159, 2111.34351, 15.35040, 7, 0, 0) outputChatBox ( "You have spawned as a 'Resistance Member'!", source, 255, 0, 0, true ) setElementModel (source, 7) setPlayerNametagColor (source, 255, 0, 0) fadeCamera (source, true) setCameraTarget (source,source) giveWeapon (source, 28, 2000,true) giveWeapon (source, 23, 2000) end ) function showSpawn ( ) triggerClientEvent ( source, "setSpawnVisible", source, true ) end addEventHandler ( "onPlayerWasted", root, showSpawn ) addEventHandler ( "onPlayerLogin", root, showSpawn )
GerardWay Posted December 30, 2013 Author Posted December 30, 2013 Nope, there was a malformed number error in Client, but it was because there was a 'c' next to one of the numbers, must have been put in there by mistake, still didn't fix anything though
Castillo Posted December 30, 2013 Posted December 30, 2013 addEvent ( "setSpawnVisible", true ) addEventHandler ( "setSpawnVisible",root, function ( state ) guiSetVisible ( GUIEditor.window[1], state ) -- You had put 'GUIEditor_Window' setTimer ( function ( ) showCursor ( state ) end ,1000, 1 ) end )
Castillo Posted December 30, 2013 Posted December 30, 2013 What do you mean by nothing? I tested it and it works fine, it shows the spawn when I die. Post the client side script.
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