Alexs Posted April 6, 2012 Posted April 6, 2012 Veran, estoy intentando crear un vehiculo que sirva de lanzemisiles, pero hay un problema, el vehiculo no me deja entrar, el debugscript no me dice nada, este es el script: local misilero = createVehicle ( 411, 2224.51, 2459.16, 10.168 ) function lanzamisiles (source) if ( source == misilero ) then if not createProjectile(getLocalPlayer(),19,getElementPosition(getLocalPlayer()),70) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles", source ) end end end bindKey ( "B", "down", lanzamisiles ) y este el meta.xml "Alexs_Steel" version="1.0" type="script" /> Por que no me deja entrar al Infernus?? Nota: Si lo crea, pero no me deja entrar, y el problema no es el PC ni el juego, por que a otros autos si puedo... Developer @ MYVAL
iFoReX Posted April 6, 2012 Posted April 6, 2012 creo que podes aserlo con createProjectile attachElements elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Alexs Posted April 6, 2012 Author Posted April 6, 2012 creo que podes aserlo con createProjectile attachElements Leiste el problema?? el Misil no se si lo lanza, pero el vehiculo no me permite entrar en el.. Developer @ MYVAL
iFoReX Posted April 6, 2012 Posted April 6, 2012 tienes que hacer el vehiculo en server-side, creo osino lo ases en un archivo .map , a mi me pasaba el mismo problema porq avia echo el vehiculo en client-side elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Alexs Posted April 6, 2012 Author Posted April 6, 2012 tienes que hacer el vehiculo en server-side, creo osino lo ases en un archivo .map , a mi me pasaba el mismo problema porq avia echo el vehiculo en client-side ya pude entrar, pero no lanza el misil, q podra ser? intente cambiar el bindkey por un addcommand pero nada Developer @ MYVAL
Castillo Posted April 6, 2012 Posted April 6, 2012 "source" no esta definido, tenes que obtener el vehiculo del jugador y luego compararlo. local misilero = createVehicle ( 411, 2224.51, 2459.16, 10.168 ) function lanzamisiles ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) if ( vehicle and vehicle == misilero ) then if ( not createProjectile ( localPlayer, 19, getElementPosition ( localPlayer ), 70) ) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles" ) end end end bindKey ( "B", "down", lanzamisiles ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Edikosh998 Posted April 6, 2012 Posted April 6, 2012 Aca hay errores de fundamentos : https://wiki.multitheftauto.com/wiki/BindKey Donde pusiste source, en realidad seria "key"...Osea esta mal el parametro usado local misilero = createVehicle ( 411, 2224.51, 2459.16, 10.168 ) function lanzamisiles () local auto = getPedOccupiedVehicle(localPlayer) -- Con esto detectamos el auto que esta adentro el localPlayer. Si no esta devuelve false if auto == misilero then proyectil = createProjectile(localPlayer,19,getElementPosition(localPlayer),70) if not proyectil then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles") -- Outputchat box va sin el destinatario, si se sabe que es el localPlayer end else outputChatBox("No estas dentro del misilero") end end bindKey ( "B", "down", lanzamisiles ) JAJAJAJAJ ME GANASTEEEEEEE CASTILLOO WRS( World Racing Server) [server] = 8%
Alexs Posted April 6, 2012 Author Posted April 6, 2012 Ninguno sirvio, probe con el de @Edikosh998 y me dice "No estas dentro del Misilero", probe con el de SolidSnake14 y volvi al problema inicial, pase el auto a server-side y no disparaba Developer @ MYVAL
Castillo Posted April 6, 2012 Posted April 6, 2012 -- client side: function lanzamisiles ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) if ( vehicle and vehicle == getElementByID ( "misilero" ) ) then if ( not createProjectile ( localPlayer, 19, getElementPosition ( localPlayer ), 70) ) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles" ) end end end bindKey ( "B", "down", lanzamisiles ) -- server side: local misilero = createVehicle ( 411, 2224.51, 2459.16, 10.168 ) setElementID ( misilero, "misilero" ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted April 6, 2012 Author Posted April 6, 2012 -- client side: function lanzamisiles ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) if ( vehicle and vehicle == getElementByID ( "misilero" ) ) then if ( not createProjectile ( localPlayer, 19, getElementPosition ( localPlayer ), 70) ) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles" ) end end end bindKey ( "B", "down", lanzamisiles ) -- server side: local misilero = createVehicle ( 411, 2224.51, 2459.16, 10.168 ) setElementID ( misilero, "misilero" ) Gracias, eso sirve, una ultima cosa, algun consejo para no explotar al pulsar la B? Developer @ MYVAL
Edikosh998 Posted April 6, 2012 Posted April 6, 2012 Que al disparar se rompe el auto? Porque el proyectil esta en la posicion del jugador, capaz si lo pones un poco mas arriba... y + 5 Fijate (en getElementPosition(localPlayer)) WRS( World Racing Server) [server] = 8%
Castillo Posted April 6, 2012 Posted April 6, 2012 Si, quita el script . Nah, joda, es que vos le diste la posicion tuya como destino. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted April 6, 2012 Author Posted April 6, 2012 function lanzamisiles ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) local x, y, z = getElementPosition (localPlayer) if ( vehicle and vehicle == getElementByID ( "misilero" ) ) then if ( not createProjectile ( localPlayer, 19, x, y, z + 15 ( localPlayer ), 70) ) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles" ) end end end bindKey ( "B", "down", lanzamisiles ) Asi sirve? Developer @ MYVAL
Castillo Posted April 6, 2012 Posted April 6, 2012 Me explicas para que dejaste esto? ( localPlayer ) function lanzamisiles ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) local x, y, z = getElementPosition (localPlayer) if ( vehicle and vehicle == getElementByID ( "misilero" ) ) then if ( not createProjectile ( localPlayer, 19, x, y, z + 15, 70) ) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles" ) end end end bindKey ( "B", "down", lanzamisiles ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted April 6, 2012 Author Posted April 6, 2012 Me explicas para que dejaste esto? ( localPlayer ) function lanzamisiles ( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) local x, y, z = getElementPosition (localPlayer) if ( vehicle and vehicle == getElementByID ( "misilero" ) ) then if ( not createProjectile ( localPlayer, 19, x, y, z + 15, 70) ) then outputChatBox ( "Ha ocurrido un problema, deja descansar el lanzamisiles" ) end end end bindKey ( "B", "down", lanzamisiles ) crei que serviria, entonces como le hago para q dispare hacia el frente y no a mi? Developer @ MYVAL
Castillo Posted April 6, 2012 Posted April 6, 2012 Pues si, yo nomas arregle ese error que tenias, el resto estaba bien. Copia mi ultimo codigo. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Edikosh998 Posted April 6, 2012 Posted April 6, 2012 Z es para arriba y abajo no? WRS( World Racing Server) [server] = 8%
Castillo Posted April 6, 2012 Posted April 6, 2012 Exacto. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Edikosh998 Posted April 6, 2012 Posted April 6, 2012 Exacto. Queria sacarme la duda porque yo le dije "y + 5" pensando como algo 2D....y en realidad lo que queria decir era Z WRS( World Racing Server) [server] = 8%
Alexs Posted April 6, 2012 Author Posted April 6, 2012 Exacto. Queria sacarme la duda porque yo le dije "y + 5" pensando como algo 2D....y en realidad lo que queria decir era Z Jajaj lo note, pero me se lo de X Y Z, pueden cerrar el tema, todo resuelto, me falta agregar el modelo del cañon, pero eso es mas simple, gracias a todos Developer @ MYVAL
Castillo Posted April 6, 2012 Posted April 6, 2012 De nada. Tema cerrado. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts