You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 9, 2023. It is now read-only.
Repository navigation
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
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.
publicOnPlayerGiveDamage(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);
returnSendClientMessageToAll(-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)
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).
Activity
NexiusTailer commentedon Jun 7, 2022
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).
ksenonadv commentedon Jun 17, 2022
Fixed next build.