Raised This Month: $32 Target: $400
 8% 

[L4D][L4D2] Kills Manager (26 FEB 2020)


Post New Thread Reply   
 
Thread Tools Display Modes
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 02-04-2020 , 00:55   Re: [L4D][L4D2] Kills Manager (16 FEB 2019)
Reply With Quote #31

Why are you assigning an empty global Handle to another global Handle? You're not closing your global Handle properly. All you're doing is assigning empty garbage to it.

Also, you're creating an event without firing it. According to the API, you must close the Handle to the event by either firing or canceling it.

https://sm.alliedmods.net/new-api/events/CreateEvent
__________________
Psyk0tik is offline
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: Argentina
Old 02-05-2020 , 18:07   Re: [L4D][L4D2] Kills Manager (16 FEB 2019)
Reply With Quote #32

Quote:
Originally Posted by Crasher_3637 View Post
Why are you assigning an empty global Handle to another global Handle? You're not closing your global Handle properly. All you're doing is assigning empty garbage to it.

Also, you're creating an event without firing it. According to the API, you must close the Handle to the event by either firing or canceling it.

https://sm.alliedmods.net/new-api/events/CreateEvent
Will take a look, I've done this plugin the past year, I don't even remember what it is for lol
axelnieves2012 is offline
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: Argentina
Old 02-24-2020 , 13:04   Re: [L4D][L4D2] Kills Manager (16 FEB 2019)
Reply With Quote #33

Hello everybody. Thanks a lot for your reports. I've updated this plugin to new syntax, fixed bugs and removed unnecessary content. I will test it for some days and if everything is ok, will post it

Last edited by axelnieves2012; 02-24-2020 at 13:05.
axelnieves2012 is offline
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: Argentina
Old 02-26-2020 , 10:56   Re: [L4D][L4D2] Kills Manager (16 FEB 2019)
Reply With Quote #34

New version has been released. Check above link
axelnieves2012 is offline
Angerfist2188
New Member
Join Date: Jun 2020
Old 10-03-2020 , 02:27   Re: [L4D][L4D2] Kills Manager (26 FEB 2020)
Reply With Quote #35

Hello everyone! How fix this error?

L 10/03/2020 - 09:02:15: [SM] Exception reported: Client 4 is not connected
L 10/03/2020 - 09:02:15: [SM] Blaming: l4d_kills_manager.smx
L 10/03/2020 - 09:02:15: [SM] Call stack trace:
L 10/03/2020 - 09:02:15: [SM] [0] GetClientName
L 10/03/2020 - 09:02:15: [SM] [1] Line 338, C:\Users\Desktop\sm10\sourcemod-1.11.0-git6625-windows\addons\sourcemod\scripting\l4d_kills_ manager.sp::show_statisctics
L 10/03/2020 - 09:02:15: [SM] [2] Line 412, C:\Users\Desktop\sm10\sourcemod-1.11.0-git6625-windows\addons\sourcemod\scripting\l4d_kills_ manager.sp::event_player_death
Angerfist2188 is offline
Zheldorg
Junior Member
Join Date: Aug 2020
Old 03-02-2021 , 19:31   Re: [L4D][L4D2] Kills Manager (26 FEB 2020)
Reply With Quote #36

This version is only for Left 4 Dead 2, since I don't have the opportunity to test the work in l4d1, the support for it was cut out.
Removed unused and sorted the code, fixed the "[SM] [0] GetClientName" error in line 338 and made some changes, the plugin no longer uses fake events to store damage data, the ArrayList object is used instead; OnEntityCreated is not used for making the witch's damage hook, instead the hook for the "witch_spawn" event is used; the plugin also uses variables to store ConVars at startup and monitors changes in ConVars during execution, rather than constantly receiving them through the GetConVar function; cVar l4d_killsmgr_stats_enable no longer exists, instead l4d2_killsmgr_stats_show_type 0 to disable statistics output or l4d2_killsmgr_stats_show_type ... {1, 2, 3} as originally described; l4d_killsmgr_include_bosses_l4d2 is now just l4d2_killsmgr_include_bosses.
P.S. The color of the statistic text has been changed to be less fussy. It is still easy to understand that an infected has been killed and to see if someone has done damage without overlapping other chat notifications.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_kills_manager.sp - 228 views - 17.4 KB)

Last edited by Zheldorg; 03-03-2021 at 04:34. Reason: Editing the translation of a message
Zheldorg is offline
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: Argentina
Old 03-03-2021 , 23:16   Re: [L4D][L4D2] Kills Manager (26 FEB 2020)
Reply With Quote #37

