Player

Handle Wrappers View source
Player

Source on GitHub

Extension Functions

player.setGold

public function player.setGold(int val)

player.addGold

public function player.addGold(int val)

player.setLumber

public function player.setLumber(int val)

player.addLumber

public function player.addLumber(int val)

player.addState

public function player.addState(playerstate state, int val)

player.clearSelection

public function player.clearSelection()

Clears the selection for the player, deselecting all widgets.

player.isSelectionEnabled

public function player.isSelectionEnabled() returns bool

Get if Selection is enabled for local player. Returns always false for non-local player.

player.isSelectionCircleEnabled

public function player.isSelectionCircleEnabled() returns bool

Get if Selection Circle is enabled for local player. Returns always false for non-local player.

player.setSelectionsEnabled

public function player.setSelectionsEnabled(bool enableSelection, bool enableSelectionCircle)

Enable or disable player selections.

player.disableUserControl

public function player.disableUserControl()

Disable UI control for the player

player.enableUserControl

public function player.enableUserControl()

Enable UI control for the player

player.getController

public function player.getController() returns mapcontrol

player.getCurrentSupply

public function player.getCurrentSupply() returns int

player.getGold

public function player.getGold() returns int

player.getId

public function player.getId() returns int

player.getLumber

public function player.getLumber() returns int

player.getMaxSupply

public function player.getMaxSupply() returns int

player.getName

public function player.getName() returns string

player.getName

public function player.getName(boolean removeHash) returns string

Reforged names have a number attached after a hash tag, like Bob#1234

player.getSlotState

public function player.getSlotState() returns playerslotstate

player.getStartLocation

public function player.getStartLocation() returns vec2

player.getState

public function player.getState(playerstate state) returns int

player.isAllyOf

public function player.isAllyOf(player p) returns boolean

player.isEnemyOf

public function player.isEnemyOf(player p) returns boolean

player.panCamToTimed

public function player.panCamToTimed(unit u, real time)

player.select

public function player.select(unit u)

player.selectSingle

public function player.selectSingle(unit u)

player.setAbilityAvailable

public function player.setAbilityAvailable(int abilityId, boolean avail)

player.setName

public function player.setName(string name)

player.setState

public function player.setState(playerstate state, int val)

player.subGold

public function player.subGold(int val)

player.subState

public function player.subState(playerstate state, int val)

player.setUserControl

public function player.setUserControl(boolean enable)

Enables / disables user UI control for the player

player.unselect

public function player.unselect(unit u)

player.isIngame

public function player.isIngame() returns boolean

player.decTechResearched

public function player.decTechResearched(int techId, int levels)

player.forceStartLocation

public function player.forceStartLocation(int index)

player.getPlayerAlliance

public function player.getPlayerAlliance(player otherPlayer, alliancetype whichAllianceSetting) returns boolean

player.setPlayerAlliance

public function player.setPlayerAlliance(player otherPlayer, alliancetype whichAllianceSetting, boolean value)

player.setTaxRate

public function player.setTaxRate(player otherPlayer, playerstate whichResource, integer rate)

player.setRacePreference

public function player.setRacePreference(racepreference whichRacePreference)

player.setRaceSelectable

public function player.setRaceSelectable(boolean value)

player.getTeam

public function player.getTeam() returns int

player.isSelectable

public function player.isSelectable() returns bool

player.getTaxRate

public function player.getTaxRate(player otherPlayer, playerstate whichResource) returns int

player.isRacePrefSet

public function player.isRacePrefSet(racepreference preference) returns bool

player.getScreenSize

public function player.getScreenSize() returns vec2

Get width and height of current Warcraft 3 client window. Returns vec2(0,0) for non-local player.

player.isScreenActive

public function player.isScreenActive() returns bool

Check if client window is active. Will return false always for non-local player.

player.getLocale

public function player.getLocale() returns string

Return language locale for local player. Returns null for non-local player.

player.isTargetIndicatorEnabled

public function player.isTargetIndicatorEnabled() returns bool

Return if Target Indicator is enabled for local player. Returns false for non-local player.

player.setTargetIndicator

public function player.setTargetIndicator(bool enableTargetIndicator)

Set if Target Indicator is enabled for local player.

player.setCursorEnabled

public function player.setCursorEnabled(bool enableCursor)

Enable or disable mouse cursor..

player.setPosCursor

public function player.setPosCursor(vec2 pos)

Set cursor position on screen. Uses int values internally.

player.getCursorFocus

public function player.getCursorFocus() returns unit

Get unit focused by mouse cursor.

player.setMinimapTerrainTex

public function player.setMinimapTerrainTex(string texFile) returns bool

player.sendSyncData

public function player.sendSyncData(string prefix, string data) returns bool

player.showChatMessage

public function player.showChatMessage(int recipient, string message)

player.setHeroMaxAllowed

public function player.setHeroMaxAllowed(int amount)

Sets the maximum allowed hero amount for a player

player.hasVisibility

public function player.hasVisibility(unit target) returns bool

player.hasVisibility

public function player.hasVisibility(vec2 pos) returns bool

Constants

localPlayer

public constant localPlayer = GetLocalPlayer()