xeon17 Posted September 12, 2014 Posted September 12, 2014 So the problem is after the the triggerServerEvent function GUI should close , the image/memo/recetangle/window i'm trying it but it dosen't work. Can someone help me. GUIEditor = { button = {}, staticimage = {}, memo = {} } addEventHandler("onClientMarkerHit", marker, function() showCursor ( true ) GUIEditor.staticimage[1] = guiCreateStaticImage(340, 105, 325, 464, ":hud/gfx/mainhud/law_gui.png", false) Accepted = guiCreateButton(100, 385, 133, 22, "ACCEPT", false, GUIEditor.staticimage[1]) guiSetFont(Accepted, "default-bold-small") guiSetProperty(Accepted, "NormalTextColour", "FFFFFEFE") Declined = guiCreateButton(100, 410, 133, 22, "DECLINE", false, GUIEditor.staticimage[1]) guiSetFont(Declined, "default-bold-small") guiSetProperty(Declined, "NormalTextColour", "FFFFFEFE") GUIEditor.memo[1] = guiCreateMemo(80, 276, 159, 95, "MTA - GangWar:RPG\n LEI - FORCE\n\nLEI is a standard squard on the server. LEI have a base in Los santos,vehicles,garage and a gate.", false, GUIEditor.staticimage[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true, GUIEditor.staticimage[1]) end ) addEventHandler("onClientMarkerHit", marker, function() dxDrawRectangle(340, 107, 331, 462, tocolor(255, 0, 0, 0), false) end ) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if source == Accepted then playSoundFrontEnd ( 6 ) triggerServerEvent ( "onAccepted", resourceRoot ) showCursor ( false ) guiSetVisible ( GUIEditor.staticimage[1] , false) guiSetVisible ( Accepted , false) guiSetVisible ( Declined , false) guiSetVisible ( GUIEditor.memo[1] , false) end if ( source == Declined) then guiSetVisible ( GUIEditor.staticimage[1] , false) showCursor ( false ) end And the when i click on button Declined , nothing happen..
darhal Posted September 12, 2014 Posted September 12, 2014 Try desteoyElement(Gui) instead of guiSetVisible
xeon17 Posted September 12, 2014 Author Posted September 12, 2014 No work GUIEditor = { button = {}, staticimage = {}, memo = {} } addEventHandler("onClientMarkerHit", marker, function() showCursor ( true ) GUIEditor.staticimage[1] = guiCreateStaticImage(340, 105, 325, 464, ":hud/gfx/mainhud/law_gui.png", false) Accepted = guiCreateButton(100, 385, 133, 22, "ACCEPT", false, GUIEditor.staticimage[1]) guiSetFont(Accepted, "default-bold-small") guiSetProperty(Accepted, "NormalTextColour", "FFFFFEFE") Declined = guiCreateButton(100, 410, 133, 22, "DECLINE", false, GUIEditor.staticimage[1]) guiSetFont(Declined, "default-bold-small") guiSetProperty(Declined, "NormalTextColour", "FFFFFEFE") GUIEditor.memo[1] = guiCreateMemo(80, 276, 159, 95, "MTA - GangWar:RPG\n LEI - FORCE\n\nLEI is a standard squard on the server. LEI have a base in Los santos,vehicles,garage and a gate.", false, GUIEditor.staticimage[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true, GUIEditor.staticimage[1]) end ) addEventHandler("onClientMarkerHit", marker, function() dxDrawRectangle(340, 107, 331, 462, tocolor(255, 0, 0, 0), false) end ) addEventHandler ("onClientGUIClick", getRootElement(), function() if source == Accepted then playSoundFrontEnd ( 6 ) triggerServerEvent ( "onAccepted", resourceRoot ) showCursor ( false ) destroyElement (Accepted) destroyElement (Declined) destroyElement (GUIEditor.staticimage[1]) destroyElement (GUIEditor.memo[1]) end if ( source == Declined ) then showCursor ( false ) destroyElement (Accepted) destroyElement (Declined) destroyElement (GUIEditor.staticimage[1]) destroyElement (GUIEditor.memo[1]) end end)
darhal Posted September 12, 2014 Posted September 12, 2014 Put the destroy element before triggerServerEvent
xeon17 Posted September 12, 2014 Author Posted September 12, 2014 No work , still nothing happen. and when i press the Declined button nothing happen too.
xeon17 Posted September 12, 2014 Author Posted September 12, 2014 No errors all the time , the problem was i has two TriggerServerEvent i'm a idiot Thanks for your help anyway! Regards
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