SetVehicleDoorsUndamageable: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Server client function}}
{{Server client function}}
This function is used to make a cars doors undamageable.
This function is used to make a car's doors undamageable.


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setVehicleDoorsUndamageable ( vehicle thevehicle, bool state )
bool setVehicleDoorsUndamageable ( vehicle theVehicle, bool state )
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
*'''thevehicle:''' The vehicle of which you wish to set the car door damageability.
*'''theVehicle:''' The vehicle of which you wish to set the car door damageability.
*'''state:''' ''true'' or ''false''.
*'''state:''' ''true'' is undamageable, ''false'' damageable.


===Returns===
===Returns===
Returns ''true'' if successful, ''false'' otherwise.
Returns ''true'' if successful, ''false'' otherwise.


==Example==  
==Example==
<!-- Explain what the example is in a single sentance -->
As long as a Cluckin' Bell cock is in a car, that car's doors are damage proof.
This example does...
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized -->
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function onPlayerEnterVehicle ( theVehicle )
blabhalbalhb --abababa
    if getPlayerSkin ( source ) == 167
--This line does this...
          setVehicleDoorsUndamageable ( theVehicle, true )
mooo
    end
end
addEventHandler ( "onPlayerEnterVehicle", getRootElement ( ), onPlayerEnterVehicle )
 
function onPlayerExitVehicle ( theVehicle )
    if getPlayerSkin ( source ) == 167
          setVehicleDoorsUndamageable ( theVehicle, false )
    end
end
addEventHandler ( "onPlayerExitVehicle", getRootElement ( ), onPlayerExitVehicle )
</syntaxhighlight>
</syntaxhighlight>



Revision as of 20:33, 15 August 2007

This function is used to make a car's doors undamageable.

Syntax

bool setVehicleDoorsUndamageable ( vehicle theVehicle, bool state )

Required Arguments

  • theVehicle: The vehicle of which you wish to set the car door damageability.
  • state: true is undamageable, false damageable.

Returns

Returns true if successful, false otherwise.

Example

As long as a Cluckin' Bell cock is in a car, that car's doors are damage proof.

function onPlayerEnterVehicle ( theVehicle )
     if getPlayerSkin ( source ) == 167
          setVehicleDoorsUndamageable ( theVehicle, true )
     end
end
addEventHandler ( "onPlayerEnterVehicle", getRootElement ( ), onPlayerEnterVehicle )

function onPlayerExitVehicle ( theVehicle )
     if getPlayerSkin ( source ) == 167
          setVehicleDoorsUndamageable ( theVehicle, false )
     end
end
addEventHandler ( "onPlayerExitVehicle", getRootElement ( ), onPlayerExitVehicle )

See Also

Template:FunctionArea functions -- leave this unless you complete the function