Arsilex Posted August 19, 2012 Posted August 19, 2012 Como hacer para que cuando ponga la bomba se ponga en el coche que estoy y cuando entro que explote y no exploten otros coches osea solo 1 vez function blowVehicleEnterr ( thePlayer, seat, jacked ) if seat == 0 then blowVehicle ( source ) cancelEvent() end end function bomba11() addEventHandler ( "onVehicleEnter", getRootElement(), blowVehicleEnterr ) end addEvent( "onBomba1", true ) addEventHandler( "onBomba1", getRootElement(), bomba11) function blowVehicleEnter ( thePlayer, seat, jacked ) if seat == 0 then setTimer ( function (thePlayer) blowVehicle ( source ) end ,6000,1 ) end end function bomba22() addEventHandler ( "onVehicleEnter", getRootElement(), blowVehicleEnter ) end addEvent( "onBomba2", true ) addEventHandler( "onBomba2", getRootElement(), bomba22)
Castillo Posted August 19, 2012 Posted August 19, 2012 bombVehicles = { } function bomba11 ( ) local vehicle = getPedOccupiedVehicle ( source ) if ( vehicle ) then bombVehicles [ vehicle ] = true end end addEvent ( "onBomba1", true ) addEventHandler ( "onBomba1", getRootElement(), bomba11 ) function blowVehicleEnter ( thePlayer, seat, jacked ) if ( seat == 0 and bombVehicles [ source ] ) then setTimer ( function ( ) blowVehicle ( source ) end ,6000, 1 ) end end addEventHandler ( "onVehicleEnter", getRootElement(), blowVehicleEnter ) function bomba22 ( ) local vehicle = getPedOccupiedVehicle ( source ) if ( vehicle ) then bombVehicles [ vehicle ] = true end end addEvent ( "onBomba2", true ) addEventHandler ( "onBomba2", getRootElement(), bomba22 )
Arsilex Posted August 19, 2012 Author Posted August 19, 2012 si no explotan pero tampoco explota el coche que tiene la bomba
Alexs Posted August 19, 2012 Posted August 19, 2012 si no explotan pero tampoco explota el coche que tiene la bomba Si no me equivoco, quieres que explote solo un auto especifico? Puedes intentar así: local auto = createVehicle(argumentos) --no me tomare el tiempo de ponerlos, sabes que va ahí. function blowVehicleEnterr ( thePlayer, seat, jacked ) if seat == 0 and source == auto then --compruebas si el auto es 'auto' blowVehicle ( source ) cancelEvent() end end
Arsilex Posted August 19, 2012 Author Posted August 19, 2012 No es para mi role en role el createVehicle da error en getElement y lo borra automatico lo que quiero es que tengo un panel presiona el boton de comprar bomba y se ponga me salgo dejo el caro donde quiero y quien se suba que aga boom
Alexs Posted August 19, 2012 Posted August 19, 2012 No es para mi role en role el createVehicle da error en getElement y lo borra automatico lo que quiero es que tengo un panel presiona el boton de comprar bomba y se ponga me salgo dejo el caro donde quiero y quien se suba que aga boom Puedes usar los element data, al pulsarse el botón, deja el element data del vehículo en true, al subir, compruebas si es true, si es así, BOOM.
Arsilex Posted August 19, 2012 Author Posted August 19, 2012 Bueno mira tengo solucionado lo de que no explota pero ahora tengo otra duda function bomba22 ( ) local vehicle = getPedOccupiedVehicle ( source ) if ( vehicle ) then bombVehicles [ vehicle ] = true setTimer ( function ( ) addEventHandler ( "onVehicleEnter", getRootElement(), blowVehicleEnterr ) end ,6000,1 ) end end addEvent ( "onBomba2", true ) addEventHandler ( "onBomba2", getRootElement(), bomba22 ) function blowVehicleEnterr ( thePlayer, seat, jacked ) if ( seat == 0 and bombVehicles [ source ] ) then blowVehicle ( source ) end end Como es posible hacer que explote en 10 segundos ?
Alexs Posted August 19, 2012 Posted August 19, 2012 Bueno mira tengo solucionado lo de que no explota pero ahora tengo otra duda function bomba22 ( ) local vehicle = getPedOccupiedVehicle ( source ) if ( vehicle ) then bombVehicles [ vehicle ] = true setTimer ( function ( ) addEventHandler ( "onVehicleEnter", getRootElement(), blowVehicleEnterr ) end ,6000,1 ) end end addEvent ( "onBomba2", true ) addEventHandler ( "onBomba2", getRootElement(), bomba22 ) function blowVehicleEnterr ( thePlayer, seat, jacked ) if ( seat == 0 and bombVehicles [ source ] ) then blowVehicle ( source ) end end Como es posible hacer que explote en 10 segundos ? Pon un setTimer en el 'blowVehicle'.
Arsilex Posted August 19, 2012 Author Posted August 19, 2012 ya lo intente y me sale que el blow tiene un argumento erroneo e.e
Alexs Posted August 19, 2012 Posted August 19, 2012 ya lo intente y me sale que el blow tiene un argumento erroneo e.e Postea tu Intento.
Arsilex Posted August 19, 2012 Author Posted August 19, 2012 function bomba22 ( ) local vehicle = getPedOccupiedVehicle ( source ) if ( vehicle ) then bombVehicles [ vehicle ] = true end end addEvent ( "onBomba2", true ) addEventHandler ( "onBomba2", getRootElement(), bomba22 ) function blowVehicleEnterr ( thePlayer, seat, jacked ) if ( seat == 0 and bombVehicles [ source ] ) then setTimer ( function ( ) blowVehicle ( source ) end ,6000,1 ) end end addEventHandler ( "onVehicleEnter", getRootElement(), blowVehicleEnterr )
Alexs Posted August 19, 2012 Posted August 19, 2012 function blowVehicleEnterr ( thePlayer, seat, jacked ) if ( seat == 0 and bombVehicles [ source ] ) then setTimer(blowVehicle, 5000, 1, source ) end end
Arsilex Posted August 19, 2012 Author Posted August 19, 2012 ok mañana lo pruebo gracias por tu ayuda alexs
Recommended Posts