GetVehicleSirenParams: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) |
||
(11 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
{{New feature/item|3.0130|1.3.0|3968| | |||
This function get the parameters of a vehicles siren. | This function get the parameters of a vehicles siren. | ||
}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
getVehicleSirenParams ( vehicle theVehicle ) | table getVehicleSirenParams ( vehicle theVehicle ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:getSirenParams|sirenParams}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' The vehicle to get the siren parameters of | *'''theVehicle:''' The vehicle to get the siren parameters of | ||
Line 16: | Line 17: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
[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 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==Example== | ==Example== | ||
<section name="Server" class="server" show="true"> | |||
This example returns the vehicle parameters when the players presses g. | |||
<syntaxhighlight lang="lua">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) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{Vehicle_functions}} | {{Vehicle_functions}} | ||
Latest revision as of 17:03, 7 November 2024
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)
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