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

TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.


Post New Thread Reply   
 
Thread Tools Display Modes
nutz
Member
Join Date: Aug 2007
Location: vegas
Old 04-12-2008 , 14:27   Re: TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.
Reply With Quote #11

any update on removing the sniper killcam?
__________________
[702]Мąﻞסּř ИữŦz|TR
Forums @ www.rewindabiosis.net
TOOLL4D.nuclearfallout.net:27015
nutz is offline
arakcheev
Member
Join Date: Mar 2007
Old 05-04-2008 , 05:39   Re: TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.
Reply With Quote #12

Yeah, this sounds like something I'd really want to run!
arakcheev is offline
crazychicken
Senior Member
Join Date: Mar 2008
Old 05-29-2008 , 17:21   Re: TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.
Reply With Quote #13

i like this a lot however the kills arent listed in hlstatsx anymore either so no points are awarded
__________________
crazychicken is offline
Muridias
Member
Join Date: Feb 2008
Old 06-06-2008 , 14:46   Re: TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.
Reply With Quote #14

Code:
#include <sourcemod.inc>

public Plugin:myinfo =
{
    name = "SnipemanMod",
    author = "Snipeman ([email protected])",
    description = "Various TF2 gameplay tweaks.",
    version = "1.0.0.0",
    url = "http://www.sourcemod.net/"
};

new Handle:g_Cvar_hide_kills_knife    = INVALID_HANDLE
new Handle:g_Cvar_hide_kills_sapper    = INVALID_HANDLE

public OnPluginStart()
{
    HookEvent("player_death",        SnipemanMod_PlayerDeath,        EventHookMode_Pre)
    HookEvent("object_destroyed",    SnipemanMod_ObjectDestroyed,    EventHookMode_Pre)
    
    g_Cvar_hide_kills_knife        = CreateConVar( "sm_hide_kills_knife",  "1", "If 1, backstab kills will not show on the HUD." )
    g_Cvar_hide_kills_sapper    = CreateConVar( "sm_hide_kills_sapper", "1", "If 1, sapper kills (on buildings) will not show on the HUD." )
    
    AutoExecConfig( true, "plugin_snipeman")
}

public Action:SnipemanMod_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    if ( !GetConVarBool(g_Cvar_hide_kills_knife) )
    {
        return Plugin_Continue
    }
    
    new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
    new damagebits = GetEventInt(event, "damagebits");
    new customkill = GetEventInt(event, "customkill");
    new victim = GetClientOfUserId(GetEventInt(event, "userid"));
    
    decl String:weaponName[32];
    GetEventString(event, "weapon", weaponName, sizeof(weaponName));
    
    decl String:attackerName[32]
    GetClientName(attacker, attackerName, sizeof(attackerName));
    
    decl String:victimName[32]
    GetClientName(victim, victimName, sizeof(victimName));
    if (StrEqual(weaponName, "knife"))
    {
        if(damagebits == 1052802 && customkill == 2){
            PrintToChat(attacker, "You backstabbed %s", victimName);
            PrintToChat(victim, "You was backstabbed by %s", attackerName);
        }
        else if(damagebits == 4226 && customkill == 2)
        {
            PrintToChat(attacker, "You backstabbed %s", victimName);
            PrintToChat(victim, "You was backstabbed by %s", attackerName);
        }
        else
        {
            PrintToChat(attacker, "You knifed %s", victimName);
            PrintToChat(victim, "You was knifed by %s", attackerName);
        }
        return Plugin_Handled;
    }
    return Plugin_Continue
}

public Action:SnipemanMod_ObjectDestroyed(Handle:event, const String:name[], bool:dontBroadcast)
{
    if ( !GetConVarBool(g_Cvar_hide_kills_sapper) )
    {
        return Plugin_Continue
    }
    
    new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
    new victim = GetClientOfUserId(GetEventInt(event, "userid"));
    
    decl String:attackerName[32]
    GetClientName(attacker, attackerName, sizeof(attackerName));
    
    decl String:victimName[32]
    GetClientName(victim, victimName, sizeof(victimName));
    
    decl String:weaponName[32];
    GetEventString(event, "weapon", weaponName, sizeof(weaponName));
    
    new objectName = GetEventInt(event, "objecttype");
    
    if (StrEqual(weaponName, "obj_attachment_sapper"))
    {
        switch(objectName)
        {
            case 0:{
                PrintToChat(attacker, "You destroyed %s dispenser", victimName);
                PrintToChat(victim, "%s destroyed your dispenser", attackerName);
            }
            case 1:{
                PrintToChat(attacker, "You destroyed %s teleporter entrance", victimName);
                PrintToChat(victim, "%s destroyed your teleporter entrance", attackerName);
            }
            case 2:{
                PrintToChat(attacker, "You destroyed %s teleporter exit", victimName);
                PrintToChat(victim, "%s destroyed your teleporter exit", attackerName);
            }
            case 3:{
                PrintToChat(attacker, "You destroyed %s sentry gun", victimName);
                PrintToChat(victim, "%s destroyed your sentry gun", attackerName);
            }
        }
    } 
    return Plugin_Continue
}
I added chat notification for the spy and the victim.

