Nicolas ECM Posted November 19, 2014 Posted November 19, 2014 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.
Castillo Posted November 19, 2014 Posted November 19, 2014 Y el error que te aparece es...? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Nicolas ECM Posted November 19, 2014 Author Posted November 19, 2014 Lol JAJA el error que me aparece es que no me abre el panel del final, entro al marker y no pasa nada ayuda porfavor .
Tomas Posted November 20, 2014 Posted November 20, 2014 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 Currently developing for International Gaming Community - Join us!
Nicolas ECM Posted November 20, 2014 Author Posted November 20, 2014 No me sirvio, esto es lo que me aparece en el debugscript con el primer codigo que coloque: Bad argument @ "addEventHandler"[Expected element at argument 2,got nil] linea 41.
Tomas Posted November 20, 2014 Posted November 20, 2014 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. Currently developing for International Gaming Community - Join us!
Tomas Posted November 21, 2014 Posted November 21, 2014 De nada. Currently developing for International Gaming Community - Join us!
Recommended Posts