Jump to content

[HELP] Problem with GUI


Recommended Posts

I have a problem with my teleports GUI. The GUI appears when i join to the server and when I hit a maker. I just wish that the GUI appears when I hit the marker (onClientMarkerHit), not when I join to the server(onClientPlayerJoin)

can anyone help me? :(

Client-side

               ---------------- ORDEN: AMULS, LS, TERRORISTAS, AMULV, QUEBRADOS, COMANDANCIA, HOSPITAL, PLAZITA  -------------- 
                
    local marker = createMarker( 1331.9000244141, -1270.5999755859, 12.3999999, "Cylinder", 2, 143, 7, 49, 255) 
    local marker1 = createMarker( 639.90002441406, -1229.8000488281, 16.89999961853, "Cylinder", 2, 143, 7, 49, 255) 
    local marker2 = createMarker( 2558.5, 1902.5999755859, 10, "Cylinder", 2, 143, 7, 49, 255) 
    local marker3 = createMarker( 773.59997558594, 1884.5999755859, 3.7000000476837, "Cylinder", 2, 143, 7, 49, 255) 
    local marker4 = createMarker( -1314, 2704.3999023438, 48.900001525879, "Cylinder", 2, 143, 7, 49, 255) 
    local marker5 = createMarker( -1487.9000244141, 663.59997558594, 6.199999, "Cylinder", 2, 143, 7, 49, 255) 
    local marker6 = createMarker( -2594.8000488281, 583.20001220703, 13.39999961853, "Cylinder", 2, 143, 7, 49, 255) 
    local marker7 = createMarker( -2677.3999023438, 400.29998779297, 3.4000000953674, "Cylinder", 2, 143, 7, 49, 255) 
     
     
GUIEditor = { 
    label = {}, 
    staticimage = {} 
} 
  
        PANEL = guiCreateWindow(119, 69, 571, 476, "", false) 
        guiWindowSetSizable(PANEL, false) 
        guiSetAlpha(PANEL, 0.87) 
  
        IMAGEN = guiCreateStaticImage(9, 10, 553, 455, "imagen.png", false, PANEL) 
  
        PLAZITA = guiCreateButton(40, 92, 136, 82, "San Fierro", false, IMAGEN) 
        guiSetAlpha(PLAZITA, 0.30) 
        guiSetFont(PLAZITA, "default-small") 
        AMU2 = guiCreateButton(376, 90, 139, 84, "Ammu-Nation LV", false, IMAGEN) 
        guiSetAlpha(AMU2, 0.30) 
        guiSetFont(AMU2, "default-small") 
        TERRORISTAS = guiCreateButton(205, 90, 140, 84, "Base Terroristas", false, IMAGEN) 
        guiSetAlpha(TERRORISTAS, 0.30) 
        guiSetFont(TERRORISTAS, "default-small") 
        QUEBRADOS = guiCreateButton(39, 204, 137, 82, "The Quebrados", false, IMAGEN) 
        guiSetAlpha(QUEBRADOS, 0.30) 
        guiSetFont(QUEBRADOS, "default-small") 
        AMU1 = guiCreateButton(204, 203, 141, 83, "Ammu-Nation LS", false, IMAGEN) 
        guiSetAlpha(AMU1, 0.30) 
        guiSetFont(AMU1, "default-small") 
        POLICE = guiCreateButton(376, 204, 139, 82, "Comandancia SF", false, IMAGEN) 
        guiSetAlpha(POLICE, 0.30) 
        guiSetFont(POLICE, "default-small") 
        SANTOS = guiCreateButton(38, 316, 138, 89, "Los Santos", false, IMAGEN) 
        guiSetAlpha(SANTOS, 0.30) 
        guiSetFont(SANTOS, "default-small") 
        HOSPITAL = guiCreateButton(206, 319, 139, 81, "Hospital SF", false, IMAGEN) 
        guiSetAlpha(HOSPITAL, 0.30) 
        guiSetFont(HOSPITAL, "default-small") 
        CANCELAR = guiCreateButton(366, 304, 172, 131, "", false, IMAGEN) 
        guiSetAlpha(CANCELAR, 0.00) 
  
     
            function teleport(hitElement) 
             if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
                  if not guiGetVisible(PANEL) then 
                       guiSetVisible(PANEL, true) 
                       showCursor(true) 
                  end 
             end 
        end 
         
         
        addEventHandler("onClientMarkerHit", marker, teleport) 
                addEventHandler("onClientMarkerHit", marker1, teleport) 
                addEventHandler("onClientMarkerHit", marker2, teleport) 
        addEventHandler("onClientMarkerHit", marker3, teleport) 
        addEventHandler("onClientMarkerHit", marker4, teleport) 
        addEventHandler("onClientMarkerHit", marker5, teleport) 
        addEventHandler("onClientMarkerHit", marker6, teleport) 
        addEventHandler("onClientMarkerHit", marker7, teleport) 
         
  
         
  
function PLAZITAA () 
triggerServerEvent ( "onGreeting", getLocalPlayer() ) 
guiSetVisible(PANEL, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", PLAZITA , PLAZITAA, false) 
  
  
function AMU22 () 
triggerServerEvent ( "onGreeting1", getLocalPlayer() ) 
guiSetVisible(PANEL, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", AMU2 , AMU22, false) 
  
function HOSPITALL () 
triggerServerEvent ( "onGreeting2", getLocalPlayer() ) 
guiSetVisible(PANEL, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", HOSPITAL , HOSPITALL, false) 
  
function AMU11 () 
triggerServerEvent ( "onGreeting3", getLocalPlayer() ) 
guiSetVisible(PANEL, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", AMU1 , AMU11, false) 
  
function TERRORISTASS () 
triggerServerEvent ( "onGreeting4", getLocalPlayer() ) 
guiSetVisible(PANEL, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", TERRORISTAS , TERRORISTASS, false) 
  
function QUEBRADOSS () 
triggerServerEvent ( "onGreeting5", getLocalPlayer() ) 
guiSetVisible(PANEL, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", QUEBRADOS , QUEBRADOSS, false) 
  
function POLICEE () 
triggerServerEvent ( "onGreeting6", getLocalPlayer() ) 
guiSetVisible(PANEL, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", POLICE , POLICEE, false) 
  
function SANTOSS () 
triggerServerEvent ( "onGreeting7", getLocalPlayer() ) 
guiSetVisible(PANEL, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", SANTOS , SANTOSS, false) 
         
function CANCELARR () 
guiSetVisible(PANEL, false) 
             showCursor(false) 
        end 
        addEventHandler("onClientGUIClick", CANCELAR , CANCELARR, false) 
         
  
     
     
     
     
  

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