SetVehicleDoorsUndamageable

From Multi Theft Auto: Wiki
Revision as of 20:33, 15 August 2007 by Arc (talk | contribs)
Jump to navigation Jump to search

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