Andrixx Posted January 27, 2013 Share Posted January 27, 2013 Hola. Estaba creando un script y lo tengo listo pero el unico problema esque cuando alguien pasa por el marker creado para conseguir el trabajo, a todas las personas que se encuentran en el server se les abre el panel... cosa que no deberia pasar... Aqui les dejo el client para que vean en que estoy mal.. local joinBD = createMarker(-2033.0302734375, -117.400390625, 1034.171875,"cylinder",1.5,0,0,255,255) local player = getLocalPlayer setElementInterior(joinBD,3) function caca(theplayer) ventana = guiCreateWindow(0.33, 0.11, 0.36, 0.75, "Trabajo taxi", true) guiWindowSetSizable(ventana, false) guiSetProperty(ventana, "CaptionColour", "FFFF0000") texto = guiCreateMemo((455 - 404) / 2, (447 - 240) / 7, 404, 240, "texto no necesario.", false, ventana) guiSetProperty(texto, "Text", "texto no necesario.") guiMemoSetReadOnly(texto, true) Aceptar = guiCreateButton(0.07, 0.81, 0.42, 0.14, "Aceptar trabajo", true, ventana) salir = guiCreateButton(0.54, 0.81, 0.42, 0.14, "Salir del trabajo", true, ventana) cerrar = guiCreateButton(0.54, 0.63, 0.42, 0.14, "Cerrar", true, ventana) checkboox = guiCreateCheckBox(0.06, 0.64, 0.43, 0.11, "Acepto las reglas", false, true, ventana) showCursor ( true ) addEventHandler ( "onClientGUIClick", cerrar, Exit, false ) addEventHandler ( "onClientGUIClick", Aceptar, accept, false ) addEventHandler ( "onClientGUIClick", checkboox, cheeck, false ) addEventHandler ( "onClientGUIClick", salir, salirr, false ) end addEventHandler( "onClientMarkerHit", joinBD, caca ) Y lo que quiero conseguir es que solo se abra ese panel solo a la persona que se situo en el marker.. ¿Cual es el error? o ¿Que debo hacer? Gracias. Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 Verifica si el jugador que toco el marker es el cliente con: if ( theplayer == localPlayer ) then -- Tu codigo aqui. end Link to comment
Andrixx Posted January 27, 2013 Author Share Posted January 27, 2013 Gracias por responder, pero "-- Tu codigo aqui." A que codigo te refieres? Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 Al de crear el GUI obvio. Link to comment
Andrixx Posted January 27, 2013 Author Share Posted January 27, 2013 mira lo hice asi (no se si esta bien) local joinBD = createMarker(-2033.0302734375, -117.400390625, 1034.171875,"cylinder",1.5,0,0,255,255) local player = getLocalPlayer setElementInterior(joinBD,3) if ( theplayer == localPlayer ) then function caca(theplayer) ventana = guiCreateWindow(0.33, 0.11, 0.36, 0.75, "Trabajo taxi", true) guiWindowSetSizable(ventana, false) guiSetProperty(ventana, "CaptionColour", "FFFF0000") texto = guiCreateMemo((455 - 404) / 2, (447 - 240) / 7, 404, 240, "texto no necesario.", false, ventana) guiSetProperty(texto, "Text", "texto no necesario.") guiMemoSetReadOnly(texto, true) Aceptar = guiCreateButton(0.07, 0.81, 0.42, 0.14, "Aceptar trabajo", true, ventana) salir = guiCreateButton(0.54, 0.81, 0.42, 0.14, "Salir del trabajo", true, ventana) cerrar = guiCreateButton(0.54, 0.63, 0.42, 0.14, "Cerrar", true, ventana) checkboox = guiCreateCheckBox(0.06, 0.64, 0.43, 0.11, "Acepto las reglas", false, true, ventana) showCursor ( true ) addEventHandler ( "onClientGUIClick", cerrar, Exit, false ) addEventHandler ( "onClientGUIClick", Aceptar, accept, false ) addEventHandler ( "onClientGUIClick", checkboox, cheeck, false ) addEventHandler ( "onClientGUIClick", salir, salirr, false ) end end addEventHandler( "onClientMarkerHit", joinBD, caca ) pero al iniciarlo me el debugscript 3 me dice esto 19:Bad argument @ 'addEventHandler' [Expected element aat argument 2, got nil] 20:Bad argument @ 'addEventHandler' [Expected element aat argument 2, got nil] 21:Bad argument @ 'addEventHandler' [Expected element aat argument 2, got nil] 22:Bad argument @ 'addEventHandler' [Expected element aat argument 2, got nil] Me lo dice 4 veces pero cambia en en numero de la linea... Gracias. Link to comment
Castillo Posted January 27, 2013 Share Posted January 27, 2013 Tiene que ir dentro de la funcion, no fuera. Link to comment
Andrixx Posted January 27, 2013 Author Share Posted January 27, 2013 Ho! Muchas gracias Castillo, eres genial, encerio... Gracias a ti logre completar mi primer script de nivel medio De verdad Muchas gracias. Link to comment
Recommended Posts