Raised This Month: $ Target: $400
 0% 

Player_hurt


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ScorpFire
Member
Join Date: Sep 2011
Old 06-28-2012 , 05:18   Player_hurt
Reply With Quote #1

Hi,

Was wondering does player_hurt (sdkhooks) gets hooked when a zombie infects a human?


Thanks
ScorpFire is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 06-28-2012 , 07:01   Re: Player_hurt
Reply With Quote #2

ZR use a combination of SDKHook_TraceAttack, SDKHook_OnTakeDamage and the player_hurt event. A damage module use SDKHooks to decide whether damage should be allowed. The infection module just listens for the player_hurt event. If that event is fired the damage was allowed.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
ScorpFire
Member
Join Date: Sep 2011
Old 06-28-2012 , 22:52   Re: Player_hurt
Reply With Quote #3

Well the problem is im writing a plugin to capture the infect.

So what i did was hook player_hurt and then check if attacker is zombie and victim is human. But however i realise whenever a zombie infects a human, the player_hurt function is not fired.
ScorpFire is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 06-29-2012 , 07:59   Re: Player_hurt
Reply With Quote #4

Grab the lastest ZR patch and go to addons\sourcemod\scripting\include in the zip file. There you have a small API for infection and respawn.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
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 11:01.


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