Skip to content

Commit 664651a

Browse files
committed
update zh-Hans docs
1 parent 47dc08a commit 664651a

File tree

6 files changed

+261
-72
lines changed

6 files changed

+261
-72
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: NPC_GetCustomSkin
3+
sidebar_label: NPC_GetCustomSkin
4+
description: 获取NPC的自定义皮肤ID。
5+
tags: ["npc", "皮肤", "模型"]
6+
---
7+
8+
<VersionWarn version='omp v1.1.0.changemelater' />
9+
10+
## 描述
11+
12+
获取 NPC 的自定义皮肤 ID。
13+
14+
| 名称 | 描述 |
15+
| ----- | ----------- |
16+
| npcid | NPC 的 ID。 |
17+
18+
## 返回值
19+
20+
返回该 NPC 的自定义皮肤 ID。如果该 NPC 没有自定义皮肤或无效,则返回-1。
21+
22+
## 示例
23+
24+
```c
25+
public OnPlayerCommandText(playerid, cmdtext[])
26+
{
27+
if (!strcmp(cmdtext, "/checkcustomskin", true))
28+
{
29+
new npcid = PlayerNPC[playerid];
30+
if (npcid == INVALID_NPC_ID)
31+
return SendClientMessage(playerid, 0xFF0000FF, "你没有在调试NPC。");
32+
33+
if (!NPC_IsValid(npcid))
34+
return SendClientMessage(playerid, 0xFF0000FF, "无效的NPC。");
35+
36+
new customskinid = NPC_GetCustomSkin(npcid);
37+
38+
if (customskinid == -1)
39+
{
40+
SendClientMessage(playerid, 0xFF0000FF, "NPC %d 未设置自定义皮肤", npcid);
41+
}
42+
else
43+
{
44+
SendClientMessage(playerid, 0x00FF00FF, "NPC %d 的自定义皮肤ID: %d", npcid, customskinid);
45+
}
46+
return 1;
47+
}
48+
return 0;
49+
}
50+
```
51+
52+
## 说明
53+
54+
:::warning
55+
56+
- 如果 NPC 未设置自定义皮肤或 NPC 无效,则返回-1。
57+
- 自定义皮肤与常规皮肤不同,通常指的是添加到游戏中的自定义模型。
58+
- 使用 [NPC_GetSkin](NPC_GetSkin) 来获取常规的皮肤/模型 ID。
59+
60+
:::
61+
62+
## 相关函数
63+
64+
- [NPC_SetSkin](NPC_SetSkin): 设置 NPC 的皮肤/模型。
65+
- [NPC_GetSkin](NPC_GetSkin): 获取 NPC 当前的皮肤/模型 ID。
66+
- [NPC_IsValid](NPC_IsValid): 检查 NPC 是否有效。
67+
68+
## 相关回调
69+
70+
- [OnNPCSpawn](../callbacks/OnNPCSpawn): 当 NPC 生成时调用。
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: NPC_GetPosMovingTo
3+
sidebar_label: NPC_GetPosMovingTo
4+
description: 获取NPC当前正在移动前往的目标位置。
5+
tags: ["npc", "位置", "移动"]
6+
---
7+
8+
<VersionWarn version='omp v1.1.0.changemelater' />
9+
10+
## 描述
11+
12+
获取 NPC 当前正在移动前往的目标位置。
13+
14+
| 名称 | 描述 |
15+
| -------- | --------------------------------------------- |
16+
| npcid | NPC 的 ID。 |
17+
| &Float:x | 用于存储目标位置 X 坐标的变量,通过引用传递。 |
18+
| &Float:y | 用于存储目标位置 Y 坐标的变量,通过引用传递。 |
19+
| &Float:z | 用于存储目标位置 Z 坐标的变量,通过引用传递。 |
20+
21+
## 返回值
22+
23+
成功时返回 `true`,失败时返回 `false`
24+
25+
## 示例
26+
27+
```c
28+
public OnPlayerCommandText(playerid, cmdtext[])
29+
{
30+
if (!strcmp(cmdtext, "/checkposmovingto", true))
31+
{
32+
new npcid = PlayerNPC[playerid];
33+
if (npcid == INVALID_NPC_ID)
34+
return SendClientMessage(playerid, 0xFF0000FF, "你没有在调试NPC。");
35+
36+
if (!NPC_IsValid(npcid))
37+
return SendClientMessage(playerid, 0xFF0000FF, "无效的NPC。");
38+
39+
if (!NPC_IsMoving(npcid))
40+
return SendClientMessage(playerid, 0xFF0000FF, "NPC %d 当前没有移动。", npcid);
41+
42+
new Float:x, Float:y, Float:z;
43+
NPC_GetPosMovingTo(npcid, x, y, z);
44+
45+
SendClientMessage(playerid, 0x00FF00FF, "NPC %d 的目标位置:%.2f, %.2f, %.2f", npcid, x, y, z);
46+
return 1;
47+
}
48+
return 0;
49+
}
50+
```
51+
52+
## 说明
53+
54+
:::warning
55+
56+
- 所有坐标参数均通过引用传递,其值将被修改。
57+
- 此函数返回的是 NPC 正在移动前往的目标位置,而非当前位置。
58+
- 在调用此函数前,建议使用 [NPC_IsMoving](NPC_IsMoving) 来检查 NPC 当前是否正在移动。
59+
60+
:::
61+
62+
## 相关函数
63+
64+
- [NPC_Move](NPC_Move): 使 NPC 移动到指定位置。
65+
- [NPC_IsMoving](NPC_IsMoving): 检查 NPC 是否正在移动。
66+
- [NPC_GetPos](NPC_GetPos): 获取 NPC 的当前位置。
67+
- [NPC_StopMove](NPC_StopMove): 停止 NPC 的移动。
68+
69+
## 相关回调
70+
71+
- [OnNPCFinishMove](../callbacks/OnNPCFinishMove): 当 NPC 完成移动时调用。

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/server/CommonServerIssues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_label: 常见服务器问题
99

1010
## 服务器无法运行 - 防火墙已关闭
1111

12-
您需要进行端口转发以允许玩家加入服务器。推荐使用 [PF Port Checker](https://portforward.com) 进行端口转发。若端口未转发,需在路由器中开启端口。可参考[路由器列表](https://portforward.com/router.htm)
12+
你需要进行端口转发以允许玩家加入服务器。推荐使用 [PF Port Checker](https://portforward.com) 进行端口转发。若端口未转发,需在路由器中开启端口。可参考[路由器列表](https://portforward.com/router.htm)
1313

1414
该网站包含完整的端口转发教程。
1515

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/server/Installation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: 从 SA:MP 服务器迁移游戏模式到 open.mp 的完整指南
3-
sidebar_label: 服务器迁移指南
4-
description: 本教程面向需要将游戏模式从 SA:MP 服务器迁移至 open.mp 服务器的开发者
2+
title: 安装
3+
sidebar_label: 安装
4+
description: 将游戏模式从 SA:MP 服务器迁移至 open.mp 服务器的指南
55
---
66

77
**本教程适用于需要将游戏模式从 SA:MP 服务器迁移至 open.mp 服务器的开发者**
88

9-
:::note
9+
:::tip
1010

11-
如果你正在使用 FCNPC 插件,请暂时停止使用,因为该插件目前不兼容 open.mp。
11+
**FCNPC 用户的好消息!** 传统的 FCNPC 插件已被官方的 **open.mp NPC 组件** 取代,它提供了相同的功能,并且性能更好,集成更原生。只需将你的代码转换为内置的 NPC 组件即可
1212

1313
:::
1414

@@ -280,9 +280,9 @@ GivePlayerWeapon(playerid, WEAPON_KNIFE, 1);
280280

281281
<hr />
282282

283-
- **warning 234: 函数已弃用 (符号 "GetPlayerPoolSize") 此函数存在根本性缺陷**
284-
- **warning 234: 函数已弃用 (符号 "GetVehiclePoolSize") 此函数存在根本性缺陷**
285-
- **warning 234: 函数已弃用 (符号 "GetActorPoolSize") 此函数存在根本性缺陷**
283+
- **warning 234: 函数已弃用 (符号 "GetPlayerPoolSize") 此函数已损坏。**
284+
- **warning 234: 函数已弃用 (符号 "GetVehiclePoolSize") 此函数已损坏。**
285+
- **warning 234: 函数已弃用 (符号 "GetActorPoolSize") 此函数已损坏。**
286286

287287
替换方案:
288288

0 commit comments

Comments
 (0)