GetVehicleNameFromID: Difference between revisions

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


__NOTOC__  
__NOTOC__  
This fake function is for use with blah & blah and does blahblahblabhalbhl
Allows you to input a vehicleID and return a vehicle name from that ID


==Syntax==  
==Syntax==  

Revision as of 03:31, 9 September 2006


Allows you to input a vehicleID and return a vehicle name from that ID

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