记分板
GetAllPlayerScoreboardObjects
服务端开发补充
读取所绑定玩家的记分项及分数;与全部目标定义的枚举区分。创建目标、设置分数和显示侧边栏走原生 scoreboard 命令。
关联接口:SetCommand (server)
客户端开发补充
读取所绑定玩家的记分项及分数;与全部目标定义的枚举区分。创建目标、设置分数和显示侧边栏走原生 scoreboard 命令。
关联接口:SetCommand (server)
服务端客户端
服务端接口
method in mod.server.component.gameCompServer.GameComponentServer
- 描述
获取玩家记分项
- 参数
无
- 返回值
| 数据类型 | 说明 |
|---|---|
| list(dict) | 玩家记分项信息字典列表 |
- 示例
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateGame(levelId)
print(comp.GetAllPlayerScoreboardObjects())客户端接口
method in mod.client.component.gameCompClient.GameComponentClient
- 描述
获取玩家记分项
- 参数
无
- 返回值
| 数据类型 | 说明 |
|---|---|
| list(dict) | 玩家记分项信息字典列表 |
备注
注意,只有使用命令 /scoreboard objectives setdisplay sidebar xxx 设置显示后的记分项才能在客户端侧获取到
示例
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
print(comp.GetAllPlayerScoreboardObjects())GetAllScoreboardObjects
服务端开发补充
枚举记分板目标定义;读取某个玩家的分数使用 GetAllPlayerScoreboardObjects,修改目标或显示方式使用 scoreboard 命令。
关联接口:SetCommand (server) · GetAllPlayerScoreboardObjects (server)
客户端开发补充
枚举记分板目标定义;读取某个玩家的分数使用 GetAllPlayerScoreboardObjects,修改目标或显示方式使用 scoreboard 命令。
关联接口:SetCommand (server) · GetAllPlayerScoreboardObjects (client)
服务端客户端
服务端接口
method in mod.server.component.gameCompServer.GameComponentServer
- 描述
获取所有记分板项
- 参数
无
- 返回值
| 数据类型 | 说明 |
|---|---|
| list(dict) | 记分准则信息字典列表 |
- 示例
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateGame(levelId)
print(comp.GetAllScoreboardObjects())客户端接口
method in mod.client.component.gameCompClient.GameComponentClient
- 描述
获取所有记分板项
- 参数
无
- 返回值
| 数据类型 | 说明 |
|---|---|
| list(dict) | 记分准则信息字典列表 |
备注
注意,只有使用命令 /scoreboard objectives setdisplay sidebar xxx 设置显示后的记分项才能在客户端侧获取到
示例
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreateGame(levelId)
print(comp.GetAllScoreboardObjects())