Quote:
Originally Posted by Zheldorg View Post
This version is only for Left 4 Dead 2, since I don't have the opportunity to test the work in l4d1, the support for it was cut out.
Removed unused and sorted the code, fixed the "[SM] [0] GetClientName" error in line 338 and made some changes, the plugin no longer uses fake events to store damage data, the ArrayList object is used instead; OnEntityCreated is not used for making the witch's damage hook, instead the hook for the "witch_spawn" event is used; the plugin also uses variables to store ConVars at startup and monitors changes in ConVars during execution, rather than constantly receiving them through the GetConVar function; cVar l4d_killsmgr_stats_enable no longer exists, instead l4d2_killsmgr_stats_show_type 0 to disable statistics output or l4d2_killsmgr_stats_show_type ... {1, 2, 3} as originally described; l4d_killsmgr_include_bosses_l4d2 is now just l4d2_killsmgr_include_bosses.
P.S. The color of the statistic text has been changed to be less fussy. It is still easy to understand that an infected has been killed and to see if someone has done damage without overlapping other chat notifications.
Thanks for your work!! Congrats
axelnieves2012 is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 03-13-2021 , 22:31   Re: [L4D][L4D2] Kills Manager (26 FEB 2020)
Reply With Quote #38

Just as an idea, I think it would be better, than the death message of the game itself, instead of showing the murderer who did the most damage, it should show the 2 participants as murderers, something like this:

Player1, Player2 killed Hunter

Being Player1 the one who caused the most damage, and Player2 the one who managed to take the last kill shot, and as he is after Player1, that marks him as an assist.
Beatles is offline
Proaxel
Member
Join Date: Oct 2014
Old 03-16-2021 , 17:09   Re: [L4D][L4D2] Kills Manager (26 FEB 2020)
Reply With Quote #39

@Zheldorg It works great but there's one problem, when used with Custom Player Stats, it does properly give points to the person that did the most damage. However, if the person that did the most damage also killed the target with a headshot, the stats plugin never detects this, it always acts as if the target was killed normally even if it was a headshot. Can this be fixed?

Edit: I think I may have fixed it myself. I edited this part in player_death_event:
PHP Code:
            int new_killer sortDamagers(victim);
            
int org_killer GetClientOfUserId(event.GetInt("attacker"));
            if (
IsValidClientInGame(new_killer))
            {
                
char weaponname[32], attackerName[64];
                
int PropArray[2];
                
GetClientName(new_killerattackerNamesizeof(attackerName));
                
g_hBaseEventsPropArr[victim][new_killer].GetString(0weaponnamesizeof(weaponname));
                
g_hBaseEventsPropArr[victim][new_killer].GetArray(1PropArray2);
                
                
//Proaxel: attempted headshot fix. Force headshot to true if the killing blow was a headshot and the person that got the killing blow is the same person that did the most damage, 
                //if not then do it however the original author was doing it
                
bool topDmgHeadshot false;
                if(
event.GetBool("headshot") && IsValidClientInGame(org_killer) && org_killer == new_killer)
                    
topDmgHeadshot true;
                
                
//Modifying death event...
                
event.SetInt("attacker"GetClientUserId(new_killer));
                
event.SetString("attackername"attackerName);
                
event.SetInt("attackerentid"0);
                
event.SetString("weapon"weaponname);
                
//Proaxel: Determine Headshot from earlier
                
if(topDmgHeadshot)
                    
event.SetBool("headshot"true);
                else
                    
event.SetBool("headshot", (PropArray[c_mHitgroup] == 1)?true:false);
                
event.SetBool("attackerisbot"IsFakeClient(new_killer));
                
event.SetBool("abort"false);
                
event.SetInt("type"PropArray[c_mDamagetype]);

With this change the stats plugin correctly sees headshots now.
Attached Files
File Type: smx l4d2_kills_manager.smx (172.1 KB, 131 views)
File Type: sp Get Plugin or Get Source (l4d2_kills_manager.sp - 214 views - 18.1 KB)

Last edited by Proaxel; 03-28-2021 at 02:21.
Proaxel is offline
CosmicD
Senior Member
Join Date: Dec 2009
Location: Hasselt, Belgium
Old 04-10-2021 , 18:52   Re: [L4D][L4D2] Kills Manager (26 FEB 2020)
Reply With Quote #40

in l4d1 I notice that one user can do 6000 damage and another one 3000 (in expert 8000hp tanks), but the specials are mostly registering OK (total hp). I know that you can crown a 1117hp witch, but somehow the plugin only reports 1007..
__________________
CosmicD is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:34.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode