Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added knife kills and utility damage tracking #609

Closed
wants to merge 0 commits into from
Closed

Added knife kills and utility damage tracking #609

wants to merge 0 commits into from

Conversation

nickdnk
Copy link
Collaborator

@nickdnk nickdnk commented Dec 24, 2020

Hey again!

I should have added this to my previous PR, but you beat me to merge by an hour. Sorry!

I added utility damage and knife kill tracking as well. The UD is as close to the in-game scoreboard as I can get it, with the only difference being that this will include damage dealt from grenades physically hitting you, while the in-game scoreboard only includes damage dealt from the actual explosion/fire (typically 2-3 damage difference). Aside from that I made sure that it's counted exactly the same and excludes damage dealt to self or your own team. The existing damage stat also incorrectly included any kind of damage inflicted to yourself or your team, so I have corrected that as well.

RE: The comment you made on the previous PR: I understand the desire to avoid cluttering this more than necessary, but I also really don't want to maintain my own version of this and do manual merges and rebuilds for such few changes, as it's 99% of what I need. I'd very much appreciate it if you could merge this as well.

Merry Christmas :)

Edit: I noticed that you had a comment about Format() breaking at 32 arguments, but with this now at 33 it still works fine. Maybe this has been fixed with an update of SourceMod. I have not removed the comment though.

scripting/get5/stats.sp Outdated Show resolved Hide resolved
@splewis
Copy link
Owner

splewis commented Dec 26, 2020

Looks like the max for calling a function is 127: https://github.com/alliedmodders/sourcepawn/blob/e8d7b67b0665baf1faf6d4985c1e92ac1163e43f/include/sp_vm_types.h#L49-L50

This got tweaked in alliedmodders/sourcepawn@d610630.

Since it's not a function we're declaring - only calling - I'm okay with this. Can you update the comment to mention the 127 args limit, and say "see SP_MAX_CALL_ARGUMENTS in sourcepawn."

@nickdnk
Copy link
Collaborator Author

nickdnk commented Dec 26, 2020

Sure thing. Do you want me to add the changes I made to get5_apistats? I made no changes to that plugin at all, but it's quite easy to add mvp, knife kills and utility damage to that as well.

// Because custom knives all have different names, we simply search the weapon string.
// StrContains returns the index and -1 if the string was not found.
// As all knives must *start with* 'knife', we can be sure that this must return 0 for all knives.
if (StrContains(weapon, "knife", true) == 0) {
Copy link
Collaborator Author

@nickdnk nickdnk Dec 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it turns out that all custom knives have different string values as well, so I replaced this with a StrContains(). I am going to assume that all knives start with knife, as I have limited knives available and that was the case for all of them. This does make sense as it indicates to the game which icon to show in the kill-feed, I just never thought of that. On this note; I did test that the T molotov and the CT firebomb grenade have the same value for utility damage - and they do. They're both called inferno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants