GetVehicleSirens: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Corrected some big mistakes at →Returns) |
||
Line 14: | Line 14: | ||
===Returns=== | ===Returns=== | ||
Returns a ''table'' with sub tables containing the properties of | Returns a ''table'' with sub tables containing the properties of each siren point in the following manner: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
[float] SirenData[sirenPoint].x | |||
[ | [float] SirenData[sirenPoint].y | ||
[ | [float] SirenData[sirenPoint].z | ||
[ | [int] SirenData[sirenPoint].Red | ||
[ | [int] SirenData[sirenPoint].Green | ||
[int] SirenData[sirenPoint].Blue | |||
[int] SirenData[sirenPoint].Alpha | |||
[int] SirenData[sirenPoint].Min_Alpha | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 18:19, 30 July 2015
This function get the properties of a vehicles sirens.
Syntax
table getVehicleSirens ( vehicle theVehicle )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getSirens(...)
- Variable: .sirens
- Counterpart: setVehicleSirens
Required Arguments
- theVehicle: The vehicle to get siren information on
Returns
Returns a table with sub tables containing the properties of each siren point in the following manner:
[float] SirenData[sirenPoint].x [float] SirenData[sirenPoint].y [float] SirenData[sirenPoint].z [int] SirenData[sirenPoint].Red [int] SirenData[sirenPoint].Green [int] SirenData[sirenPoint].Blue [int] SirenData[sirenPoint].Alpha [int] SirenData[sirenPoint].Min_Alpha
Example
Click to collapse [-]
ServerThis example returns the siren properties when the player presses g. (Returns nil for some reason)
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 sirenData = getVehicleSirens(vehicle) outputChatBox("Here's the properties of your vehicle sirens: Red,Green,Blue: "..tostring(sirenData[1][0])..","..tostring(sirenData[1][1])..","..tostring(sirenData[1][2])..", X,Y,Z: "..tostring(sirenData[1][3])..","..tostring(sirenData[1][4])..","..tostring(sirenData[1][5])..", minAlpha: "..tostring(sirenData[1][6])..".",player) end addEventHandler("onVehicleExit",root,function(player,seat) if(player)and(seat==0)then removeVehicleSirens(source) unbindKey(player,"g","up",getSiren) end end)
Requirements
This template will be deleted.
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