Jump to content

[Ayuda] marker


Nicolas ECM

Recommended Posts

Hola a todos, tengo un error en un script, lo que hace el script es que se crea un marker y al entrar al marker aparece un panel, si le doy en el boton aceptar se creara otro marker y toca ir hasta el para terminar la mision y que aparesca un panel de final pero hay es donde tengo el error y es que al entrar en el marker del final me aparece un error, dejo el script abajo.

client-side

markerinicio = createMarker ( 2429.818359375, -1677.53515625, 12.625685119629, "cylinder",1.8, 0, 0, 255, 255 ) 
  
  
function Panel1() 
    window = guiCreateWindow(456, 212, 520, 452, "MISION RANGO C", false) 
    guiWindowSetSizable(window, false) 
    botonaceptar = guiCreateButton(279, 25, 227, 76, "Aceptar", false, window) 
    botonsalir = guiCreateButton(278, 339, 228, 82, "Salir", false, window) 
      
     
    showCursor(true) 
    addEventHandler("onClientGUIClick", botonaceptar,empezarmision1, false) 
    addEventHandler("onClientGUIClick", botonaceptar, salir1, false) 
    addEventHandler("onClientGUIClick", botonsalir,salir1, false) 
  
end 
  
function panelfinal() 
    windowwwwwww = guiCreateWindow(480, 188, 486, 477, "ENTREGA MISION RANGO C", false) 
    guiWindowSetSizable(windowwwwwww, false) 
  
    botonnsalir = guiCreateButton(328, 187, 148, 57, "Salir", false, windowwwwwww) 
    addEventHandler("onClientGUIClick", botonnsalir,misionterminada1, false)     
     addEventHandler("onClientGUIClick", botonnsalir,salirfin, false)    
end 
  
  
function empezarmision1 () 
    showCursor(true) 
    markerfin = createMarker (612.439453125, -609.3994140625, 17.2265625, 23,"cylinder", 1.8, 0, 0, 255, 255 ) 
end 
  
addEventHandler('onClientMarkerHit', markerinicio, 
function ( hitPlayer ) 
    if ( hitPlayer == localPlayer ) then 
        Panel1() 
        showCursor( true ) 
    end 
end ) 
  
addEventHandler('onClientMarkerHit', markerfin, 
function ( hitPlayer ) 
    if ( hitPlayer == localPlayer ) then 
        panelfinal() 
        showCursor( true ) 
    end 
end ) 
  
function misionterminada1 () 
destroyElement ( markerfin ) 
end 
  
function salir1() 
    showCursor(false) 
    destroyElement(window) 
end 
  
function salirfin() 
    showCursor(false) 
    destroyElement(windowwwwwww) 
end 
  
  
  

me pueden ayudar a hacer esto porfavor ya intente de todo y no puedo arreglarlo.

Link to comment

Intenta con esto:

  
    markerinicio = createMarker ( 2429.818359375, -1677.53515625, 12.625685119629, "cylinder",1.8, 0, 0, 255, 255 ) 
    window = guiCreateWindow(456, 212, 520, 452, "MISION RANGO C", false) 
    guiSetVisible(window,false) 
    guiWindowSetSizable(window, false) 
    botonaceptar = guiCreateButton(279, 25, 227, 76, "Aceptar", false, window) 
    botonsalir = guiCreateButton(278, 339, 228, 82, "Salir", false, window) 
    showCursor(true) 
    addEventHandler("onClientGUIClick", botonaceptar,empezarmision1, false) 
    addEventHandler("onClientGUIClick", botonaceptar, salir1, false) 
    addEventHandler("onClientGUIClick", botonsalir,salir1, false) 
-- Panel 2 
    windowwwwwww = guiCreateWindow(480, 188, 486, 477, "ENTREGA MISION RANGO C", false) 
    guiSetVisible(windowwwwwww,false) 
    guiWindowSetSizable(windowwwwwww, false) 
    botonnsalir = guiCreateButton(328, 187, 148, 57, "Salir", false, windowwwwwww) 
    addEventHandler("onClientGUIClick", botonnsalir,misionterminada1, false)    
    addEventHandler("onClientGUIClick", botonnsalir,salirfin, false)    
  
function empezarmision1 () 
    showCursor(true) 
    markerfin = createMarker (612.439453125, -609.3994140625, 17.2265625, 23,"cylinder", 1.8, 0, 0, 255, 255 ) 
end 
  
addEventHandler('onClientMarkerHit', markerinicio, 
function ( hitPlayer ) 
    if ( hitPlayer == localPlayer ) then 
        Panel1() 
        showCursor( true ) 
    end 
end ) 
  
addEventHandler('onClientMarkerHit', markerfin, 
function ( hitPlayer ) 
    if ( hitPlayer == localPlayer ) then 
        panelfinal() 
        showCursor( true ) 
    end 
end ) 
  
function misionterminada1 () 
destroyElement ( markerfin ) 
end 
  
function salir1() 
    showCursor(false) 
    destroyElement(window) 
end 
  
function salirfin() 
    showCursor(false) 
    destroyElement(windowwwwwww) 
end 
  
  
  

Link to comment
  
markerinicio = createMarker ( 2429.818359375, -1677.53515625, 12.625685119629, "cylinder",1.8, 0, 0, 255, 255 ) 
  
  
function Panel1() 
    window = guiCreateWindow(456, 212, 520, 452, "MISION RANGO C", false) 
    guiWindowSetSizable(window, false) 
    botonaceptar = guiCreateButton(279, 25, 227, 76, "Aceptar", false, window) 
    botonsalir = guiCreateButton(278, 339, 228, 82, "Salir", false, window) 
      
    
    showCursor(true) 
    addEventHandler("onClientGUIClick", botonaceptar,empezarmision1, false) 
    addEventHandler("onClientGUIClick", botonaceptar, salir1, false) 
    addEventHandler("onClientGUIClick", botonsalir,salir1, false) 
  
end 
  
function panelfinal() 
    windowwwwwww = guiCreateWindow(480, 188, 486, 477, "ENTREGA MISION RANGO C", false) 
    guiWindowSetSizable(windowwwwwww, false) 
  
    botonnsalir = guiCreateButton(328, 187, 148, 57, "Salir", false, windowwwwwww) 
    addEventHandler("onClientGUIClick", botonnsalir,misionterminada1, false)    
     addEventHandler("onClientGUIClick", botonnsalir,salirfin, false)    
end 
  
  
function empezarmision1 () 
    showCursor(true) 
    markerfin = createMarker (612.439453125, -609.3994140625, 17.2265625, 23,"cylinder", 1.8, 0, 0, 255, 255 ) 
addEventHandler('onClientMarkerHit', markerfin,mkf) 
end 
  
addEventHandler('onClientMarkerHit', markerinicio, 
function ( hitPlayer ) 
    if ( hitPlayer == localPlayer ) then 
        Panel1() 
        showCursor( true ) 
    end 
end ) 
  
function mkf ( hitPlayer ) 
    if ( hitPlayer == localPlayer ) then 
        panelfinal() 
        showCursor( true ) 
    end 
end 
  
  
function misionterminada1 () 
destroyElement ( markerfin ) 
end 
  
function salir1() 
    showCursor(false) 
    destroyElement(window) 
end 
  
function salirfin() 
    showCursor(false) 
    destroyElement(windowwwwwww) 
end 
  
  

El problema era que se estaba ejecutando el evento cuando el resource se iniciaba y como el marker no existia porque no habías clickeado daba el error.

Link to comment
  • Recently Browsing   0 members

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