SetVehicleDamageProof: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(OOP)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Needs_Checking|Broken serverside, tested and working clientside --[[User:Ransom|Ransom]] 09:41, 18 September 2007 (CDT)}}
__NOTOC__
__NOTOC__
{{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. Also, flipping the vehicle still causes it to explode.
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==  
==Syntax==  
<section name="Server and Client" class="both" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
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.
Line 17: Line 14:
===Returns===
===Returns===
Returns ''true'' if the vehicle was set damage proof succesfully, ''false'' if the arguments are invalid or it failed.
Returns ''true'' if the vehicle was set damage proof succesfully, ''false'' if the arguments are invalid or it failed.
</section>


==Example==
==Example==
<section name="Server and Client" class="both" show="true">
This example spawns a vehicle and sets it damage proof immediately.
This example spawns a vehicle and sets it damage proof immediately.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 26: Line 21:
setVehicleDamageProof(newvehicle, true)
setVehicleDamageProof(newvehicle, true)
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Vehicle functions}}
{{Vehicle functions}}

Latest revision as of 23:54, 17 December 2014

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