IsVehicleDamageProof: Difference between revisions
Jump to navigation
Jump to search
(Created page with '{{Server client function}} __NOTOC__ This function checks if a vehicle is damage proof (set with setVehicleDamageProof). ==Syntax== <syntaxhighlight lang="lua"> bool isVehicleDamageProof …') |
Biistamais (talk | contribs) No edit summary |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 7: | Line 7: | ||
bool isVehicleDamageProof ( vehicle theVehicle ) | bool isVehicleDamageProof ( vehicle theVehicle ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:isDamageProof|damageProof|setVehicleDamageProof}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' the vehicle whose invincibility status we want to check. | *'''theVehicle:''' the vehicle whose invincibility status we want to check. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the vehicle is damage proof, ''false'' if it isn't or if invalid arguments were passed. | |||
==Example== | ==Example== | ||
This example will output in the chatbox whether the vehicle is vulnerable to damage or not when a player enters in it. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function checkVulnerability(theVehicle) | |||
if isVehicleDamageProof(theVehicle) then | |||
outputChatBox("This vehicle is not vulnerable to damage", source) | |||
else | |||
outputChatBox("This vehicle is vulnerable to damage", source) | |||
end | |||
end | |||
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), checkVulnerability ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Vehicle_functions}} | {{Vehicle_functions}} | ||
Latest revision as of 13:46, 22 July 2017
This function checks if a vehicle is damage proof (set with setVehicleDamageProof).
Syntax
bool isVehicleDamageProof ( vehicle theVehicle )
OOP Syntax Help! I don't understand this!
- Method: vehicle:isDamageProof(...)
- Variable: .damageProof
- Counterpart: setVehicleDamageProof
Required Arguments
- theVehicle: the vehicle whose invincibility status we want to check.
Returns
Returns true if the vehicle is damage proof, false if it isn't or if invalid arguments were passed.
Example
This example will output in the chatbox whether the vehicle is vulnerable to damage or not when a player enters in it.
function checkVulnerability(theVehicle) if isVehicleDamageProof(theVehicle) then outputChatBox("This vehicle is not vulnerable to damage", source) else outputChatBox("This vehicle is vulnerable to damage", source) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), checkVulnerability )
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