GetVehicleHeadLightColor: Difference between revisions
Jump to navigation
Jump to search
Cazomino05 (talk | contribs) (New page: __NOTOC__ {{Server client function}} This function will get the headlight color of a vehicle. ==Syntax== <section name="Server and Client" class="both" show="true"> <syntaxhighlight lang="lua"> int, in...) |
Dmitry7zip (talk | contribs) mNo edit summary |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
int, int, int getVehicleHeadLightColor ( vehicle theVehicle ) | int, int, int getVehicleHeadLightColor ( vehicle theVehicle ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[vehicle]]:getHeadLightColor||setVehicleHeadLightColor}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theVehicle:''' The [[vehicle]] that you wish to set the headlight color of. | *'''theVehicle:''' The [[vehicle]] that you wish to set the headlight color of. | ||
Line 14: | Line 13: | ||
===Returns=== | ===Returns=== | ||
Returns three ''integers'' for the red, green and blue of the headlight color for the specified vehicle, ''false'' if an invalid vehicle was specified. | Returns three ''integers'' for the red, green and blue of the headlight color for the specified vehicle, ''false'' if an invalid vehicle was specified. | ||
==Example== | ==Example== | ||
<section name=" | This example outputs the player vehicle head lights color. | ||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
function getHeadLightsColor() | |||
local vehicle = getPedOccupiedVehicle(localPlayer) -- We get the player vehicle.. | |||
if (vehicle) then -- We check if he's on a vehicle... | |||
local r, g, b = getVehicleHeadLightColor(vehicle) -- We get the vehicle head lights color.. | |||
outputChatBox("Your vehicle lights color are: ".. r ..", ".. g ..", ".. b) -- We output them to the chatbox. | |||
end | |||
end | |||
addCommandHandler("lightscolor",getHeadLightsColor) -- Add the command handler attached to the function "getHeadLightsColor". | |||
</syntaxhighlight> | |||
</section> | |||
<section name="Server" class="server" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | function getHeadLightsColor(thePlayer) | ||
local vehicle = getPedOccupiedVehicle(thePlayer) -- We get the player vehicle.. | |||
if (vehicle) then -- We check if he's on a vehicle... | |||
local r, g, b = getVehicleHeadLightColor(vehicle) -- We get the vehicle head lights color.. | |||
outputChatBox("Your vehicle lights color are: ".. r ..", ".. g ..", ".. b, thePlayer) -- We output them to the chatbox. | |||
end | |||
end | |||
addCommandHandler("lightscolor",getHeadLightsColor) -- Add the command handler attached to the function "getHeadLightsColor". | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Latest revision as of 14:21, 7 June 2015
This function will get the headlight color of a vehicle.
Syntax
int, int, int getVehicleHeadLightColor ( vehicle theVehicle )
OOP Syntax Help! I don't understand this!
- Method: vehicle:getHeadLightColor(...)
- Counterpart: setVehicleHeadLightColor
Required Arguments
- theVehicle: The vehicle that you wish to set the headlight color of.
Returns
Returns three integers for the red, green and blue of the headlight color for the specified vehicle, false if an invalid vehicle was specified.
Example
This example outputs the player vehicle head lights color.
Click to collapse [-]
Clientfunction getHeadLightsColor() local vehicle = getPedOccupiedVehicle(localPlayer) -- We get the player vehicle.. if (vehicle) then -- We check if he's on a vehicle... local r, g, b = getVehicleHeadLightColor(vehicle) -- We get the vehicle head lights color.. outputChatBox("Your vehicle lights color are: ".. r ..", ".. g ..", ".. b) -- We output them to the chatbox. end end addCommandHandler("lightscolor",getHeadLightsColor) -- Add the command handler attached to the function "getHeadLightsColor".
Click to collapse [-]
Serverfunction getHeadLightsColor(thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) -- We get the player vehicle.. if (vehicle) then -- We check if he's on a vehicle... local r, g, b = getVehicleHeadLightColor(vehicle) -- We get the vehicle head lights color.. outputChatBox("Your vehicle lights color are: ".. r ..", ".. g ..", ".. b, thePlayer) -- We output them to the chatbox. end end addCommandHandler("lightscolor",getHeadLightsColor) -- Add the command handler attached to the function "getHeadLightsColor".
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