🧰 UDK.Player
This content is not available in your language yet.
UniX-SDK.Player
Section titled “UniX-SDK.Player”UDK.Player.GetAllPlayer
Section titled “UDK.Player.GetAllPlayer”| 传参/返回值 | 类型 | 说明 |
|---|---|---|
| @return table | playerIDs | 当前游戏所有玩家ID |
-- 示例代码local playerIDs = UDK.Player.GetAllPlayer()UDK.Player.GetHomeowner
Section titled “UDK.Player.GetHomeowner”| 传参/返回值 | 类型 | 说明 |
|---|---|---|
| @return number | playerID | 房主玩家ID |
-- 示例代码local homeOwnerID = UDK.Player.GetHomeowner()print("Homeowner: " .. homeOwnerID)UDK.Player.GetTotalPlayerCount
Section titled “UDK.Player.GetTotalPlayerCount”| 传参/返回值 | 类型 | 说明 |
|---|---|---|
| @return number | playerCount | 当前游戏玩家人数 |
-- 示例代码local totalPlayerCount = UDK.Player.GetTotalPlayerCount()print("Total Player Count: " .. totalPlayerCount)UDK.Player.GetLocalPlayerID
Section titled “UDK.Player.GetLocalPlayerID”| 传参/返回值 | 类型 | 说明 |
|---|---|---|
| @return number | playerID | 本地玩家ID |
-- 示例代码local localPlayerID = UDK.Player.GetLocalPlayerID()print("Local Player ID: " .. localPlayerID)UDK.Player.GetPlayerNickName
Section titled “UDK.Player.GetPlayerNickName”| 传参/返回值 | 类型 | 说明 |
|---|---|---|
| @param playerID | number | 玩家ID |
| @return string | nickName | 玩家昵称 |
-- 示例代码local playerID = UDK.Player.GetLocalPlayerID()local nickName = UDK.Player.GetPlayerNickName(playerID)print("Player NickName: " .. nickName)UDK.Player.GetPlayerHeadIcon
Section titled “UDK.Player.GetPlayerHeadIcon”| 传参/返回值 | 类型 | 说明 |
|---|---|---|
| @param playerID | number | 玩家ID |
| @return string | headIcon | 玩家头像 |
-- 示例代码local playerID = UDK.Player.GetLocalPlayerID()local headIcon = UDK.Player.GetPlayerHeadIcon(playerID)print("Player HeadIcon: " .. headIcon)UDK.Player.GetTeamPlayers
Section titled “UDK.Player.GetTeamPlayers”| 传参/返回值 | 类型 | 说明 |
|---|---|---|
| @param teamID | number | 阵营ID |
| @return table | playerIDs | 阵营内所有玩家ID |
-- 示例代码local teamID = 1local playerIDs = UDK.Player.GetTeamPlayers(teamID)print("Team Players: " .. table.concat(playerIDs, ", "))