Raised This Month: $ Target: $400
 0% 

[TF2] Removing Sandman stun effect


Post New Thread Reply   
 
Thread Tools Display Modes
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 03-25-2009 , 15:16   Re: [TF2] Removing Sandman stun effect
Reply With Quote #31

You should use 16384, otherwise you risk removing the slowdown effect from the scout's drink (this would only happen on scouts of course).

Code:
#define PLAYERCOND_BONKED                (1<<14) //16384 (blame Neph if it doesn't work)
#define PLAYERCOND_BONKEDORDRINKSLOWDOWN (1<<15) //32768
bl4nk is offline
DeviusCreed
Junior Member
Join Date: Dec 2006
Old 03-25-2009 , 15:51   Re: [TF2] Removing Sandman stun effect
Reply With Quote #32

EDIT: Nope, 16384 doesn't remove the stun at all. Only using 32768 will remove the stun. 32768 gets reported for scouts slowdown, and also the knockback effect.

Last edited by DeviusCreed; 03-25-2009 at 16:08.
DeviusCreed is offline
DeviusCreed
Junior Member
Join Date: Dec 2006
Old 03-25-2009 , 16:56   Re: [TF2] Removing Sandman stun effect
Reply With Quote #33

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
o0whiplash0o
Member
Join Date: Jun 2010
Old 12-11-2010 , 15:36   Re: [TF2] Removing Sandman stun effect
Reply With Quote #34

I'm aware of how old this topic is, but I've been looking for something of the sort and the previous poster's code seems to be exactly what I need. I've tried to set up a dev enviornment to build this code, but I get some strange assert() error whenever I include any non-sourcemod includes like dukehacks or sdkhooks. If someone has dukehacks already in their includes, could they build this for me? Extra bonus points if they can remove the damage done by the ball too (I'd love to have the source if you add this, should be as simple as setting the variable Float:damage to 0 in the hook) and/or remake this for sdkhooks!

Last edited by o0whiplash0o; 12-11-2010 at 15:39.
o0whiplash0o is offline
Kevin_b_er
SourceMod Donor
Join Date: Feb 2009
Old 12-11-2010 , 15:42   Re: [TF2] Removing Sandman stun effect
Reply With Quote #35

This thing is soooo old. Needless to say dukehacks is dead. The plugin would need to be ported to SDK Hooks in order to function.
__________________
Kevin_b_er is offline
o0whiplash0o
Member
Join Date: Jun 2010
Old 12-11-2010 , 15:44   Re: [TF2] Removing Sandman stun effect
Reply With Quote #36

I would give it a shot myself if I could actually compile the code... should be as easy as finding the identical hooks in sdkhooks (I'm sure that's what you meant to link to) and changing them.
o0whiplash0o is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 12-11-2010 , 15:58   Re: [TF2] Removing Sandman stun effect
Reply With Quote #37

why not change the damange type or change the damage type to null?
__________________
Master(d)



Master53 is offline
o0whiplash0o
Member
Join Date: Jun 2010
Old 12-12-2010 , 09:46   Re: [TF2] Removing Sandman stun effect
Reply With Quote #38

Quote:
Originally Posted by Master53 View Post
why not change the damange type or change the damage type to null?
How? Via scripting? I can't compile anything that uses sdkhooks, so I can't do that myself. By editing the ctx files? The one and only ctx decoder can't decode the sandman's ctx file (it just outputs gibberish).
o0whiplash0o is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 12-12-2010 , 11:10   Re: [TF2] Removing Sandman stun effect
Reply With Quote #39

Quote:
Originally Posted by o0whiplash0o View Post
I can't compile anything that uses sdkhooks
Then learn how include files work.

http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf

Page 123.
__________________
FaTony is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-12-2010 , 11:54   Re: [TF2] Removing Sandman stun effect
Reply With Quote #40

No need for dukehacks or sdkhooks

Code:
#include <sourcemod> #include <tf2_stocks> public OnPluginStart() {     HookEvent("player_hurt",  Event_PlayerHurt); } public Event_PlayerHurt(Handle:event,  const String:name[], bool:dontBroadcast) {     new victim = GetClientOfUserId(GetEventInt(event, "userid"));     if (victim == 0 || !IsClientInGame(victim))         return;         if (GetEventInt(event, "custom") == TF_CUSTOM_BASEBALL)     {         TF2_RemoveCondition(victim, TFCond_Bonked);     } }
psychonic is offline
Reply



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 21:16.


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