Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

[BEHAVIOR DIFFERENCE]: Stealth knife kill calls OnPlayerGiveDamage only once #104

Closed

Description

@Zbyss

Description

SA:MP server calls OnPlayerGiveDamage during stealth kill twice - firstly immediately after clicking LMB (0 damage), then at the end of the animation (~1833 damage). open.mp server skips the first call. This behavior breaks knife kills in weapon-config.

How to re-produce this behavior difference

Connect to the server and kill another player using knife.

public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
{
    new string[144];
    format(string, sizeof(string), "OnPlayerGiveDamage(%d gave %f to %d using %d on bodypart %d)", playerid, amount, damagedid, weaponid, bodypart);
    return SendClientMessageToAll(-1, string);
}

Relevant log output

SA:MP output:

OnPlayerGiveDamage(0 gave 0.000000 to 1 using 4 on bodypart 3)
OnPlayerGiveDamage(0 gave 1833.331542 to 1 using 4 on bodypart 3)

open.mp output:

OnPlayerGiveDamage(0 gave 1833.331542 to 1 using 4 on bodypart 3)

open.mp server version

open.mp server public beta build 5

Operating system or distribution

Microsoft Windows 11 64-bit

Contact information

Zbyss.#2597

Additional information

N/A

Activity

  1. NexiusTailer commented on Jun 7, 2022

    @NexiusTailer
    Contributor

    This is because it already blocks any OnPlayerGive/TakeDamage sent with 0.0 (or less) amount of damage.
    I think the build-in validation checks should be changed to just "amount of damage is negative" (less than, but not equal to 0).

  2. ksenonadv commented on Jun 17, 2022

    @ksenonadv
    Member

    Fixed next build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions