GetVehicleName: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
__NOTOC__ | __NOTOC__ | ||
This | This function returns a string containing the name of the vehicle | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string getVehicleName ( vehicle ) | string getVehicleName ( vehicle theVehicle ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''theVehicle:''' The vehicle you want to get the name of. | ||
===Returns=== | ===Returns=== | ||
Returns ' | Returns a string containing the requested vehicle's name, or false if the client passed to the function is invalid. | ||
==Example== | ==Example== | ||
This example does... | This example does... | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | -- add the event to the event handler | ||
addEventHandler ( "onPlayerEnterVehicle", root, "onPlayerEnterVehicle" ) | |||
-- | function onPlayerEnterVehicle ( vehicle, seat, jacked ) --when someone enters a vehicle | ||
if vehicle == 519 or 577 then --if the vehicle is one of these two planes | |||
vehiclename = getVehicleName ( vehicle ) -- define the vehicle name | |||
outputChatBox ( "Someone stole the "..vehiclename.."!" ) -- announce that someone stole the plane | |||
end | |||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Vehicle_functions}} |
Revision as of 01:51, 30 July 2006
This function returns a string containing the name of the vehicle
Syntax
string getVehicleName ( vehicle theVehicle )
Required Arguments
- theVehicle: The vehicle you want to get the name of.
Returns
Returns a string containing the requested vehicle's name, or false if the client passed to the function is invalid.
Example
This example does...
-- add the event to the event handler addEventHandler ( "onPlayerEnterVehicle", root, "onPlayerEnterVehicle" ) function onPlayerEnterVehicle ( vehicle, seat, jacked ) --when someone enters a vehicle if vehicle == 519 or 577 then --if the vehicle is one of these two planes vehiclename = getVehicleName ( vehicle ) -- define the vehicle name outputChatBox ( "Someone stole the "..vehiclename.."!" ) -- announce that someone stole the plane 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