Jump to content

Problem with GUI


xeon17

Recommended Posts

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..

Link to comment

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) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...