setVehicleDamageProof | Multi Theft Auto: Wiki Skip to content

setVehicleDamageProof

Client-side
Server-side
Shared

Pair: isVehicleDamageProof

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This functions makes a vehicle damage proof, so it won't take damage from bullets, hits, explosions or fire. A damage proof's vehicle health can still be changed via script.

Note

Setting a bike damage proof will have the side-effect of peds not being able to get knocked off anymore, even if setPedCanBeKnockedOffBike is set to true. Consider using and cancelling the onVehicleDamage / onClientVehicleDamage events instead.

OOP Syntax Help! I don't understand this!

  • Method:vehicle:setDamageProof(...)
  • Variable: .damageProof

Syntax

bool setVehicleDamageProof ( vehicle theVehicle, bool damageProof )
Required Arguments
  • theVehicle: The vehicle you wish to make damage proof.
  • damageProof: true is damage proof, false is damageable.

Returns

  • bool: value

Returns true if the vehicle was set damage proof succesfully, false if the arguments are invalid or it failed.

Code Examples

shared

This example spawns a vehicle and sets it damage proof immediately.

newvehicle = createVehicle(602, 0, 0, 6)
setVehicleDamageProof(newvehicle, true)

See Also

Vehicle Functions