GetVehicleNameFromID: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''id:''' This is a vehicle id. See [[vehicle]] to see what values will return names (true). | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if | Returns ''true'' if vehicle exists, ''false'' otherwise. | ||
==Example== | ==Example== | ||
This example | This example allows you to use the chatbot to type a command. The command is used to check the vehiclename of the vehicleid the user entered. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler ( "onConsole", root, "onConsole" ) | |||
function onConsole ( message ) | |||
-- | local command = gettok(message, 1, 32) --A varible called command stores a message typed in the chatbox by a player | ||
if (command == "!namevehicle #") then --If the typed chat is equal to this, the code commences | |||
outputChatBox ( "The name of # is".. vehiclename, source ) --the chatbox outputs the vehiclename of the vehicleid the player entered | |||
end | |||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Vehicle functions}} |
Revision as of 03:19, 9 September 2006
This fake function is for use with blah & blah and does blahblahblabhalbhl
Syntax
string getVehicleNameFromID ( int id )
Required Arguments
- id: This is a vehicle id. See vehicle to see what values will return names (true).
Returns
Returns true if vehicle exists, false otherwise.
Example
This example allows you to use the chatbot to type a command. The command is used to check the vehiclename of the vehicleid the user entered.
addEventHandler ( "onConsole", root, "onConsole" ) function onConsole ( message ) local command = gettok(message, 1, 32) --A varible called command stores a message typed in the chatbox by a player if (command == "!namevehicle #") then --If the typed chat is equal to this, the code commences outputChatBox ( "The name of # is".. vehiclename, source ) --the chatbox outputs the vehiclename of the vehicleid the player entered 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