SetVehicleDamageProof: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(OOP)
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__
This function allows you to trigger a function after a number of milliseconds have ellapsed. You can call either your own functions, or built in functions. For example, you could set a timer to spawn a player after a number of seconds had ellapsed.
{{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.
Once a timer has finished repeating, it no longer exists.
 
The minimum accepted interval is 50ms.


==Syntax==  
==Syntax==  
Line 10: Line 7:
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 set damage proof.
*'''theVehicle:''' The [[vehicle]] you wish to make damage proof.
*'''damageProof:''' true to set the vehicle damage proof, false otherwise.
*'''damageProof:''' ''true'' is damage proof, ''false'' is damageable.
 
===Optional Arguments===
{{OptionalArg}}
(none)


===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.


==Example==  
==Example==
This example spawn 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">
local vehicle = createVehicle(602,0,0,6)
newvehicle = createVehicle(602, 0, 0, 6)
setVehicleDamageProof(vehicle,true)
setVehicleDamageProof(newvehicle, true)
</syntaxhighlight>
</syntaxhighlight>


==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