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

Solved [L4D2] Witch headshot


Post New Thread Reply   
 
Thread Tools Display Modes
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-21-2018 , 10:03   Re: [L4D2] Witch headshot
Reply With Quote #11

Quote:
Originally Posted by alcybery View Post
I get error "undefined symbol "SDKHook_TakeDamageAlive" on compilation.
Replace it with "SDKHook_TraceAttack"
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
alcybery
Member
Join Date: Apr 2016
Old 06-21-2018 , 10:43   Re: [L4D2] Witch headshot
Reply With Quote #12

Quote:
Originally Posted by eyal282 View Post
Replace it with "SDKHook_TraceAttack"
Thank you very much, works perfectly.
alcybery is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-21-2018 , 11:02   Re: [L4D2] Witch headshot
Reply With Quote #13

Quote:
Originally Posted by alcybery View Post
Thank you very much, works perfectly.
Change tags to "Solved" and post the working code in the main post please, after mentioning it's the working one.

Edit: Let me do it, here's the working code:

Code:
#pragma semicolon 1 

#include <sourcemod> 
#include <sdktools> 
#include <sdkhooks> 
#include <smlib> 

public OnEntityCreated(entity, const String:Classname[])
{
    if(StrEqual(Classname, "witch"))
    {
        SDKHook(entity, SDKHook_TraceAttack, Event_TraceAttack);
    }
}

public Action:Event_TraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup)
{

    if(hitgroup == 1)
    {
        damage += 300.0;
        return Plugin_Changed;
    }

    return Plugin_Continue;

}

stock bool:IsWitch(iEntity) 
{ 
    if(iEntity > 0 && IsValidEntity(iEntity) && IsValidEdict(iEntity)) 
    { 
        decl String:strClassName[64]; 
        GetEdictClassname(iEntity, strClassName, sizeof(strClassName)); 
        return StrEqual(strClassName, "witch"); 
    } 
    return false; 
}
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 06-21-2018 at 11:03.
eyal282 is offline
Reply


Thread Tools
Display Modes

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:37.


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