Skip to content

Commit 0fca711

Browse files
committed
fix parameter name from 'damage' to 'amount' in OnNPCGiveDamage callback (zn-CN)
1 parent d2148e9 commit 0fca711

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tags: ["npc", "伤害"]
1515
| --------------- | ------------------------------------------ |
1616
| npcid | 造成伤害的 NPC 的 ID |
1717
| damagedid | 受到伤害的玩家的 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 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;

0 commit comments

Comments
 (0)