setVehicleDoorsUndamageable | Multi Theft Auto: Wiki Skip to content

setVehicleDoorsUndamageable

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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


This function makes a vehicle's doors undamageable, so they won't fall off when they're hit. Note that the vehicle has to be locked using setVehicleLocked for this setting to have any effect.

Syntax

setVehicleDoorsUndamageable ( )

Code Examples

server

Here you can disable all vehicles doors damage with /nodamage, and enable it with /adddamage.

function doorsLikeGod()
for i, car in ipairs( getElementsByType ("vehicle") ) do
setVehicleDoorsUndamageable ( car, true )
end
outputChatBox("All vehicles doors is not damageable")
end
addCommandHandler("nodamage", doorsLikeGod)
function doorsNotLikeGod()
for i, car in ipairs( getElementsByType ("vehicle") ) do
setVehicleDoorsUndamageable ( car, false )
end
outputChatBox("Now everyone can kick vehicles doors and throw them away.")
end
addCommandHandler("adddamage", doorsNotLikeGod)

See Also

Vehicle Functions