Jump to content

ayuda de como hacer este script


JuanM27

Recommended Posts

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

Link to comment

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 ) 

Link to comment

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?

Link to comment
  • Recently Browsing   0 members

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