Jump to content

[ AYUDA ] Problema con GUI


Recommended Posts

Recien estoy empezando a comprender esto de las funciones y me fui de lleno a meterme con los guis.

Y este es mi primer gui de teleports AL TOCAR UN MAKER pero tengo el problema de que cuando entro al server me aparece la ventana del gui al instante.. Y al tocar el maker tambien. Yo solo quiero que me aparesca el GUI al tocar el maker y no cuando entro (onPlayerJoin)

alguien me puede ayudar? :(

aca pongo el client :

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

Prueba añadiendo:

showCursor(false) 
guiSetVisible( PANEL, false ) 
guiWindowSetSizable( PANEL, false ) 
guiWindowSetMovable( PANEL, false ) 

así no se vera la ventana al empezar el script, de paso tampoco enseñara el ratón y hará que no la puedas mover ni cambiar el tamaño.

Link to comment
Prueba añadiendo:
showCursor(false) 
guiSetVisible( PANEL, false ) 
guiWindowSetSizable( PANEL, false ) 
guiWindowSetMovable( PANEL, false ) 

así no se vera la ventana al empezar el script, de paso tampoco enseñara el ratón y hará que no la puedas mover ni cambiar el tamaño.

Wow!! que pequeño detalle pero ahora lo conosco gracias a ti, muchisimas gracias en verdad :)

Link to comment
Prueba añadiendo:
showCursor(false) 
guiSetVisible( PANEL, false ) 
guiWindowSetSizable( PANEL, false ) 
guiWindowSetMovable( PANEL, false ) 

así no se vera la ventana al empezar el script, de paso tampoco enseñara el ratón y hará que no la puedas mover ni cambiar el tamaño.

Wow!! que pequeño detalle pero ahora lo conosco gracias a ti, muchisimas gracias en verdad :)

De nada. Si tienes algún problema mas no olvides en postearlo.

Link to comment
  • Recently Browsing   0 members

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