Skip to content

Commit c8fc267

Browse files
committed
Fix parameter name from 'damage' to 'amount' in OnNPCGiveDamage callback
1 parent 5c2255d commit c8fc267

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/docs/scripting/callbacks/OnNPCGiveDamage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This callback is called when an NPC gives damage to a player.
1515
| --------- | ---------------------------------------------------- |
1616
| npcid | The ID of the NPC that gave the damage |
1717
| damagedid | The ID of the player that received the damage |
18-
| damage | The amount of damage that was given |
18+
| amount | The amount of damage that was given |
1919
| weaponid | The weapon ID used to give the damage |
2020
| bodypart | The [body part](../resources/bodyparts) that was hit |
2121

@@ -26,7 +26,7 @@ Return `false` to prevent the damage from being applied, or `true` to allow it.
2626
## Examples
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
// Only notify players tracking this 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 dealt %.1f damage to player %d (weapon: %d, bodypart: %d)",
40-
npcid, damage, damagedid, _:weaponid, bodypart);
40+
npcid, amount, damagedid, _:weaponid, bodypart);
4141
}
4242
}
4343
return 1;

0 commit comments

Comments
 (0)