GetVehicleSirensOn: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
m (Highlighting fix) |
||
Line 8: | Line 8: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' The vehicle that will be checked | *'''theVehicle:''' The vehicle that will be checked. | ||
===Returns=== | ===Returns=== | ||
Line 16: | Line 16: | ||
This example toggles siren state when a player enters a vehicle as a driver. | This example toggles siren state when a player enters a vehicle as a driver. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function example_onVehicleEnter ( | function example_onVehicleEnter ( thePlayer, seat ) | ||
--If the player entered as a driver | --If the player entered as a driver | ||
if ( seat == 0 ) then | if ( seat == 0 ) then |
Revision as of 15:37, 4 August 2007
This function returns whether the sirens are turned on for the specified vehicle.
Syntax
bool getVehicleSirensOn ( vehicle theVehicle )
Required Arguments
- theVehicle: The vehicle that will be checked.
Returns
Returns true if the sirens are turned on for the specified vehicle, false if the sirens are turned off for the specified vehicle, if the vehicle doesn't have sirens or if invalid arguments are specified.
Example
This example toggles siren state when a player enters a vehicle as a driver.
function example_onVehicleEnter ( thePlayer, seat ) --If the player entered as a driver if ( seat == 0 ) then --If siren was off if not getVehicleSirensOn ( source ) then setVehicleSirensOn ( source, true ) --Turn it on else setVehicleSirensOn ( source, false ) --Turn it off end end end addEventHandler ( "onVehicleEnter", getRootElement(), example_onVehicleEnter )
See Also
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates