GetVehicleName

From Multi Theft Auto: Wiki
Revision as of 01:52, 30 July 2006 by Talidan (talk | contribs)
Jump to navigation Jump to search

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