Raised This Month: $51 Target: $400
 12% 

SDKHooks_TakeDamage not calling OnTakeDamage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xSquared
Junior Member
Join Date: Jan 2019
Old 09-11-2021 , 01:26   SDKHooks_TakeDamage not calling OnTakeDamage
Reply With Quote #1

Hi. I've recently got back into sourcemod plugins relating to TF2, and was wondering how to force TakeDamage to call OnTakeDamage, or call OnTakeDamage. For reference, I am creating custom attributes for the CustomWeapons3 plugin; the attribute I'm working on damages targets around the initial victim, and I would like for it to be able to chain between victims indefinitely.

My current code for the attribute is as follows:
PHP Code:
if (ds_radius[attacker][weapon] != 0)
    {
        for (new 
potvictim 1potvictim <= MaxClientspotvictim++)
        {
            if (!
IsClientInGame(potvictim)) continue;
            if (!
IsPlayerAlive(potvictim)) continue;
            if (
GetClientTeam(potvictim) == GetClientTeam(attacker)) continue;
            
            new 
Float:pos1[3];
            
GetClientAbsOrigin(victimpos1);
            
            new 
Float:pos2[3];
            
GetClientAbsOrigin(potvictimpos2);
            
            if(
GetVectorDistance(pos1pos2) <= ds_radius[attacker][weapon])
            {
                if(
IsValidEntity(inflictor)) SDKHooks_TakeDamage(potvictiminflictorattackerdamage ds_percentspread[attacker][weapon], damagetypeweapondamageForcepos2);
            }
        }
    } 
__________________
xSquared/Silver's Custom Attributes:https://forums.alliedmods.net/showth...02#post2663402
xSquared is offline
 



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 22:52.


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