|
Veteran Member
Join Date: Jan 2015
Location: Cat
|
04-29-2019
, 21:46
Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
|
#4
|
Quote:
Originally Posted by Marttt
Lux, thanks for the feedback.
I tried to change the hook to SDKHook_OnTakeDamagePost, but it does not work well.
Spoiler
public void OnEntityCreated(int entity, const char[] classname)
{
if (StrEqual(classname, "tank_rock", false))
{
SDKHook(entity, SDKHook_OnTakeDamagePost, OnTakeDamagePost);
}
}
public Action OnTakeDamagePost(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
PrintToChatAll("victim (%i)", victim);
PrintToChatAll("attacker (%i)", attacker);
PrintToChatAll("inflictor (%i)", inflictor);
PrintToChatAll("damage (%f)", damage);
PrintToChatAll("damagetype (%i)", damagetype);
}
The " attacker" and " inflictor" parameters return an invalid value.
If anyone has the problem mentioned above, let me know.
|
An invalid attacker is normal can happen if the attackers change from prehook to post hook probs some plugin doing stuff maybe, but OnTakeDamagePost is usually reliable in all the use cases i'v done.
__________________
|
|
|
|