👤Player

Table to work with CPlayer. CPlayer extends <mark

style="color:purple">CEntity

PrepareUnitOrders(player: CPlayer, type: Enum.UnitOrder, target: CEntity|nil, pos: Vector, ability: CAbility|nil, issuer: Enum.PlayerOrderIssuer, issuer_npc: CNPC|CNPC[], queue [?]: boolean, show_effects [?]: boolean, callback [?]: boolean, execute_fast [?]: boolean, identifier [?]: string): nil

Name
Type
Description

player

The player issuing the order.

type

The type of order to be issued.

target

The target entity, if applicable.

pos

The positional coordinates for the order.

ability

The ability for order.

issuer

The issuer capture mode.

issuer_npc

The specific NPC or group of NPC that will issue the order.

queue [?]

boolean

If true, the order will be added to the Dota cast queue. (default: false)

show_effects [?]

boolean

If true, visual effects will indicate the position of the order. (default: false)

callback [?]

boolean

If true, the order will be pushed to the OnPrepareUnitOrders callback. (default: false)

execute_fast [?]

boolean

If true, the order will bypass internal safety delays for immediate execution. (default: false)

identifier [?]

string

The identifier which will be passed to OnPrepareUnitOrders callback. (default: nil)

Provides ability to execute such game actions as moving, attacking, or casting spells etc.


HoldPosition(player: CPlayer, issuer_npc: CNPC, queue [?]: boolean, push [?]: boolean, execute_fast [?]: boolean, identifier [?]: string): nil

Name
Type
Description

player

The player issuing the order.

issuer_npc

The specific NPC that will issue the order.

queue [?]

boolean

If true, the order will be added to the Dota cast queue. (default: false)

push [?]

boolean

If true, the order will be pushed to the OnPrepareUnitOrders callback. (default: false)

execute_fast [?]

boolean

If true, the order will bypass internal safety delays for immediate execution. (default: false)

identifier [?]

string

The identifier which will be passed to OnPrepareUnitOrders callback. (default: nil)

Sends the hold position action.


AttackTarget(player: CPlayer, issuer_npc: CNPC, target: CNPC, queue [?]: boolean, push [?]: boolean, execute_fast [?]: boolean, identifier [?]: string): nil

Name
Type
Description

player

The player issuing the order.

issuer_npc

The specific NPC that will issue the order.

target

The target NPC.

queue [?]

boolean

If true, the order will be added to the Dota cast queue. (default: false)

push [?]

boolean

If true, the order will be pushed to the OnPrepareUnitOrders callback. (default: false)

execute_fast [?]

boolean

If true, the order will bypass internal safety delays for immediate execution. (default: false)

identifier [?]

string

The identifier which will be passed to OnPrepareUnitOrders callback. (default: nil)

Sends the attack target position.


GetPlayerID(player: CPlayer): integer

Name
Type
Description

player

The target player.

Returns the player ID within the current game session. If the player ID is not valid, it will return -1.


GetPlayerSlot(player: CPlayer): integer

Name
Type
Description

player

The target player.

Returns the player slot number within the current game session.


GetPlayerTeamSlot(player: CPlayer): integer

Name
Type
Description

player

The target player.

Returns the team slot number assigned to the player within their respective team.


GetName(player: CPlayer): string

Name
Type
Description

player

The target player.

Returns the player nickname.


GetPlayerData(player: CPlayer): ``

Name
Type
Description

player

The target player.

Returns the player data table.


GetTeamData(player: CPlayer): ``

Name
Type
Description

player

The target player.

Returns the player team data table. Team data is only available for players on the local team.


GetNeutralStashItems(player: CPlayer): {item: CItem }[]

Name
Type
Description

player

The target player.

Returns table with CItems available in the neutral stash.


GetTeamPlayer(player: CPlayer): ``

Name
Type
Description

player

The target player.

Returns Team Player Data table


IsMuted(player: CPlayer): boolean

Name
Type
Description

player

The target player.

Returns the player mute status.


GetSelectedUnits(player: CPlayer): CNPC[]

Name
Type
Description

player

The target player.

Returns table of selected units by player.


AddSelectedUnit(player: CPlayer, NPC: CNPC): nil

Name
Type
Description

player

The target player.

NPC

To select.

Adds unit to player selection.


ClearSelectedUnits(player: CPlayer): nil

Name
Type
Description

player

The target player.

Clears player selection.


GetQuickBuyInfo(player: CPlayer): {m_quickBuyItems:integer[], m_quickBuyIsPurchasable:boolean[]}

Name
Type
Description

player

The target player.

Returns table with m_quickBuyItems(item ids) and m_quickBuyIsPurchasable(table of booleans).


GetTotalGold(player: CPlayer): integer

Name
Type
Description

player

The target player.

Returns total gold of player.


GetAssignedHero(player: CPlayer): CHero|nil

Name
Type
Description

player

The target player.

Returns player's assigned hero.


GetActiveAbility(player: CPlayer): CAbility|nil

Name
Type
Description

player

The target player.

Returns player's active ability.

Last updated