Skip to content

Commit 1c3bd1b

Browse files
authored
Merge pull request #1174 from CrasH837/master
fix parameter tags in NPC callback descriptions and typos in OnNPCTakeDamage/OnNPCGiveDamage (zh-CN)
2 parents fc87c47 + b95e0e9 commit 1c3bd1b

File tree

8 files changed

+61
-61
lines changed

8 files changed

+61
-61
lines changed

frontend/docs/scripting/callbacks/OnNPCDeath.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ tags: ["npc"]
1111

1212
This callback is called when an NPC dies.
1313

14-
| Name | Description |
15-
| -------- | --------------------------------------------------------------------------- |
16-
| npcid | The ID of the NPC that died |
17-
| killerid | The ID of the player/NPC that killed the NPC (or INVALID_PLAYER_ID if none) |
18-
| reason | The reason for death (weapon ID or death cause) |
14+
| Name | Description |
15+
| ------------- | --------------------------------------------------------------------------- |
16+
| npcid | The ID of the NPC that died |
17+
| killerid | The ID of the player/NPC that killed the NPC (or INVALID_PLAYER_ID if none) |
18+
| WEAPON:reason | The reason for death (weapon ID or death cause) |
1919

2020
## Examples
2121

frontend/docs/scripting/callbacks/OnNPCGiveDamage.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ tags: ["npc", "damage"]
1111

1212
This callback is called when an NPC gives damage to a player.
1313

14-
| Name | Description |
15-
| --------- | ---------------------------------------------------- |
16-
| npcid | The ID of the NPC that gave the damage |
17-
| damagedid | The ID of the player that received the damage |
18-
| amount | The amount of damage that was given |
19-
| weaponid | The weapon ID used to give the damage |
20-
| bodypart | The [body part](../resources/bodyparts) that was hit |
14+
| Name | Description |
15+
| --------------- | ---------------------------------------------------- |
16+
| npcid | The ID of the NPC that gave the damage |
17+
| damagedid | The ID of the player that received the damage |
18+
| Float:amount | The amount of damage that was given |
19+
| WEAPON:weaponid | The weapon ID used to give the damage |
20+
| bodypart | The [body part](../resources/bodyparts) that was hit |
2121

2222
## Returns
2323

frontend/docs/scripting/callbacks/OnNPCTakeDamage.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ tags: ["npc", "damage"]
1111

1212
This callback is called when an NPC takes damage from a player or another NPC.
1313

14-
| Name | Description |
15-
| --------- | ---------------------------------------------------- |
16-
| npcid | The ID of the NPC that took damage |
17-
| issuerid | The ID of the player/NPC that caused the damage |
18-
| amount | The amount of damage that was taken |
19-
| weaponid | The weapon ID used to cause the damage |
20-
| bodypart | The [body part](../resources/bodyparts) that was hit |
14+
| Name | Description |
15+
| --------------- | ---------------------------------------------------- |
16+
| npcid | The ID of the NPC that took damage |
17+
| issuerid | The ID of the player/NPC that caused the damage |
18+
| Float:amount | The amount of damage that was taken |
19+
| WEAPON:weaponid | The weapon ID used to cause the damage |
20+
| bodypart | The [body part](../resources/bodyparts) that was hit |
2121

2222
## Returns
2323

frontend/docs/scripting/callbacks/OnNPCWeaponShot.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ tags: ["npc", "weapon", "shooting"]
1111

1212
This callback is called when an NPC fires a weapon.
1313

14-
| Name | Description |
15-
| -------- | ------------------------------------------ |
16-
| npcid | The ID of the NPC that fired the weapon |
17-
| weaponid | The weapon ID that was fired |
18-
| hittype | The type of entity that was hit (if any) |
19-
| hitid | The ID of the entity that was hit (if any) |
20-
| fX | The X coordinate where the bullet hit |
21-
| fY | The Y coordinate where the bullet hit |
22-
| fZ | The Z coordinate where the bullet hit |
14+
| Name | Description |
15+
| ----------------------- | ------------------------------------------ |
16+
| npcid | The ID of the NPC that fired the weapon |
17+
| WEAPON:weaponid | The weapon ID that was fired |
18+
| BULLET_HIT_TYPE:hittype | The type of entity that was hit (if any) |
19+
| hitid | The ID of the entity that was hit (if any) |
20+
| Float:fX | The X coordinate where the bullet hit |
21+
| Float:fY | The Y coordinate where the bullet hit |
22+
| Float:fZ | The Z coordinate where the bullet hit |
2323

2424
## Returns
2525

frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDeath.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ tags: ["npc"]
1111

1212
当 NPC 死亡时调用此回调。
1313

14-
| 参数 | 说明 |
15-
| -------- | ----------------------------------------------------------- |
16-
| npcid | 死亡的 NPC 的 ID |
17-
| killerid | 击杀 NPC 的玩家/NPC 的 ID(如果没有则为 INVALID_PLAYER_ID) |
18-
| reason | 死亡原因(武器 ID 或死亡原因) |
14+
| 参数 | 说明 |
15+
| ------------- | ----------------------------------------------------------- |
16+
| npcid | 死亡的 NPC 的 ID |
17+
| killerid | 击杀 NPC 的玩家/NPC 的 ID(如果没有则为 INVALID_PLAYER_ID) |
18+
| Weapon:reason | 死亡原因(武器 ID 或死亡原因) |
1919

2020
## 示例
2121

frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCGiveDamage.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ tags: ["npc", "伤害"]
1111

1212
当 NPC 对玩家造成伤害时调用此回调。
1313

