damien111 Posted January 25, 2013 Share Posted January 25, 2013 Ok, so i am trying to create a panel for the player that enteres the marker , and let him accept the job, and get the team, etc. It comes up for everyone everytime, and i know this is a noob question, but can someone help me? client GUIEditor = { memo = {}, button = {}, label = {}, window = {}, } windowjob9 = guiCreateWindow(253, 137, 304, 284, "", false) guiWindowSetSizable(windowjob9, false) SWATLabel = guiCreateLabel(65, 29, 264, 40, "SWAT Gear", false, windowjob9) guiSetFont(GUIEditor.label[1], "sa-gothic") SwatMemo2 = guiCreateMemo(304, 180, 0, 20, "", false, windowjob9) SwatMemo3 = guiCreateMemo(10, 85, 285, 104, "Arrest People For Money, RP Raids! And RP Riot Control!!", false, windowjob9) SwatButton = guiCreateButton(10, 200, 285, 51, "Take The Job!", false, windowjob9) guiSetFont(SwatButton, "sa-header") guiSetVisible(windowjob9, false) local marker7 = createMarker( 1671.845703125, -1705.2421875, 15.609375, "Cylinder", 2, 6, 183, 248, 153) function Medicjob9(hitElement) if getElementType(hitElement) == "player" then if not guiGetVisible(windowjob9) then guiSetVisible(windowjob9, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker7, Medicjob9) function Medicjobleave9(leaveElement) if getElementType(leaveElement) == "player" then if guiGetVisible(windowjob9) then guiSetVisible(windowjob9, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker7, Medicjobleave9) function joinTeam9() triggerServerEvent("setSWAT",localPlayer) guiSetVisible(windowjob9, false) showCursor(false) end addEventHandler("onClientGUIClick", SwatButton , joinTeam9, false) server SwatTeam = getTeamFromName ( "SWAT" ) function joinSWAT() setPlayerTeam(source,PoliceTeam) setElementModel(source,285) giveWeapon ( source, 31, 500, false ) giveWeapon ( source, 25, 100, false ) giveWeapon ( source, 23, 1, false ) giveWeapon ( source, 24, 100, false ) setElementData( source, "Occupation", "SWAT", true ) outputChatBox("You now have your SWAT Gear! Move Out!.",source,0,255,0) end addEvent("setSWAT", true) addEventHandler("setSWAT",root,joinSWAT) Link to comment
Ab-47 Posted January 25, 2013 Share Posted January 25, 2013 Server Problem; Server- function joinSWAT() local SwatTeam = getTeamFromName("SWAT") setPlayerTeam(source,SwatTeam) setElementModel(source,285) giveWeapon ( source, 31, 500, false ) giveWeapon ( source, 25, 100, false ) giveWeapon ( source, 23, 1, false ) giveWeapon ( source, 24, 100, false ) setElementData( source, "Occupation", "SWAT", true ) outputChatBox("You now have your SWAT Gear! Move Out!.",source,0,255,0) end addEvent("setSWAT", true) addEventHandler("setSWAT",getRootElement(),joinSWAT) I moved the getTeamFromName inside the function, tested it multiple times and seems to work. I think it's an easy solution. Link to comment
Lloyd Logan Posted January 25, 2013 Share Posted January 25, 2013 Add a guiSetVisible(windowjob9, false) After you create the window. When the marker is hit, it will set the Boolean to true Link to comment
Ab-47 Posted January 25, 2013 Share Posted January 25, 2013 Add a guiSetVisible(windowjob9, false) After you create the window. When the marker is hit, it will set the Boolean to true Look at line 18 of his client sided script, already stated. Link to comment
Lloyd Logan Posted January 25, 2013 Share Posted January 25, 2013 GUIEditor = { memo = {}, button = {}, label = {}, window = {}, } windowjob9 = guiCreateWindow(253, 137, 304, 284, "", false) guiWindowSetSizable(windowjob9, false) SWATLabel = guiCreateLabel(65, 29, 264, 40, "SWAT Gear", false, windowjob9) guiSetFont(GUIEditor.label[1], "sa-gothic") SwatMemo2 = guiCreateMemo(304, 180, 0, 20, "", false, windowjob9) SwatMemo3 = guiCreateMemo(10, 85, 285, 104, "Arrest People For Money, RP Raids! And RP Riot Control!!", false, windowjob9) SwatButton = guiCreateButton(10, 200, 285, 51, "Take The Job!", false, windowjob9) guiSetFont(SwatButton, "sa-header") guiSetVisible(windowjob9, false) local marker7 = createMarker( 1671.845703125, -1705.2421875, 15.609375, "Cylinder", 2, 6, 183, 248, 153) function Medicjob9(hitElement) if getElementType(hitElement) == "localPlayer" then if not guiGetVisible(windowjob9) then guiSetVisible(windowjob9, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker7, Medicjob9) function Medicjobleave9(leaveElement) if getElementType(leaveElement) == "localPlayer" then if guiGetVisible(windowjob9) then guiSetVisible(windowjob9, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker7, Medicjobleave9) function joinTeam9() triggerServerEvent("setSWAT",localPlayer) guiSetVisible(windowjob9, false) showCursor(false) end addEventHandler("onClientGUIClick", SwatButton , joinTeam9, false) Link to comment
WASSIm. Posted January 25, 2013 Share Posted January 25, 2013 Client: GUIEditor = { memo = {}, button = {}, label = {}, window = {}, } windowjob9 = guiCreateWindow(253, 137, 304, 284, "", false) guiWindowSetSizable(windowjob9, false) SWATLabel = guiCreateLabel(65, 29, 264, 40, "SWAT Gear", false, windowjob9) guiSetFont(SWATLabel, "sa-gothic") SwatMemo2 = guiCreateMemo(304, 180, 0, 20, "", false, windowjob9) SwatMemo3 = guiCreateMemo(10, 85, 285, 104, "Arrest People For Money, RP Raids! And RP Riot Control!!", false, windowjob9) SwatButton = guiCreateButton(10, 200, 285, 51, "Take The Job!", false, windowjob9) guiSetFont(SwatButton, "sa-header") guiSetVisible(windowjob9, false) local marker7 = createMarker( 1671.845703125, -1705.2421875, 15.609375, "Cylinder", 2, 6, 183, 248, 153) function Medicjob9(hitElement) if getElementType(hitElement) == "player" then if not guiGetVisible(windowjob9) then guiSetVisible(windowjob9, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker7, Medicjob9) function Medicjobleave9(leaveElement) if getElementType(leaveElement) == "player" then if guiGetVisible(windowjob9) then guiSetVisible(windowjob9, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker7, Medicjobleave9) function joinTeam9() triggerServerEvent("setSWAT",localPlayer) guiSetVisible(windowjob9, false) showCursor(false) end addEventHandler("onClientGUIClick", SwatButton , joinTeam9, false) Link to comment
damien111 Posted January 26, 2013 Author Share Posted January 26, 2013 thanks, resolved 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