PDA

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


Snipeman
02-25-2008, 01:22
This simple mod removes HUD notification for kills made with the Spy's knife, and when buildings are destroyed by sappers.

Cvars:

sm_hide_kills_knife 1
sm_hide_kills_sapper 1

Future plans:

No death cam when killed by a spy, or by a sniper's rifle. Also anything else I feel will make the game more interesting.

DontWannaName
02-25-2008, 01:27
can you post screenshots?

Snipeman
02-25-2008, 01:29
I'm not sure what you're asking for exactly. You want a screenshot of something not being displayed?

pRED*
02-25-2008, 01:47
Yes.

I think it would go nicely with this screenshot of nothing (http://ftp.pcworld.com/pub/screencams/control-shot1.jpg).

Nice plugin.

#include assumes .inc by default but I guess theres no harm in having it there.

Approved.

bl4nk
02-25-2008, 02:14
I'm just curious.. What's the reason behind this plugin?

DontWannaName
02-25-2008, 02:30
Thats why I wanted a screenshot. To see the removed HUD and to know what it really does. I understand the 2nd part to not give out who the spy is and where the sniper is but not the first part. Pred, that screenshot has little tiny dots of something lol.

Snipeman
02-25-2008, 05:12
Right now it just removes the kill spam in the upper-right corner for knife kills and sappers killing buildings. The reasoning behind this is that when a spy is behind enemy lines doing his stealthy thing, announcing where he is and what he's doing to the whole server via killspam is not cool, in my opinion.

If it's possible I might add the HUD notification back for just the attacker/victim. This first version was just what I whipped up in a few minutes, having never used Pawn or made a server modification before. After work I'll look into doing some more complicated stuff with the SDK calls and whatnot. Hope my tinkering here proves useful to somebody.

bl4nk
02-25-2008, 10:43
I guess I can understand the spy part of the plugin, but I still don't get the sniper part.

Snipeman
02-25-2008, 12:54
I guess I can understand the spy part of the plugin, but I still don't get the sniper part.

The sniper part of the plugin hasn't been implemented yet.

Back in the glory days of Team Fortress and Team Fortress Classic, snipers would spend a lot of time in front of or inside the enemy base shootin' dudes as they left. This is not currently viable as the killcam reveals the sniper's exact location to his victim. When the victim respawns he knows exactly where the sniper is and will hunt him down.

A major part of Team Fortress gameplay used to be growing more experienced and familiar with the maps, predicting where your enemies would be, and hunting them down. Removing the killcam in some of these instances will hopefully bring that dimension back to the game.

Got a couple late nights at work this week since there's a milestone deadline on Wednesday. Not sure when I'll be able to add the new features but I'll get to it when I can.

ThatGuy
02-25-2008, 17:26
Looking forward to the sniper killcam!

nutz
04-12-2008, 14:27
any update on removing the sniper killcam?

arakcheev
05-04-2008, 05:39
Yeah, this sounds like something I'd really want to run!

crazychicken
05-29-2008, 17:21
i like this a lot however the kills arent listed in hlstatsx anymore either so no points are awarded

Muridias
06-06-2008, 14:46
#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:eve nt, 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.

ummja
12-26-2010, 12:28
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.

kemerover
08-11-2011, 18:40
I've changed code a bit. Now it hides all kills and destroys.
#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." )

AutoExecConfig( true, "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
}

Ges
08-26-2021, 02:40
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

Teamkiller324
08-26-2021, 04:18
This should do the job but untested, updated the code to new syntax

Ges
08-30-2021, 22:16
This should do the job but untested, updated the code to new syntax

It WORKS thank you so much