JuanM27 Posted July 14, 2012 Posted July 14, 2012 hola buenas noches. estoy queriendo hacer un script para que el vehiculo no Explote. yo lo hice asi pero no anda function displayVehicleLoss(loss) local VidaAuto = getElementHealth(getVehicleOccupant(source)) outputChatBox("Le Queda de Vida " .. tonumber(VidaAuto) .. " health.", source) local MiAuto = getPedOccupiedVehicle (source) if tonumber(VidaAuto) <= 251 then setVehicleEngineState ( MiAuto, false ) else setVehicleEngineState ( MiAuto, true ) end end addEventHandler("onVehicleDamage", getRootElement(), displayVehicleLoss) que esta mal o que me falta? saludos
Castillo Posted July 14, 2012 Posted July 14, 2012 Esta todo mal. function displayVehicleLoss ( loss ) local VidaAuto = math.floor ( tonumber ( getElementHealth ( source ) ) ) local driver = getVehicleController ( source ) if ( driver ) then outputChatBox ( "Le queda ".. VidaAuto .."% de vida a tu vehiculo.", driver ) end if ( VidaAuto <= 251 ) then setVehicleEngineState ( source, false ) else setVehicleEngineState ( source, true ) end end addEventHandler ( "onVehicleDamage", getRootElement(), displayVehicleLoss ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
JuanM27 Posted July 14, 2012 Author Posted July 14, 2012 gracias solid hasta aca va bien, con esto me apaga el motor del auto setVehicleEngineState ( source, false ) pero lo que yo quiero hacer es que el auto no explote (lo vi en varios server, por ejemplo el cit o proyectX) tendria que hacer que cancele el evento OnVehicleExplode verdad?
Castillo Posted July 14, 2012 Posted July 14, 2012 No, no se puede cancelar ese evento. En el SAUR yo lo hice asi: setElementHealth ( source, 300 ) setVehicleDamageProof ( source, true ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
JuanM27 Posted July 14, 2012 Author Posted July 14, 2012 ah no sabia que no se podia cancelar ese evento. la verdad solid muchas gracias siempre me ayudaste en todas mis preguntas sos un kpo
Castillo Posted July 14, 2012 Posted July 14, 2012 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts