12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 27 ■ API <strong>Reference</strong> 599CanSignPetitionReturns whether the player can sign the currently <strong>of</strong>fered petition.canSign = CanSignPetition()Petitions can only be signed once per account, rather than once per character.Returns:canSign—1 if the player can sign the <strong>of</strong>fered petition; otherwise nil (1nil)CanSummonFriendReturns whether a unit can be summoned via Recruit-a-Friend.canSummon = CanSummonFriend(“name“) or CanSummonFriend(“unit“)Indicates whether the target unit is currently summonable, not just whetherthat unit’s account is linked to the player’s via the Recruit-A-Friend program.Arguments:name—Exact name <strong>of</strong> a player to summon (string)unit—A unit to summon (string, unitID)Returns:canSummon—1 if the unit can be summoned, otherwise nil (1nil)CanSwitchVehicleSeatReturns whether the player can change vehicle seats.canSwitch = CanSwitchVehicleSeat()Tells you if the player can switch seats in general, whereasUnitVehicleSeatInfo() tells you if the player can switch into a specific seat.Returns:canSwitch—Can the player change vehicle seats (boolean)Example:local controlType, occupantName, occupantRealm, canEject, icanSwitchSeats = UnitVehicleSeatInfo(“player“, 1)if( CanSwitchVehicleSeat() <strong>and</strong> canSwitchSeats ) thenprint(“You can switch to seat #1!“)endCanSwitchVehicleSeatsReturns whether the player is in a vehicle with multiple seats.canSwitch = CanSwitchVehicleSeats()Returns:canSwitch—1 if the player can switch seats; otherwise nil (1nil)CanUseEquipmentSetsReturns whether the player has enabled the equipment manager.enabled = CanUseEquipmentSets()Despite the name, this returns true when the player has enabled the use <strong>of</strong> theequipment manager through the interface or CVars.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!