Skip to content

Commit 70fa760

Browse files
committed
fix parameter name from 'damage' to 'amount' in OnNPCTakeDamage callback (zh-CN)
1 parent 1f3e176 commit 70fa760

File tree

1 file changed

+4
-4
lines changed
  • frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tags: ["npc", "伤害"]
1515
| --------------- | ------------------------------------------ |
1616
| npcid | 受到伤害的 NPC 的 ID |
1717
| issuerid | 造成伤害的玩家/NPC 的 ID |
18-
| Float:damage | 受到的伤害数量 |
18+
| Float:amount | 受到的伤害数量 |
1919
| WEAPON:weaponid | 用于造成伤害的武器 ID |
2020
| bodypart | 被击中的[身体部位](../resources/bodyparts) |
2121

@@ -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
}

0 commit comments

Comments
 (0)