Skip to content

Commit 33823ef

Browse files
committed
fix some stuff and add more documentation
1 parent 7309bb8 commit 33823ef

30 files changed

+203
-458
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
title: GetPlayerInterior
33
sidebar_label: GetPlayerInterior
4-
description: 获取玩家当前所在的室内编号
4+
description: 获取玩家当前所在的室内场景
55
tags: ["玩家"]
66
---
77

88
## 描述
99

10-
获取玩家当前所在的室内编号。已知室内编号及对应坐标位置可参考[室内位置列表](../../resources/interiorids)
10+
获取玩家当前所在的室内场景。已知室内场景及对应坐标位置可参考[室内位置列表](../../resources/interiorids)
1111

1212
| 参数名 | 说明 |
1313
| -------- | ------------------------- |
14-
| playerid | 需要获取室内编号的玩家 ID |
14+
| playerid | 需要获取室内场景的玩家 ID |
1515

1616
## 返回值
1717

18-
玩家当前所在的室内编号(整数类型)
18+
玩家当前所在的室内场景(整数类型)
1919

2020
## 示例代码
2121

@@ -25,7 +25,7 @@ public OnPlayerCommandText(playerid,text[])
2525
if (strcmp(cmdtext, "/int", true) == 0)
2626
{
2727
new string[64];
28-
format(string, sizeof(string), "你当前所在的室内编号是 %i", GetPlayerInterior(playerid));
28+
format(string, sizeof(string), "你当前所在的室内场景是 %i", GetPlayerInterior(playerid));
2929
SendClientMessage(playerid, 0xFF8000FF, string);
3030
return 1;
3131
}
@@ -37,11 +37,11 @@ public OnPlayerCommandText(playerid,text[])
3737
3838
:::tip
3939
40-
NPC 玩家将始终返回室内编号 0
40+
NPC 玩家将始终返回室内场景 0
4141
4242
:::
4343
4444
## 相关函数
4545
46-
- [SetPlayerInterior](SetPlayerInterior): 设置玩家的室内编号
46+
- [SetPlayerInterior](SetPlayerInterior): 设置玩家的室内场景
4747
- [GetPlayerVirtualWorld](GetPlayerVirtualWorld): 获取玩家所在的虚拟世界

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/scripting/functions/NPC_AddPointToPath.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public OnPlayerCommandText(playerid, cmdtext[])
3434
GetPlayerPos(playerid, x, y, z);
3535

