---
title: "NPC_PausePlayingNode | open.mp"
description: "暂停 NPC 的节点导航。"
canonical: https://omp.itsneufox.com/zh-CN/docs/scripting/functions/NPC_PausePlayingNode
language: zh-CN
---

# NPC\_PausePlayingNode

注意

这个函数是在omp v1.5.8.3079中添加的，在以前的版本中不起作用！

## 描述

暂停 NPC 的节点导航，暂时停止其在节点中的移动。

| 参数 | 说明 |
| --- | --- |
| npcid | NPC 的 ID |

## 返回值

如果操作成功则返回`true`，否则返回`false`。

## 示例

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/npcpausenode", true))
    {
        new npcid = PlayerNPC[playerid];
        if (npcid == INVALID_NPC_ID)
            return SendClientMessage(playerid, 0xFF0000FF, "你没有在调试NPC。");

        if (!NPC_IsValid(npcid))
            return SendClientMessage(playerid, 0xFF0000FF, "无效的NPC。");

        new bool:success = NPC_PausePlayingNode(npcid);

        SendClientMessage(playerid, 0x00FF00FF, "NPC %d 暂停节点: %s", npcid, success ? "成功" : "失败");
        return 1;
    }
    return 0;
}
```

## 注意事项

-   仅在 NPC 正在播放节点时有效
-   暂停的节点导航可以通过 NPC\_ResumePlayingNode 恢复
-   使用 NPC\_IsPlayingNodePaused 检查暂停状态

## 相关函数

-   [NPC\_ResumePlayingNode](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/NPC_ResumePlayingNode): 恢复节点播放
-   [NPC\_IsPlayingNodePaused](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/NPC_IsPlayingNodePaused): 检查是否暂停
-   [NPC\_PlayNode](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/NPC_PlayNode): 开始播放节点
-   [NPC\_StopPlayingNode](https://omp.itsneufox.com/zh-CN/docs/scripting/functions/NPC_StopPlayingNode): 停止播放节点

## 相关回调

_此函数不会触发任何特定的回调。_
