GetVehicleSirenParams
From Multi Theft Auto: Wiki
This function get the parameters of a vehicles siren.
Syntax
table getVehicleSirenParams ( vehicle theVehicle )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getSirenParams(...)
- Variable: .sirenParams
Required Arguments
- theVehicle: The vehicle to get the siren parameters of
Returns
Returns a table with the siren count, siren type and a sub table for the four flags. False otherwise.
[int] SirenParams.SirenCount [int] SirenParams.SirenType [table] SirenParams.Flags [bool] SirenParams.Flags["360"] [bool] SirenParams.Flags.DoLOSCheck [bool] SirenParams.Flags.UseRandomiser [bool] SirenParams.Flags.Silent
Example
Click to collapse [-]
ServerThis example returns the vehicle parameters when the players presses g.
addEventHandler("onVehicleEnter",root,function(player,seat) if(player)and(seat==0)then addVehicleSirens(source,1,1) setVehicleSirens(source,1,0,0,0,100,0,100,255,122) bindKey(player,"g","up",getSiren,source) end end) function getSiren(player,button,state,vehicle) local sirenParams = getVehicleSirenParams(vehicle) outputChatBox("Here's the parameters of your vehicle sirens: Siren Points: "..tostring(sirenParams.SirenCount)..", Type of Siren: "..tostring(sirenParams.SirenType)..".",player) end addEventHandler("onVehicleExit",root,function(player,seat) if(player)and(seat==0)then removeVehicleSirens(source) unbindKey(player,"g","up",getSiren) end end)
Requirements
Minimum supported server | 1.3.0-9.03968 |
---|---|
Minimum supported client | 1.3.0-9.03968 |
Note: Using this function requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.3.0-9.03968" client="1.3.0-9.03968" />
See Also
FROM VERSION 1.5.7 r19626 ONWARDS
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getModelHandling
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleRespawnPosition
- getVehicleRespawnRotation
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- getVehiclesOfType
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleSirens
- removeVehicleUpgrade
- resetVehicleExplosionTime
- resetVehicleIdleTime
- respawnVehicle
- setModelHandling
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
FROM VERSION 1.6 r7485 ONWARDS
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleIdleRespawnDelay
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleRespawnDelay
- setVehicleRespawnPosition
- setVehicleRespawnRotation
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition