SetVehicleDamageProof: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (Add information about peds not getting knocked off bikes when it's set damage proof (The game apparently skips collisions when this is set)) |
||
(One intermediate revision by one other user not shown) | |||
Line 2: | Line 2: | ||
{{Server client function}} | {{Server client function}} | ||
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. | 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.}} | |||
==Syntax== | ==Syntax== | ||
Line 7: | Line 9: | ||
bool setVehicleDamageProof ( vehicle theVehicle, bool damageProof ) | bool setVehicleDamageProof ( vehicle theVehicle, bool damageProof ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:setDamageProof|damageProof|isVehicleDamageProof}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' The [[vehicle]] you wish to make damage proof. | *'''theVehicle:''' The [[vehicle]] you wish to make damage proof. |
Latest revision as of 11:20, 24 October 2024
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.
Syntax
bool setVehicleDamageProof ( vehicle theVehicle, bool damageProof )
OOP Syntax Help! I don't understand this!
- Method: vehicle:setDamageProof(...)
- Variable: .damageProof
- Counterpart: isVehicleDamageProof
Required Arguments
- theVehicle: The vehicle you wish to make damage proof.
- damageProof: true is damage proof, false is damageable.
Returns
Returns true if the vehicle was set damage proof succesfully, false if the arguments are invalid or it failed.
Example
This example spawns a vehicle and sets it damage proof immediately.
newvehicle = createVehicle(602, 0, 0, 6) setVehicleDamageProof(newvehicle, true)
See Also
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates