GetVehicleSirens: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 28: | Line 28: | ||
==Example== | ==Example== | ||
<section name="Server" class="server" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
addEventHandler("onVehicleEnter",root,function(player,seat) | |||
if(player)and(seat==0)then | |||
vehicle = getPedOccupiedVehicle(player) | |||
addVehicleSirens(vehicle,1,1) | |||
setVehicleSirens(vehicle,1,0,0,0,100,0,100,255,122) | |||
bindKey(player,"g","up",getSiren,vehicle) | |||
end | |||
end) | |||
function getSiren(player,button,state,vehicle) | |||
local sirenData = getVehicleSiren(vehicle) | |||
outputChatBox("Here's the properties of your vehicle sirens: Red,Green,Blue: "..sirenData[1][0]..","..sirenData[1][1]..","..sirenData[1][2]..", X,Y,Z: "..sirenData[1][3]..","..sirenData[1][4]..","..sirenData[1][5]..", minAlpha: "..sirenData[1][6]..".",player) | |||
end | |||
addEventHandler("onVehicleExit",root,function(player,seat) | |||
if(player)and(seat==0)then | |||
vehicle = getPedOccupiedVehicle(player) | |||
removeVehicleSirens(vehicle) | |||
unbindKey(player,"g","up",getSiren) | |||
end | |||
end) | |||
</syntaxhighlight> | |||
</section> | |||
==Requirements== | ==Requirements== |
Revision as of 16:31, 20 April 2012
Syntax
table getVehicleSirens ( vehicle theVehicle )
Required Arguments
- theVehicle: The vehicle to get siren information on
Returns
Returns a table with sub tables containing the properties of the siren point in the following order:
Red, Green, Blue, Alpha, x, y, z, minAlpha or returns false on failure. Example:
sirenData = { [1] = { Red, Green, Blue, Alpha, x, y, z, minAlpha }, [2] = { Red, Green, Blue, Alpha, x, y, z, minAlpha }, [3] = { Red, Green, Blue, Alpha, x, y, z, minAlpha }, [4] = { Red, Green, Blue, Alpha, x, y, z, minAlpha }, }
Example
Click to collapse [-]
ServeraddEventHandler("onVehicleEnter",root,function(player,seat) if(player)and(seat==0)then vehicle = getPedOccupiedVehicle(player) addVehicleSirens(vehicle,1,1) setVehicleSirens(vehicle,1,0,0,0,100,0,100,255,122) bindKey(player,"g","up",getSiren,vehicle) end end) function getSiren(player,button,state,vehicle) local sirenData = getVehicleSiren(vehicle) outputChatBox("Here's the properties of your vehicle sirens: Red,Green,Blue: "..sirenData[1][0]..","..sirenData[1][1]..","..sirenData[1][2]..", X,Y,Z: "..sirenData[1][3]..","..sirenData[1][4]..","..sirenData[1][5]..", minAlpha: "..sirenData[1][6]..".",player) end addEventHandler("onVehicleExit",root,function(player,seat) if(player)and(seat==0)then vehicle = getPedOccupiedVehicle(player) removeVehicleSirens(vehicle) 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