14-
| 参数 | 说明 |
15-
| --------- | ------------------------------------------ |
16-
| npcid | 造成伤害的 NPC 的 ID |
17-
| damagedid | 受到伤害的玩家的 ID |
18-
| damage | 造成的伤害数量 |
19-
| weaponid | 用于造成伤害的武器 ID |
20-
| bodypart | 被击中的[身体部位](../resources/bodyparts) |
14+
| 参数 | 说明 |
15+
| --------------- | ------------------------------------------ |
16+
| npcid | 造成伤害的 NPC 的 ID |
17+
| damagedid | 受到伤害的玩家的 ID |
18+
| Float:amount | 造成的伤害数量 |
19+
| WEAPON:weaponid | 用于造成伤害的武器 ID |
20+
| bodypart | 被击中的[身体部位](../resources/bodyparts) |
2121

2222
## 返回值
2323

@@ -26,7 +26,7 @@ tags: ["npc", "伤害"]
2626
## 示例
2727

2828
```c
29-
public OnNPCGiveDamage(npcid, damagedid, Float:damage, WEAPON:weaponid, bodypart)
29+
public OnNPCGiveDamage(npcid, damagedid, Float:amount, WEAPON:weaponid, bodypart)
3030
{
3131
// 仅通知追踪此 NPC 的玩家
3232
for (new playerid = 0; playerid < MAX_PLAYERS; playerid++)
@@ -37,7 +37,7 @@ public OnNPCGiveDamage(npcid, damagedid, Float:damage, WEAPON:weaponid, bodypart
3737
if (PlayerNPC[playerid] == npcid)
3838
{
3939
SendClientMessage(playerid, 0xFF8800FF, "NPC %d 对玩家 %d 造成了 %.1f 点伤害(武器:%d,身体部位:%d)",
40-
npcid, damage, damagedid, _:weaponid, bodypart);
40+
npcid, amount, damagedid, _:weaponid, bodypart);
4141
}
4242
}
4343
return 1;

frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCTakeDamage.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ tags: ["npc", "伤害"]
1111

1212
当 NPC 受到来自玩家或其他 NPC 的伤害时调用此回调。
1313

14-
| 参数 | 说明 |
15-
| -------- | ------------------------------------------ |
16-
| npcid | 受到伤害的 NPC 的 ID |
17-
| issuerid | 造成伤害的玩家/NPC 的 ID |
18-
| damage | 受到的伤害数量 |
19-
| weaponid | 用于造成伤害的武器 ID |
20-
| bodypart | 被击中的[身体部位](../resources/bodyparts) |
14+
| 参数 | 说明 |
15+
| --------------- | ------------------------------------------ |
16+
| npcid | 受到伤害的 NPC 的 ID |
17+
| issuerid | 造成伤害的玩家/NPC 的 ID |
18+
| Float:amount | 受到的伤害数量 |
19+
| WEAPON:weaponid | 用于造成伤害的武器 ID |
20+
| bodypart | 被击中的[身体部位](../resources/bodyparts) |
2121

2222
## 返回值
2323

@@ -26,7 +26,7 @@ tags: ["npc", "伤害"]
2626
## 示例
2727

2828
```c
29-
public OnNPCTakeDamage(npcid, issuerid, Float:damage, WEAPON:weaponid, bodypart)
29+
public OnNPCTakeDamage(npcid, issuerid, Float:amount, WEAPON:weaponid, bodypart)
3030
{
3131
// 仅通知追踪此 NPC 的玩家
3232
for (new playerid = 0; playerid < MAX_PLAYERS; playerid++)
@@ -39,12 +39,12 @@ public OnNPCTakeDamage(npcid, issuerid, Float:damage, WEAPON:weaponid, bodypart)
3939
if (issuerid == INVALID_PLAYER_ID)
4040
{
4141
SendClientMessage(playerid, 0xFF8800FF, "NPC %d 受到 %.1f 点伤害(武器:%d,身体部位:%d)",
42-
npcid, damage, _:weaponid, bodypart);
42+
npcid, amount, _:weaponid, bodypart);
4343
}
4444
else
4545
{
4646
SendClientMessage(playerid, 0xFF8800FF, "NPC %d 受到玩家 %d 造成的 %.1f 点伤害(武器:%d,身体部位:%d)",
47-
npcid, damage, issuerid, _:weaponid, bodypart);
47+
npcid, amount, issuerid, _:weaponid, bodypart);
4848
}
4949
}
5050
}

frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCWeaponShot.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ tags: ["npc", "武器", "射击"]
1111

1212
当 NPC 开火时调用此回调。
1313

14-
| 参数 | 说明 |
15-
| -------- | ------------------------ |
16-
| npcid | 开火的 NPC 的 ID |
17-
| weaponid | 开火的武器 ID |
18-
| hittype | 命中的实体类型(如果有) |
19-
| hitid | 命中的实体 ID(如果有) |
20-
| fX | 子弹击中的 X 坐标 |
21-
| fY | 子弹击中的 Y 坐标 |
22-
| fZ | 子弹击中的 Z 坐标 |
14+
| 参数 | 说明 |
15+
| ----------------------- | ------------------------ |
16+
| npcid | 开火的 NPC 的 ID |
17+
| WEAPON:weaponid | 开火的武器 ID |
18+
| BULLET_HIT_TYPE:hittype | 命中的实体类型(如果有) |
19+
| hitid | 命中的实体 ID(如果有) |
20+
| Float:fX | 子弹击中的 X 坐标 |
21+
| Float:fY | 子弹击中的 Y 坐标 |
22+
| Float:fZ | 子弹击中的 Z 坐标 |
2323

2424
## 返回值
2525

0 commit comments

Comments
 (0)