GetVehicleNameFromID: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 10: Line 10:


===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''id:''' This is a vehicle id. See [[vehicle]] to see what values will return names (true).
 
===Optional Arguments===
{{OptionalArg}}
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


===Returns===
===Returns===
Returns ''true'' if blah, ''false'' otherwise.
Returns ''true'' if vehicle exists, ''false'' otherwise.


==Example==  
==Example==  
This example does...
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">
--This line does...
addEventHandler ( "onConsole", root, "onConsole" )
blabhalbalhb --abababa
function onConsole ( message )
--This line does this...
local command = gettok(message, 1, 32) --A varible called command stores a message typed in the chatbox by a player
mooo
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==
{{FunctionArea_Functions}}
{{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