Raised This Month: $ Target: $400
 0% 

[TF2] Removing Sandman stun effect


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DeviusCreed
Junior Member
Join Date: Dec 2006
Old 03-25-2009 , 16:56   Re: [TF2] Removing Sandman stun effect
Reply With Quote #26

This one requires DukeHacks, but I think it should work right. I confirmed that the previous code would turn off the slowdown if the scout was damaged during the slowdown period.

PHP Code:
#include <sourcemod>
#include <dukehacks>

new bool:Remove_Stun[MAXPLAYERS +1] = false;

public 
OnPluginStart()
{
    
HookEvent("player_hurt",  Event_PlayerHurt);
    
dhAddClientHook(CHK_TakeDamageTakeDamageHook);
}

public 
Action:Event_PlayerHurt(Handle:event,  const String:name[], bool:dontBroadcast)
{
    new 
target GetClientOfUserId(GetEventInt(event"userid"));
    new 
playerstate GetEntProp(targetProp_Send"m_nPlayerCond");
    if ((
playerstate 32768) != && Remove_Stun[target]){
        
Remove_Stun[target] = false;
        
SetEntProp(targetProp_Send"m_nPlayerCond", (playerstate & (~32768)));
    }
}

public 
Action:TakeDamageHook(clientattackerinflictorFloat:damage, &Float:multiplier)
{
    new 
String:weapon[32];
    
GetEntityNetClass(inflictorweaponsizeof(weapon));
    if(
StrEqual(weapon"CTFBat_Wood"))
        
Remove_Stun[client] = true;
    
    return 
Plugin_Continue;

DeviusCreed 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 18:13.


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