Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: open.mp development progress and changelog.
## **[v1.5.8.3079](https://github.com/openmultiplayer/open.mp/releases/tag/v1.5.8.3079) (Latest)**


We're excited to announce the release of out latest server version!
We're excited to announce the release of our latest server version!

This update brings several important fixes and introduces a long awaited new feature: **Fully controllable NPCs**!

Expand Down Expand Up @@ -68,7 +68,7 @@ We’re excited to build what comes next together with the community.
<details>
<summary>Click here to expand</summary>

We're excited to announce the release of out latest server version!
We're excited to announce the release of our latest server version!

This update brings several important fixes and introduces an exciting new feature: **openmp Packet Encryption**.

Expand Down
6 changes: 3 additions & 3 deletions frontend/docs/scripting/callbacks/OnNPCGiveDamage.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This callback is called when an NPC gives damage to a player.
| --------- | ---------------------------------------------------- |
| npcid | The ID of the NPC that gave the damage |
| damagedid | The ID of the player that received the damage |
| damage | The amount of damage that was given |
| 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 |

Expand All @@ -26,7 +26,7 @@ Return `false` to prevent the damage from being applied, or `true` to allow it.
## Examples

```c
public OnNPCGiveDamage(npcid, damagedid, Float:damage, WEAPON:weaponid, bodypart)
public OnNPCGiveDamage(npcid, damagedid, Float:amount, WEAPON:weaponid, bodypart)
{
// Only notify players tracking this NPC
for (new playerid = 0; playerid < MAX_PLAYERS; playerid++)
Expand All @@ -37,7 +37,7 @@ public OnNPCGiveDamage(npcid, damagedid, Float:damage, WEAPON:weaponid, bodypart
if (PlayerNPC[playerid] == npcid)
{
SendClientMessage(playerid, 0xFF8800FF, "NPC %d dealt %.1f damage to player %d (weapon: %d, bodypart: %d)",
npcid, damage, damagedid, _:weaponid, bodypart);
npcid, amount, damagedid, _:weaponid, bodypart);
}
}
return 1;
Expand Down
14 changes: 7 additions & 7 deletions frontend/docs/scripting/callbacks/OnNPCTakeDamage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ 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 |
| damagerid | The ID of the player/NPC that caused the damage |
| damage | The amount of damage that was taken |
| 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 |

Expand All @@ -26,7 +26,7 @@ Return `false` to prevent the damage from being applied, or `true` to allow it.
## Examples

```c
public OnNPCTakeDamage(npcid, damagerid, Float:damage, WEAPON:weaponid, bodypart)
public OnNPCTakeDamage(npcid, issuerid, Float:amount, WEAPON:weaponid, bodypart)
{
// Only notify players tracking this NPC
for (new playerid = 0; playerid < MAX_PLAYERS; playerid++)
Expand All @@ -36,15 +36,15 @@ public OnNPCTakeDamage(npcid, damagerid, Float:damage, WEAPON:weaponid, bodypart

if (PlayerNPC[playerid] == npcid)
{
if (damagerid == INVALID_PLAYER_ID)
if (issuerid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, 0xFF8800FF, "NPC %d took %.1f damage (weapon: %d, bodypart: %d)",
npcid, damage, _:weaponid, bodypart);
npcid, amount, _:weaponid, bodypart);
}
else
{
SendClientMessage(playerid, 0xFF8800FF, "NPC %d took %.1f damage from player %d (weapon: %d, bodypart: %d)",
npcid, damage, damagerid, _:weaponid, bodypart);
npcid, amount, issuerid, _:weaponid, bodypart);
}
}
}
Expand All @@ -56,7 +56,7 @@ public OnNPCTakeDamage(npcid, damagerid, Float:damage, WEAPON:weaponid, bodypart

- This callback is called before the damage is actually applied to the NPC
- Returning `false` will prevent the damage from being applied
- The `damagerid` parameter will be `INVALID_PLAYER_ID` if damage is not caused by player
- The `issuerid` parameter will be `INVALID_PLAYER_ID` if damage is not caused by player
- Body parts use the same constants as `OnPlayerTakeDamage`

## Related Functions
Expand Down