Raised This Month: $ Target: $400
 0% 

[L4D2] Event player_death and infected_death event headshot don't working,please help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
manhkst
Member
Join Date: May 2015
Location: Vietnammese
Old 08-16-2021 , 01:46   [L4D2] Event player_death and infected_death event headshot don't working,please help
Reply With Quote #1

As title i am having trouble checking headshot events don't working,please help. but if I use SDKHook_TraceAttack then hitgroup is still working properly, I need to check common death due to headshot. Can someone help me or ideas, thanks
__________________
FD ʚïɞ Team
Blog: http://fleeingdeath.blogspot.com/
manhkst is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 08-16-2021 , 06:54   Re: [L4D2] Event player_death and infected_death event headshot don't working,please
Reply With Quote #2

Would be nice to share some code so others can help you.

AFAIK the player_death event would be enough for that.

https://wiki.alliedmods.net/Left_4_d...s#player_death

You only need check if entityid != 0 and get the "headshot" event bool.
__________________
Marttt is offline
manhkst
Member
Join Date: May 2015
Location: Vietnammese
Old 08-16-2021 , 07:15   Re: [L4D2] Event player_death and infected_death event headshot don't working,please
Reply With Quote #3

Quote:
Originally Posted by Marttt View Post
Would be nice to share some code so others can help you.

AFAIK the player_death event would be enough for that.

https://wiki.alliedmods.net/Left_4_d...s#player_death

You only need check if entityid != 0 and get the "headshot" event bool.
you don't seem to understand what i mean, i tried to check even though i killed common headshot but get the "headshot" event bool always is false
__________________
FD ʚïɞ Team
Blog: http://fleeingdeath.blogspot.com/
manhkst is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 08-16-2021 , 14:11   Re: [L4D2] Event player_death and infected_death event headshot don't working,please
Reply With Quote #4

I understand but you should always share what "you have tried" and "not worked"

Just saying this so you can get faster assistance, tbh you that are asking for help so you should provide easier ways to people reproduce your issue.

Anyway, this is working for me, maybe you did something wrong at your end.

PHP Code:
public void OnPluginStart()
{
    
HookEvent("infected_death"Event_InfectedDeath);
}

public 
void Event_InfectedDeath(Event event, const char[] namebool dontBroadcast)
{
    
bool headshot event.GetBool("headshot");    
    
PrintToChatAll("headshot? %s"headshot "true" "false");

If this is not working for you then you may have some plugin preventing the headshot event on the infected.
Attached Files
File Type: sp Get Plugin or Get Source (infected_headshot.sp - 112 views - 290 Bytes)
__________________

Last edited by Marttt; 08-16-2021 at 14:41.
Marttt is offline
manhkst
Member
Join Date: May 2015
Location: Vietnammese
Old 08-17-2021 , 01:12   Re: [L4D2] Event player_death and infected_death event headshot don't working,please
Reply With Quote #5

Quote:
Originally Posted by Marttt View Post
I understand but you should always share what "you have tried" and "not worked"

Just saying this so you can get faster assistance, tbh you that are asking for help so you should provide easier ways to people reproduce your issue.

Anyway, this is working for me, maybe you did something wrong at your end.

PHP Code:
public void OnPluginStart()
{
    
HookEvent("infected_death"Event_InfectedDeath);
}

public 
void Event_InfectedDeath(Event event, const char[] namebool dontBroadcast)
{
    
bool headshot event.GetBool("headshot");    
    
PrintToChatAll("headshot? %s"headshot "true" "false");

If this is not working for you then you may have some plugin preventing the headshot event on the infected.
i'm very sorry i didn't provide the code and the way of talking is quite harsh while i need help from everyone. I tried your plugins but it seems to return false. As you said maybe I didn't test correctly there are some plugins that prevent headshot events on infected people. I will check it carefully. Anyway I thank you very much for this help, have a nice day
__________________
FD ʚïɞ Team
Blog: http://fleeingdeath.blogspot.com/
manhkst is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 08-17-2021 , 10:05   Re: [L4D2] Event player_death and infected_death event headshot don't working,please
Reply With Quote #6

The best way to test is removing all plugins, let just this one and check.

If still doesn't output "true" maybe is some workshop addon if you are running a local server.

If it works, then usually I do the trial and error by removing and adding half of plugins until I found the one with the issue.
__________________
Marttt is offline
manhkst
Member
Join Date: May 2015
Location: Vietnammese
Old 08-22-2021 , 15:42   Re: [L4D2] Event player_death and infected_death event headshot don't working,please
Reply With Quote #7

problem solved, thank you
__________________
FD ʚïɞ Team
Blog: http://fleeingdeath.blogspot.com/
manhkst is offline
Reply



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 12:45.


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