WoW:API UnitInVehicle: Difference between revisions

m
(New page: {{wowapi}} Checks whether a specified unit is within an vehicle. == Arguments == ("unit") '''unit''' - the Unit to check == Returns == isTrue '''isTrue''' - return...)
 
Line 12: Line 12:


== Example ==
== Example ==
<code>if UnitInVehicle("target") then SendChatMessage("My Target is in a vehicle.", "SAY"); else SendChatMessage("My Target is not in a vehicle.", "SAY"); end</code>
  if UnitInVehicle("target") then
    SendChatMessage("My Target is in a vehicle.", "SAY");
  else
    SendChatMessage("My Target is not in a vehicle.", "SAY");
  end


<big>Result</big>
== Result ==
 
Says "My Target is in a vehicle" if the target is in a vehicle, "My Target is not in a vehicle" otherwise.


Says "My Target is in a vehicle." if the target is in a vehicle, "My Target is not in a vehicle." otherwise.
[[Category:World of Warcraft API]]
[[Category:World of Warcraft API]]
Anonymous user