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

Missing damagetype with OnTakeDamage/TraceAttack?!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
El Curioso
Member
Join Date: Nov 2013
Location: Spain
Old 11-09-2020 , 15:37   Missing damagetype with OnTakeDamage/TraceAttack?!
Reply With Quote #1

Tried to figure out the damagetype of weapon_molotov and weapon_incgrenade in CSGO.
Something like DMG_BURN would have been my first guess, but there is no damagetype-output at all.

Any ideas, why?


Tried to get an output with:

PHP Code:
#include <sdkhooks>
#include <sdktools>


public OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_TraceAttackTraceAttack);
    
SDKHook(clientSDKHook_TraceAttackOnTakeDamage);
}

public 
OnClientDisconnect(client
{
    
SDKUnhook(clientSDKHook_TraceAttackTraceAttack);
    
SDKHook(clientSDKHook_TraceAttackOnTakeDamage);
}

public 
Action TraceAttack(int victimint &attackerint &inflictorfloat &damageint &damagetypeint &ammotypeint hitboxint hitgroup)
{
    
PrintToServer ("[TEST-TraceAttack]: damagetype-value is: %i",damagetype);
}

public 
Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    
PrintToServer ("[TEST-OnTakeDamage]: damagetype-value is: %i",damagetype);

El Curioso is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 11-10-2020 , 14:40   Re: Missing damagetype with OnTakeDamage/TraceAttack?!
Reply With Quote #2

Quote:
Originally Posted by El Curioso View Post
PHP Code:
    SDKHook(clientSDKHook_TraceAttackOnTakeDamage); 
You used the wrong hook type for OnTakeDamage. You also don't need to unhook when the client disconnects, SDK Hooks takes care of it.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
El Curioso
Member
Join Date: Nov 2013
Location: Spain
Old 11-10-2020 , 17:29   Re: Missing damagetype with OnTakeDamage/TraceAttack?!
Reply With Quote #3

Quote:
Originally Posted by DJ Tsunami View Post
You used the wrong hook type for OnTakeDamage. You also don't need to unhook when the client disconnects, SDK Hooks takes care of it.
Right. Thank you so much

OnTakeDamage works just fine now. Output is as it should be: 8 (DMG_BURN ).


TraceAttack won't work with the damagetype DMG_BURN . Don't know why, but it is what it is. ¯\_(ツ)_/¯
El Curioso is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 11-11-2020 , 09:00   Re: Missing damagetype with OnTakeDamage/TraceAttack?!
Reply With Quote #4

Would assume that TraceAttack is only called for weapons that fire traces (hence its name) since fire doesn't shoot traces TraceAttack won't be called.
xerox8521 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 15:34.


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