3636
// 尝试添加巡逻点
37-
if (NPC_AddPointToPath(g_PatrolPath, x, y, z, 1.5))
37+
if (NPC_AddPointToPath(PlayerPatrolPath[playerid], x, y, z, 1.5))
3838
{
39-
SendClientMessage(playerid, 0x00FF00FF, "已在您的当前位置向路径 %d 添加路径点", g_PatrolPath);
39+
SendClientMessage(playerid, 0x00FF00FF, "已在您的当前位置向路径 %d 添加路径点", PlayerPatrolPath[playerid]);
4040
}
4141
else
4242
{

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/scripting/functions/NPC_AimAt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
3838
{
3939
new npcid = PlayerNPC[playerid];
4040
if (npcid == INVALID_NPC_ID)
41-
return SendClientMessage(playerid, 0xFF0000FF, "您没有NPC。");
41+
return SendClientMessage(playerid, 0xFF0000FF, "您没有在调试NPC。");
4242

4343
new Float:x, Float:y, Float:z;
4444
GetPlayerPos(playerid, x, y, z);
@@ -52,7 +52,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
5252
{
5353
new npcid = PlayerNPC[playerid];
5454
if (npcid == INVALID_NPC_ID)
55-
return SendClientMessage(playerid, 0xFF0000FF, "您没有NPC。");
55+
return SendClientMessage(playerid, 0xFF0000FF, "您没有在调试NPC。");
5656

5757
new Float:x, Float:y, Float:z;
5858
GetPlayerPos(playerid, x, y, z);

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/scripting/functions/NPC_AimAtPlayer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
3939
{
4040
new npcid = PlayerNPC[playerid];
4141
if (npcid == INVALID_NPC_ID)
42-
return SendClientMessage(playerid, 0xFF0000FF, "您没有NPC。");
42+
return SendClientMessage(playerid, 0xFF0000FF, "您没有在调试NPC。");
4343

4444
NPC_AimAtPlayer(npcid, playerid, true, 800, true, 0.0, 0.0, 0.8, 0.0, 0.0, 0.6, NPC_ENTITY_CHECK_PLAYER);
4545
SendClientMessage(playerid, 0xFF0000FF, "NPC %d 现在对您怀有敌意!", npcid);
@@ -50,7 +50,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
5050
{
5151
new npcid = PlayerNPC[playerid];
5252
if (npcid == INVALID_NPC_ID)
53-
return SendClientMessage(playerid, 0xFF0000FF, "您没有NPC。");
53+
return SendClientMessage(playerid, 0xFF0000FF, "您没有在调试NPC。");
5454

5555
NPC_AimAtPlayer(npcid, playerid, false, 0, true, 0.0, 0.0, 0.0, 0.0, 0.0, 0.6, NPC_ENTITY_CHECK_PLAYER);
5656
SendClientMessage(playerid, 0x00FF00FF, "NPC %d 现在正在守护您。", npcid);

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/scripting/functions/NPC_ApplyAnimation.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ tags: ["npc", "动画"]
3232
```c
3333
public OnPlayerCommandText(playerid, cmdtext[])
3434
{
35-
if (!strcmp(cmdtext, "/dance", true))
35+
if (!strcmp(cmdtext, "/applydance", true))
3636
{
3737
new npcid = PlayerNPC[playerid];
3838
if (npcid == INVALID_NPC_ID)
39-
return SendClientMessage(playerid, 0xFF0000FF, "您没有NPC。");
39+
return SendClientMessage(playerid, 0xFF0000FF, "您没有在调试NPC。");
4040

4141
NPC_ApplyAnimation(npcid, "DANCING", "dance_loop", 4.1, true, false, false, false, 0);
42-
SendClientMessage(playerid, 0x00FF00FF, "NPC %d 正在播放动画。", npcid);
42+
SendClientMessage(playerid, 0x00FF00FF, "NPC %d 已应用动画。", npcid);
43+
4344
return 1;
4445
}
4546
return 0;

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/scripting/functions/NPC_ClearAnimations.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ tags: ["npc", "动画"]
2424
```c
2525
public OnPlayerCommandText(playerid, cmdtext[])
2626
{
27-
if (!strcmp(cmdtext, "/dance", true))
27+
if (!strcmp(cmdtext, "/applydance", true))
2828
{
2929
new npcid = PlayerNPC[playerid];
3030
if (npcid == INVALID_NPC_ID)
31-
return SendClientMessage(playerid, 0xFF0000FF, "您没有NPC。");
31+
return SendClientMessage(playerid, 0xFF0000FF, "您没有在调试NPC。");
3232

3333
NPC_ApplyAnimation(npcid, "DANCING", "dance_loop", 4.1, true, false, false, false, 0);
34-
SendClientMessage(playerid, 0x00FF00FF, "NPC %d 正在播放动画。", npcid);
34+
SendClientMessage(playerid, 0x00FF00FF, "NPC %d 已应用动画。", npcid);
3535

36-
SetTimerEx("ClearNPCAnimations", 10000, false, "ii", playerid, npcid);
36+
SetTimerEx("ClearNPCAnimations", 25000, false, "ii", playerid, npcid);
3737

3838
return 1;
3939
}

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/scripting/functions/NPC_ClearPath.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public OnPlayerCommandText(playerid, cmdtext[])
2727
if (!strcmp(cmdtext, "/clearpatrol", true))
2828
{
2929
// 获取清除前的点数
30-
new count = NPC_GetPathPointCount(g_PatrolPath);
30+
new count = NPC_GetPathPointCount(PlayerPatrolPath[playerid]);
3131

3232
// 尝试清除路径
33-
if (NPC_ClearPath(g_PatrolPath))
33+
if (NPC_ClearPath(PlayerPatrolPath[playerid]))
3434
{
35-
SendClientMessage(playerid, 0x00FF00FF, "已清除路径 %d(移除了 %d 个点)", g_PatrolPath, count);
35+
SendClientMessage(playerid, 0x00FF00FF, "已清除路径 %d(移除了 %d 个点)", PlayerPatrolPath[playerid], count);
3636
}
3737
else
3838
{

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/scripting/functions/NPC_Create.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ new g_NPCCount = 0,
2727

2828
public OnPlayerCommandText(playerid, cmdtext[])
2929
{
30-
if (!strcmp(cmdtext, "/spawnnpc", true))
30+
if (!strcmp(cmdtext, "/createnpc", true))
3131
{
3232
new name[24];
3333
format(name, sizeof name, "Bot_%d", g_NPCCount++);
@@ -41,7 +41,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
4141
NPC_Spawn(npcid);
4242
NPC_SetPos(npcid, x + 3.0, y, z);
4343
NPC_SetWeapon(npcid, WEAPON_M4);
44-
NPC_SetAmmo(npcid, 300); // 给予300发弹药
44+
NPC_SetAmmo(npcid, 500);
4545

4646
PlayerNPC[playerid] = npcid;
4747
SendClientMessage(playerid, 0x00FF00FF, "NPC %s(ID %d)已在您附近生成!", name, npcid);

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/scripting/functions/NPC_DestroyPath.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ public OnPlayerCommandText(playerid, cmdtext[])
2727
if (!strcmp(cmdtext, "/deletepatrol", true))
2828
{
2929
// 首先检查路径是否有效
30-
if (!NPC_IsValidPath(g_PatrolPath))
30+
if (!NPC_IsValidPath(PlayerPatrolPath[playerid]))
3131
{
3232
SendClientMessage(playerid, 0xFF0000FF, "没有有效的巡逻路径可以删除。");
3333
return 1;
3434
}
3535

3636
// 获取路径中有多少个点
37-
new count = NPC_GetPathPointCount(g_PatrolPath);
37+
new count = NPC_GetPathPointCount(PlayerPatrolPath[playerid]);
3838

3939
// 尝试销毁它
40-
if (NPC_DestroyPath(g_PatrolPath))
40+
if (NPC_DestroyPath(PlayerPatrolPath[playerid]))
4141
{
42-
SendClientMessage(playerid, 0x00FF00FF, "已销毁路径 %d(移除了 %d 个点)。", g_PatrolPath, count);
42+
SendClientMessage(playerid, 0x00FF00FF, "已销毁路径 %d(移除了 %d 个点)。", PlayerPatrolPath[playerid], count);
4343

4444
// 重置全局变量,因为它现在无效了
45-
g_PatrolPath = -1;
45+
PlayerPatrolPath[playerid] = -1;
4646
}
4747
else
4848
{

frontend/i18n/zh-Hans/docusaurus-plugin-content-docs/current/scripting/functions/NPC_EnableInfiniteAmmo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
2929
{
3030
new npcid = PlayerNPC[playerid];
3131
if (npcid == INVALID_NPC_ID)
32-
return SendClientMessage(playerid, 0xFF0000FF, "您没有NPC。");
32+
return SendClientMessage(playerid, 0xFF0000FF, "您没有在调试NPC。");
3333

3434
new bool:infinite = NPC_IsInfiniteAmmoEnabled(npcid);
3535
NPC_EnableInfiniteAmmo(npcid, !infinite);

0 commit comments

Comments
 (0)