AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CS:GO] Trace attack not called on knife (https://forums.alliedmods.net/showthread.php?t=258489)

Pyro_ 02-20-2015 03:38

[CS:GO] Trace attack not called on knife
 
I have:
PHP Code:

for(new 1MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            
SDKHook(iSDKHook_TraceAttackOnTraceAttack);
        }
    } 

in event_start hook.

And
PHP Code:

public Action:OnTraceAttack(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotypehitboxhitgroup)
{
    if(
IsValidEntity(victim))
    {
        if(
shouldntgethit[victim])
        {
            
PrintToChat(victim"You were attacked");
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Continue;


And if you are shot, the chat message is displayed. But if you are knifed, it isn't and the attack isn't blocked.

NOTE: I am not after invincibility against knives, I want the knife to pass through the player, so if two players are in same place, (one that shouldn't get hit), then the one that should will get knifed

Is there a workaround?

ici 02-20-2015 03:58

Re: [CS:GO] Trace attack not called on knife
 
You should use OnTakeDamage instead.

psychonic 02-20-2015 09:20

Re: [CS:GO] Trace attack not called on knife
 
TraceAttack is only called for hitscan weapons, not melee nor projectile weapons.

Pyro_ 02-20-2015 09:25

Re: [CS:GO] Trace attack not called on knife
 
Quote:

Originally Posted by ici (Post 2264242)
You should use OnTakeDamage instead.

I don't think that will allow the knife to pass through

Quote:

Originally Posted by psychonic (Post 2264377)
TraceAttack is only called for hitscan weapons, not melee nor projectile weapons.

Hmm, thanks :). Is there an equivalent for melee?


All times are GMT -4. The time now is 06:38.

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