Jump to content

vehicle damage


Apo

Recommended Posts

help me for my code

function vehicledamaged (thePlayer) 
  
if isPedInVehicle (thePlayer) then 
local vehicle = getPedOccupiedVehicle (thePlayer) 
setVehicleDamageProof (vehicle, false) 
  
  
end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), vehicledamaged ) 
  
function vehicleundamaged (thePlayer) 
  
if isPedInVehicle (thePlayer) then 
local vehicle = getPedOccupiedVehicle (thePlayer) 
setVehicleDamageProof (vehicle, true) 
fixVehicle (vehicle) 
 end 
end 
  
addEventHandler ( "onVehicleExit", getRootElement(), vehicleundamaged ) 
  

Link to comment

try this:

function vehicledamaged (thePlayer) 
-- source is the vehicle 
setVehicleDamageProof (source, false) -- damagable 
fixVehicle (source) 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), vehicledamaged ) 
  
function vehicleundamaged (thePlayer) 
setVehicleDamageProof (source, true) -- not damagable 
fixVehicle (source) 
end 
addEventHandler ( "onVehicleExit", getRootElement(), vehicleundamaged ) 

Link to comment

try this

  
function damageNo (player)  
   setVehicleDamageProof(source, true)    
end 
addEventHandler("onVehicleEnter", getRootElement(), damageNo) 
  
function damageYes (player)  
   setVehicleDamageProof(source, false)   
end 
addEventHandler("onVehicleExit", getRootElement(), damageYes) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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