Files
2025-03-18 14:46:12 +08:00

66 lines
1.2 KiB
Markdown

---
sidebarDepth: 1
---
# 魔法指令
## Disable
<span style="display:inline;color:#ff5555">服务端</span>
method in mod.server.component.aiCommandCompServer.AiCommandComponentServer
- 描述
关闭官方魔法指令功能。需要在ClientLoadAddonsFinishServerEvent事件中调用。仅在联机大厅中生效。
- 参数
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 关闭结果 |
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateAiCommand(playerId)
comp.Disable()
```
## Enable
<span style="display:inline;color:#ff5555">服务端</span>
method in mod.server.component.aiCommandCompServer.AiCommandComponentServer
- 描述
启用官方魔法指令功能。需要在ClientLoadAddonsFinishServerEvent事件中调用。仅在联机大厅中生效。
- 参数
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | 启用结果 |
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateAiCommand(playerId)
comp.Enable()
```