WoW API: UnitInVehicle

WoW API < UnitInVehicle

Checks whether a specified unit is within an vehicle.

ArgumentsEdit

unit
the Unit to check

ReturnsEdit

isTrue isTrue - returns 1 if the specified unit is in a vehicle, nil otherwise.

ExampleEdit

 if UnitInVehicle("target") then
   SendChatMessage("My Target is in a vehicle.", "SAY");
 else
   SendChatMessage("My Target is not in a vehicle.", "SAY");
 end

ResultEdit

Says "My Target is in a vehicle." if the target is in a vehicle, "My Target is not in a vehicle." otherwise.