Last edited by Muridias; 06-06-2008 at 21:17.
Muridias is offline
ummja
Senior Member
Join Date: Sep 2010
Old 12-26-2010 , 12:28   Re: TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.
Reply With Quote #15

I've been looking for a Plugin like this forever.

I always figured that VALVe should have done this by default for "Your Eternal Reward" but they didn't.

Makes spy WAY more sneaky.

Thanks for the time you invested in coding this OP.
ummja is offline
kemerover
Junior Member
Join Date: Aug 2011
Old 08-11-2011 , 18:40   Re: TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.
Reply With Quote #16

I've changed code a bit. Now it hides all kills and destroys.
PHP Code:
#include <sourcemod.inc>
 
public Plugin:myinfo =
{
    
name "offkillreporter",
    
author "Snipeman ([email protected])","kem ([email protected])"
    
description "Shutoff of killreporter",
    
version "1.0.0.0",
    
url "http://www.sourcemod.net/"
};
 
new 
Handle:g_Cvar_hide_kills    INVALID_HANDLE
new Handle:g_Cvar_hide_destroys    INVALID_HANDLE

public OnPluginStart()
{
    
HookEvent("player_death",        Shutoff_PlayerDeath,        EventHookMode_Pre)
    
HookEvent("object_destroyed",        Shutoff_ObjectDestroyed,    EventHookMode_Pre)

    
g_Cvar_hide_kills    CreateConVar"sm_hide_kills",  "1""If 1, backstab kills will 

not show on the HUD." 
)
    
g_Cvar_hide_destroys    CreateConVar"sm_hide_destroys""1""If 1, sapper kills (on 

buildings) will not show on the HUD." 
)

    
AutoExecConfigtrue"plugin_snipeman")
}

public 
Action:Shutoff_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    if ( !
GetConVarBool(g_Cvar_hide_kills) )
    {
        return 
Plugin_Continue
    
}
    
    return 
Plugin_Handled    
    
return Plugin_Continue
}

public 
Action:Shutoff_ObjectDestroyed(Handle:event, const String:name[], bool:dontBroadcast)
{
    if ( !
GetConVarBool(g_Cvar_hide_destroys) )
    {
        return 
Plugin_Continue
    
}

    return 
Plugin_Handled
    
return Plugin_Continue

kemerover is offline
Ges
New Member
Join Date: Aug 2021
Old 08-26-2021 , 02:40   Re: TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.
Reply With Quote #17

I know this is an ancient thread but both the original Snipeman mod and the Muridias variation crash the server upon backstab, and the most recent Kemerover version simply doesn't compile at all. Posting to say, as nobody has yet, that this is a waste of time to try and install currently, and must be updated. I think spy needs this kind of buff right now so will definitely try to figure it out but no ETA on that
Ges is offline
Teamkiller324
Senior Member
Join Date: Feb 2014
Location: Earth
Old 08-26-2021 , 04:18   Re: TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.
Reply With Quote #18

This should do the job but untested, updated the code to new syntax
Attached Files
File Type: sp Get Plugin or Get Source (SnipemanMod.sp - 94 views - 1.3 KB)
__________________

Last edited by Teamkiller324; 08-26-2021 at 04:25.
Teamkiller324 is offline
Ges
New Member
Join Date: Aug 2021
Old 08-30-2021 , 22:16   Re: TF2: SnipemanMod : No knife kills or sapper building kills show on HUD.
Reply With Quote #19

Quote:
Originally Posted by Teamkiller324 View Post
This should do the job but untested, updated the code to new syntax
It WORKS thank you so much
Ges 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 04:04.


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