Squirrel/Server/Functions/Vehicles/Siren
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|Vehicle.SirenLight}} This ''Vehicle'' class member returns whether the vehicle's siren light is enabled or enables/disables it. Note that this member is only val…') |
Revision as of 22:02, 12 September 2011
This Vehicle class member returns whether the vehicle's siren light is enabled or enables/disables it. Note that this member is only valid for vehicles with a siren.
Syntax
You can either return or set a new value using this member:
bool Vehicle.SirenLight
Vehicle.SirenLight = bool enabled
Arguments
- enabled - A boolean representing whether siren light should be enabled (true) or disabled (false)
Example 1. Returning
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "slight" ) { if ( pPlayer.Vehicle ) MessagePlayer( "Your vehicle's siren light is currently - " + pPlayer.Vehicle.SirenLight, pPlayer ); } return 1; }
Notes
The function MessagePlayer and event onPlayerCommand were used in this example. More info about them in the corresponding pages.
Example 2. Setting
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "slighton" ) { if ( pPlayer.Vehicle ) pPlayer.Vehicle.SirenLight = true; } return 1; }
Notes
The event onPlayerCommand was used in this example. More info about this in the corresponding page.
Related Functions
- CreateVehicle
- FindVehicle
- GetClosestVehicle
- GetVehicleCount
- GetVehicleHandlingData
- GetVehicleIDFromName
- GetVehicleName
- SetVehicleHandlingData
- Vehicle.Alpha
- Vehicle.Angle
- Vehicle.Colour1
- Vehicle.Colour2
- Vehicle.Driver
- Vehicle.EngineDamage
- Vehicle.Explode
- Vehicle.Fix
- Vehicle.GetAddon
- Vehicle.GetPassenger
- Vehicle.GetHandlingData
- Vehicle.GetWheelStatus
- Vehicle.Health
- Vehicle.ID
- Vehicle.IdleRespawnTime
- Vehicle.IdleTime
- Vehicle.LightState
- Vehicle.Locked
- Vehicle.Marker
- Vehicle.MarkerScale
- Vehicle.MarkerSprite
- Vehicle.Model
- Vehicle.OneTime
- Vehicle.PassengerCount
- Vehicle.Pos
- Vehicle.Remove
- Vehicle.Respawn
- Vehicle.RespawnTime
- Vehicle.RGBColour1
- Vehicle.RGBColour2
- Vehicle.SetHandlingData
- Vehicle.SetWheelStatus
- Vehicle.SpawnAngle
- Vehicle.SpawnPos
- Vehicle.SetAddon
- Vehicle.SetEngineState
- Vehicle.SetRadio
- Vehicle.Siren
- Vehicle.SirenLight
- Vehicle.TaxiLight
- Vehicle.Velocity
- Vehicle.VirtualWorld
- Vehicle.Wrecked