From 7bf1571f0b5c7f317fb8485b782ca2d36b7b9490 Mon Sep 17 00:00:00 2001 From: CrasH837 Date: Wed, 24 Dec 2025 01:18:16 +0200 Subject: [PATCH 1/6] fix missing parameter tags in OnNPCDeath callback description --- frontend/docs/scripting/callbacks/OnNPCDeath.md | 10 +++++----- .../current/scripting/callbacks/OnNPCDeath.md | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/docs/scripting/callbacks/OnNPCDeath.md b/frontend/docs/scripting/callbacks/OnNPCDeath.md index f8aca7ba63f..902ad809ebf 100644 --- a/frontend/docs/scripting/callbacks/OnNPCDeath.md +++ b/frontend/docs/scripting/callbacks/OnNPCDeath.md @@ -11,11 +11,11 @@ tags: ["npc"] This callback is called when an NPC dies. -| Name | Description | -| -------- | --------------------------------------------------------------------------- | -| npcid | The ID of the NPC that died | -| killerid | The ID of the player/NPC that killed the NPC (or INVALID_PLAYER_ID if none) | -| reason | The reason for death (weapon ID or death cause) | +| Name | Description | +| ------------- | --------------------------------------------------------------------------- | +| npcid | The ID of the NPC that died | +| killerid | The ID of the player/NPC that killed the NPC (or INVALID_PLAYER_ID if none) | +| WEAPON:reason | The reason for death (weapon ID or death cause) | ## Examples diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDeath.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDeath.md index fe56adce43c..ea39f631c73 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDeath.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCDeath.md @@ -11,11 +11,11 @@ tags: ["npc"] 当 NPC 死亡时调用此回调。 -| 参数 | 说明 | -| -------- | ----------------------------------------------------------- | -| npcid | 死亡的 NPC 的 ID | -| killerid | 击杀 NPC 的玩家/NPC 的 ID(如果没有则为 INVALID_PLAYER_ID) | -| reason | 死亡原因(武器 ID 或死亡原因) | +| 参数 | 说明 | +| ------------- | ----------------------------------------------------------- | +| npcid | 死亡的 NPC 的 ID | +| killerid | 击杀 NPC 的玩家/NPC 的 ID(如果没有则为 INVALID_PLAYER_ID) | +| Weapon:reason | 死亡原因(武器 ID 或死亡原因) | ## 示例 From d2148e9b80a5a52ef4ed5708060ba345a85063b3 Mon Sep 17 00:00:00 2001 From: CrasH837 Date: Wed, 24 Dec 2025 01:25:24 +0200 Subject: [PATCH 2/6] fix missing parameter tags in OnNPCGiveDamage callback description --- .../docs/scripting/callbacks/OnNPCGiveDamage.md | 14 +++++++------- .../current/scripting/callbacks/OnNPCGiveDamage.md | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/docs/scripting/callbacks/OnNPCGiveDamage.md b/frontend/docs/scripting/callbacks/OnNPCGiveDamage.md index 9ddb6113fa3..a31fa45a29c 100644 --- a/frontend/docs/scripting/callbacks/OnNPCGiveDamage.md +++ b/frontend/docs/scripting/callbacks/OnNPCGiveDamage.md @@ -11,13 +11,13 @@ tags: ["npc", "damage"] This callback is called when an NPC gives damage to a player. -| Name | Description | -| --------- | ---------------------------------------------------- | -| npcid | The ID of the NPC that gave the damage | -| damagedid | The ID of the player that received the damage | -| amount | The amount of damage that was given | -| weaponid | The weapon ID used to give the damage | -| bodypart | The [body part](../resources/bodyparts) that was hit | +| Name | Description | +| --------------- | ---------------------------------------------------- | +| npcid | The ID of the NPC that gave the damage | +| damagedid | The ID of the player that received the damage | +| Float:amount | The amount of damage that was given | +| WEAPON:weaponid | The weapon ID used to give the damage | +| bodypart | The [body part](../resources/bodyparts) that was hit | ## Returns diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCGiveDamage.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCGiveDamage.md index 5cbed464a5a..0736f42766a 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCGiveDamage.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCGiveDamage.md @@ -11,13 +11,13 @@ tags: ["npc", "伤害"] 当 NPC 对玩家造成伤害时调用此回调。 -| 参数 | 说明 | -| --------- | ------------------------------------------ | -| npcid | 造成伤害的 NPC 的 ID | -| damagedid | 受到伤害的玩家的 ID | -| damage | 造成的伤害数量 | -| weaponid | 用于造成伤害的武器 ID | -| bodypart | 被击中的[身体部位](../resources/bodyparts) | +| 参数 | 说明 | +| --------------- | ------------------------------------------ | +| npcid | 造成伤害的 NPC 的 ID | +| damagedid | 受到伤害的玩家的 ID | +| Float:damage | 造成的伤害数量 | +| WEAPON:weaponid | 用于造成伤害的武器 ID | +| bodypart | 被击中的[身体部位](../resources/bodyparts) | ## 返回值 From 0fca711ddb83188a7cc346f340a35c0d9f1b9150 Mon Sep 17 00:00:00 2001 From: CrasH837 Date: Wed, 24 Dec 2025 01:28:27 +0200 Subject: [PATCH 3/6] fix parameter name from 'damage' to 'amount' in OnNPCGiveDamage callback (zn-CN) --- .../current/scripting/callbacks/OnNPCGiveDamage.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCGiveDamage.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCGiveDamage.md index 0736f42766a..1d1250f0d58 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCGiveDamage.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCGiveDamage.md @@ -15,7 +15,7 @@ tags: ["npc", "伤害"] | --------------- | ------------------------------------------ | | npcid | 造成伤害的 NPC 的 ID | | damagedid | 受到伤害的玩家的 ID | -| Float:damage | 造成的伤害数量 | +| Float:amount | 造成的伤害数量 | | WEAPON:weaponid | 用于造成伤害的武器 ID | | bodypart | 被击中的[身体部位](../resources/bodyparts) | @@ -26,7 +26,7 @@ tags: ["npc", "伤害"] ## 示例 ```c -public OnNPCGiveDamage(npcid, damagedid, Float:damage, WEAPON:weaponid, bodypart) +public OnNPCGiveDamage(npcid, damagedid, Float:amount, WEAPON:weaponid, bodypart) { // 仅通知追踪此 NPC 的玩家 for (new playerid = 0; playerid < MAX_PLAYERS; playerid++) @@ -37,7 +37,7 @@ public OnNPCGiveDamage(npcid, damagedid, Float:damage, WEAPON:weaponid, bodypart if (PlayerNPC[playerid] == npcid) { SendClientMessage(playerid, 0xFF8800FF, "NPC %d 对玩家 %d 造成了 %.1f 点伤害(武器:%d,身体部位:%d)", - npcid, damage, damagedid, _:weaponid, bodypart); + npcid, amount, damagedid, _:weaponid, bodypart); } } return 1; From 1f3e1761513d95b5d2f6bfca84213adac3a4aad2 Mon Sep 17 00:00:00 2001 From: CrasH837 Date: Wed, 24 Dec 2025 01:34:29 +0200 Subject: [PATCH 4/6] fix missing parameter tags in OnNPCTakeDamage callback description --- .../docs/scripting/callbacks/OnNPCTakeDamage.md | 14 +++++++------- .../current/scripting/callbacks/OnNPCTakeDamage.md | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/docs/scripting/callbacks/OnNPCTakeDamage.md b/frontend/docs/scripting/callbacks/OnNPCTakeDamage.md index 666c12c1321..fd7abcada60 100644 --- a/frontend/docs/scripting/callbacks/OnNPCTakeDamage.md +++ b/frontend/docs/scripting/callbacks/OnNPCTakeDamage.md @@ -11,13 +11,13 @@ tags: ["npc", "damage"] This callback is called when an NPC takes damage from a player or another NPC. -| Name | Description | -| --------- | ---------------------------------------------------- | -| npcid | The ID of the NPC that took damage | -| issuerid | The ID of the player/NPC that caused the damage | -| amount | The amount of damage that was taken | -| weaponid | The weapon ID used to cause the damage | -| bodypart | The [body part](../resources/bodyparts) that was hit | +| Name | Description | +| --------------- | ---------------------------------------------------- | +| npcid | The ID of the NPC that took damage | +| issuerid | The ID of the player/NPC that caused the damage | +| Float:amount | The amount of damage that was taken | +| WEAPON:weaponid | The weapon ID used to cause the damage | +| bodypart | The [body part](../resources/bodyparts) that was hit | ## Returns diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCTakeDamage.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCTakeDamage.md index 15ec1a9ce09..407a7fdb15b 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCTakeDamage.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCTakeDamage.md @@ -11,13 +11,13 @@ tags: ["npc", "伤害"] 当 NPC 受到来自玩家或其他 NPC 的伤害时调用此回调。 -| 参数 | 说明 | -| -------- | ------------------------------------------ | -| npcid | 受到伤害的 NPC 的 ID | -| issuerid | 造成伤害的玩家/NPC 的 ID | -| damage | 受到的伤害数量 | -| weaponid | 用于造成伤害的武器 ID | -| bodypart | 被击中的[身体部位](../resources/bodyparts) | +| 参数 | 说明 | +| --------------- | ------------------------------------------ | +| npcid | 受到伤害的 NPC 的 ID | +| issuerid | 造成伤害的玩家/NPC 的 ID | +| Float:damage | 受到的伤害数量 | +| WEAPON:weaponid | 用于造成伤害的武器 ID | +| bodypart | 被击中的[身体部位](../resources/bodyparts) | ## 返回值 From 70fa760d5dd86d426c49155aa5e6f152e74aedae Mon Sep 17 00:00:00 2001 From: CrasH837 Date: Wed, 24 Dec 2025 01:37:37 +0200 Subject: [PATCH 5/6] fix parameter name from 'damage' to 'amount' in OnNPCTakeDamage callback (zh-CN) --- .../current/scripting/callbacks/OnNPCTakeDamage.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCTakeDamage.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCTakeDamage.md index 407a7fdb15b..7e8a5fcc66b 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCTakeDamage.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCTakeDamage.md @@ -15,7 +15,7 @@ tags: ["npc", "伤害"] | --------------- | ------------------------------------------ | | npcid | 受到伤害的 NPC 的 ID | | issuerid | 造成伤害的玩家/NPC 的 ID | -| Float:damage | 受到的伤害数量 | +| Float:amount | 受到的伤害数量 | | WEAPON:weaponid | 用于造成伤害的武器 ID | | bodypart | 被击中的[身体部位](../resources/bodyparts) | @@ -26,7 +26,7 @@ tags: ["npc", "伤害"] ## 示例 ```c -public OnNPCTakeDamage(npcid, issuerid, Float:damage, WEAPON:weaponid, bodypart) +public OnNPCTakeDamage(npcid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { // 仅通知追踪此 NPC 的玩家 for (new playerid = 0; playerid < MAX_PLAYERS; playerid++) @@ -39,12 +39,12 @@ public OnNPCTakeDamage(npcid, issuerid, Float:damage, WEAPON:weaponid, bodypart) if (issuerid == INVALID_PLAYER_ID) { SendClientMessage(playerid, 0xFF8800FF, "NPC %d 受到 %.1f 点伤害(武器:%d,身体部位:%d)", - npcid, damage, _:weaponid, bodypart); + npcid, amount, _:weaponid, bodypart); } else { SendClientMessage(playerid, 0xFF8800FF, "NPC %d 受到玩家 %d 造成的 %.1f 点伤害(武器:%d,身体部位:%d)", - npcid, damage, issuerid, _:weaponid, bodypart); + npcid, amount, issuerid, _:weaponid, bodypart); } } } From b95e0e901e0c3ff178fa959495775b96b70e5992 Mon Sep 17 00:00:00 2001 From: CrasH837 Date: Wed, 24 Dec 2025 01:41:01 +0200 Subject: [PATCH 6/6] fix missing parameter tags in OnNPCWeaponShot callback description --- .../scripting/callbacks/OnNPCWeaponShot.md | 18 +++++++++--------- .../scripting/callbacks/OnNPCWeaponShot.md | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/frontend/docs/scripting/callbacks/OnNPCWeaponShot.md b/frontend/docs/scripting/callbacks/OnNPCWeaponShot.md index 4909fdab80e..ff68f73766d 100644 --- a/frontend/docs/scripting/callbacks/OnNPCWeaponShot.md +++ b/frontend/docs/scripting/callbacks/OnNPCWeaponShot.md @@ -11,15 +11,15 @@ tags: ["npc", "weapon", "shooting"] This callback is called when an NPC fires a weapon. -| Name | Description | -| -------- | ------------------------------------------ | -| npcid | The ID of the NPC that fired the weapon | -| weaponid | The weapon ID that was fired | -| hittype | The type of entity that was hit (if any) | -| hitid | The ID of the entity that was hit (if any) | -| fX | The X coordinate where the bullet hit | -| fY | The Y coordinate where the bullet hit | -| fZ | The Z coordinate where the bullet hit | +| Name | Description | +| ----------------------- | ------------------------------------------ | +| npcid | The ID of the NPC that fired the weapon | +| WEAPON:weaponid | The weapon ID that was fired | +| BULLET_HIT_TYPE:hittype | The type of entity that was hit (if any) | +| hitid | The ID of the entity that was hit (if any) | +| Float:fX | The X coordinate where the bullet hit | +| Float:fY | The Y coordinate where the bullet hit | +| Float:fZ | The Z coordinate where the bullet hit | ## Returns diff --git a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCWeaponShot.md b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCWeaponShot.md index 65dea532e9b..d615636fe57 100644 --- a/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCWeaponShot.md +++ b/frontend/i18n/zh-CN/docusaurus-plugin-content-docs/current/scripting/callbacks/OnNPCWeaponShot.md @@ -11,15 +11,15 @@ tags: ["npc", "武器", "射击"] 当 NPC 开火时调用此回调。 -| 参数 | 说明 | -| -------- | ------------------------ | -| npcid | 开火的 NPC 的 ID | -| weaponid | 开火的武器 ID | -| hittype | 命中的实体类型(如果有) | -| hitid | 命中的实体 ID(如果有) | -| fX | 子弹击中的 X 坐标 | -| fY | 子弹击中的 Y 坐标 | -| fZ | 子弹击中的 Z 坐标 | +| 参数 | 说明 | +| ----------------------- | ------------------------ | +| npcid | 开火的 NPC 的 ID | +| WEAPON:weaponid | 开火的武器 ID | +| BULLET_HIT_TYPE:hittype | 命中的实体类型(如果有) | +| hitid | 命中的实体 ID(如果有) | +| Float:fX | 子弹击中的 X 坐标 | +| Float:fY | 子弹击中的 Y 坐标 | +| Float:fZ | 子弹击中的 Z 坐标 | ## 返回值