SetVehicleDoorsUndamageable: Difference between revisions
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 | This function is used to make a car's doors undamageable. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setVehicleDoorsUndamageable ( vehicle | 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. | ||
*'''state:''' ''true'' | *'''state:''' ''true'' is undamageable, ''false'' damageable. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if successful, ''false'' otherwise. | Returns ''true'' if successful, ''false'' otherwise. | ||
==Example== | ==Example== | ||
As long as a Cluckin' Bell cock is in a car, that car's doors are damage proof. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
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 ) | |||
</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