View Single Post
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-16-2017 , 18:43   Re: [TF2] Projectile Collision
Reply With Quote #5

Quote:
Originally Posted by Chaosxk View Post
I think SDKHooks should work.

Code:
public void OnEntityCreated(int entity, const char[] classname)
{
    if (StrContains(classname, "tf_projectile_"))
    {
        SDKHook(entity, SDKHook_Touch, Hook_Touch);
        //Forgot which touch hook to use, one of them gave me troubles
        //SDKHook(client, SDKHook_StartTouch, Hook_Touch);
    }
}

public void Hook_Touch(int entity, int other)
{
    char other_classname[32];
    GetEntityClassname(other, other_classname, sizeof(other_classname));
    
    if (StrContains(other_classname, "tf_projectile_"))
    {
        //do something
    }
}
Oh, so then I do know the answer somewhat! I had a brain fart when I made that first post and completely forgot to mention to use SDK Hooks to make the modification despite me having just released a plugin that modifies projectiles. I am a doofus sometimes.

But yeah, use the SDK code up there (because I use SDKHooks in my Enhanced Rockets plugin which changes the projectile model) and where it says "do something", that's where you would send the new collision data to the projectile.

Last edited by 404UserNotFound; 03-16-2017 at 18:47.
404UserNotFound is offline