Jump to content

Evitar morir cuando un vehiculo explote¡?


lLinux

Recommended Posts

  
function correnegrotuautoexplotara (thePlayer) 
            local vehicle = getPedOccupiedVehicle (thePlayer) 
            local vehicleHealth = getElementHealth ( vehicle ) 
            if vehicleHealth <= 200 then 
removePedFromVehicle (thePlayer)  
end 
end 
  

o

  
    addEventHandler("onVehicleDamage", root,  
function() 
            local vehicleHealth=getElementHealth(source); 
            local pasajero = getPedOccupiedVehicle (source); 
            if (vehicleHealth<=200) then 
removePedFromVehicle(pasajero) 
end 
end 
) 
  

Link to comment
  
function correnegrotuautoexplotara (thePlayer) 
            local vehicle = getPedOccupiedVehicle (thePlayer) 
            local vehicleHealth = getElementHealth ( vehicle ) 
            if vehicleHealth <= 200 then 
removePedFromVehicle (thePlayer)  
end 
end 
  

o

  
    addEventHandler("onVehicleDamage", root,  
function() 
            local vehicleHealth=getElementHealth(source); 
            local pasajero = getPedOccupiedVehicle (source); 
            if (vehicleHealth<=200) then 
removePedFromVehicle(pasajero) 
end 
end 
) 
  

La primera opción esta mal planteada, necesitas si o si un evento que la desencadene. La segunda funcionaria sin problemas.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...