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

Best plugin to handle teamkillers?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obyboby
Veteran Member
Join Date: Sep 2013
Old 05-02-2018 , 10:55   Best plugin to handle teamkillers?
Reply With Quote #1

Hi guys.
I need to solve a big issue on my server: I still don't have an effective way to stop teamkillers.
What's the best plugin to ban them?
Best would be to have some sort of option to set the maximum amount of teamkills allowed in a time span, after which an action is taken. (kick, ban, etc)
Can someone recommend a plugin for that?
I am aware of the stock CSGO settings but they don't seem to work for me.
__________________
Obyboby is offline
Markiez
Junior Member
Join Date: Mar 2018
Location: somewhere over the rainb
Old 05-02-2018 , 12:23   Re: Best plugin to handle teamkillers?
Reply With Quote #2

There's a command for it. Google tk punish and you will find what ur looking for.
Markiez is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 05-02-2018 , 12:40   Re: Best plugin to handle teamkillers?
Reply With Quote #3

Quote:
Originally Posted by Markiez View Post
There's a command for it. Google tk punish and you will find what ur looking for.
mp_tkpunish

Will punish the offender at the beginning of the following round. I need immediate action
__________________
Obyboby is offline
Markiez
Junior Member
Join Date: Mar 2018
Location: somewhere over the rainb
Old 05-06-2018 , 09:41   Re: Best plugin to handle teamkillers?
Reply With Quote #4

Quote:
Originally Posted by Obyboby View Post
mp_tkpunish

Will punish the offender at the beginning of the following round. I need immediate action
Code:
#include <sourcemod>
#include <cstrike>

#pragma semicolon 1

public void OnPluginStart() 
{
	HookEvent("player_death", Event_PlayerDeath);
}

public Action Event_PlayerDeath(Event event, const char[] name, bool dbc)
{
	int victim = GetClientOfUserId(GetEventInt(event, "userid"));
	int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
	
	new client = victim + attacker;
	if (GetClientTeam(client) == CS_TEAM_CT)
	{
		ServerCommand("sm_ban %d 30", attacker);
	}
	
	else if (GetClientTeam(client) == CS_TEAM_T)
	{
		ServerCommand("sm_ban %d 30", attacker);
	}
}
I dunno bro, I'm not that knowledgeable, try this though.
Markiez is offline
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 05-06-2018 , 17:42   Re: Best plugin to handle teamkillers?
Reply With Quote #5

Quote:
Originally Posted by Markiez View Post
Code:
#include <sourcemod>
#include <cstrike>

#pragma semicolon 1

public void OnPluginStart() 
{
	HookEvent("player_death", Event_PlayerDeath);
}

public Action Event_PlayerDeath(Event event, const char[] name, bool dbc)
{
	int victim = GetClientOfUserId(GetEventInt(event, "userid"));
	int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
	
	new client = victim + attacker;
	if (GetClientTeam(client) == CS_TEAM_CT)
	{
		ServerCommand("sm_ban %d 30", attacker);
	}
	
	else if (GetClientTeam(client) == CS_TEAM_T)
	{
		ServerCommand("sm_ban %d 30", attacker);
	}
}
I dunno bro, I'm not that knowledgeable, try this though.
why are you adding victim + attacker?
Addicted. is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 05-07-2018 , 12:44   Re: Best plugin to handle teamkillers?
Reply With Quote #6

Quote:
Originally Posted by Addicted. View Post
why are you adding victim + attacker?
I was about to ask the same thing. My best guess is that he thought adding them would turn it into a single index (both clients combined into one) if you understand what I mean by that.
ThatKidWhoGames is offline
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 05-08-2018 , 21:15   Re: Best plugin to handle teamkillers?
Reply With Quote #7

Quote:
Originally Posted by Markiez View Post
Spoiler
Just check if GetClientTeam(victim) == GetClientTeam(attacker). Also, you need to check to make sure victim != attacker, else it will ban someone that suicides.

As far as the ban, I dont believe you can ban a client index like that. If you run the cmd with no parameters, it returns this:
Usage: sm_ban <#userid|name> <time|0> [reason]

So, you would need to use the userid (with # before it), else the name (or a unique part of it). Using the name allows for cmd injection (dangerous when server is executing the cmd), so use the userid. Additionally, make sure it isnt a bot, and I believe you need sdkhooks for the client death hook.

Spoiler


All that aside, I dont think instant ban on first offense is a good tactic for combatting TKs. I'd recommend some kind of warning system, else one bad shot or one stupid teammate = ban. Just things to consider.
__________________

Last edited by ThatOneGuy; 05-08-2018 at 21:21. Reason: Added spoilers
ThatOneGuy is offline
cristi_ip
Senior Member
Join Date: Dec 2010
Location: Bucharest
Old 05-09-2018 , 04:23   Re: Best plugin to handle teamkillers?
Reply With Quote #8

Quote:
Originally Posted by Obyboby View Post
Hi guys.
I need to solve a big issue on my server: I still don't have an effective way to stop teamkillers.
What's the best plugin to ban them?.
Try these plugins:

https://github.com/ZachPerkitny/csgo-tk-punish or damage reflect https://forums.alliedmods.net/showthread.php?t=237011
cristi_ip is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 05-09-2018 , 08:06   Re: Best plugin to handle teamkillers?
Reply With Quote #9

Quote:
Originally Posted by ThatOneGuy View Post
All that aside, I dont think instant ban on first offense is a good tactic for combatting TKs. I'd recommend some kind of warning system, else one bad shot or one stupid teammate = ban. Just things to consider.
Yeah I agree, need some sort of warning or at least the action has to be taken after a few hits, not after the first hit.
Well actually I do have spawn protection so if someone were to accidentally stab/shoot their team mate, they would have plenty of time to realize. If they keep going, then action can be taken.
A warning sound or a slap with no damage could be enough, followed by a slap with damage, damage reflection, slay, kick, ban, or whatever.
Could be that the first infraction is a damage reflection, if the offense is repeated the next punishment could be an instant slay, then kick, then ban.
Being able to configure the actions to be taken would be awesome.


Quote:
Originally Posted by cristi_ip View Post
I might have already tried those but sure, I will definitely take a look. Thanks

EDIT: No it's the first time I see those. They are both very interesting actually, and could be the solution I want.
Just wondering if csgo-tk-punish applies the punishment during the round where the tk occured, or if they are applied at the beginning of the following round? In the latter case, some players could have plenty of time to leave the server and go unpunished. Which sucks.
Damage reflection is really cool, I might try that tonight. I guess it also means that if the team attacker ends up killing the team mate, the same happens to them?
Gotta check if there is a timer in which this action is applied, wouldn't be really cool if someone accidentally killed their team mate at half the round and have to be punished for an obvious mistake, if you know what I mean.
I'll read the source code right now and see if I can figure that out myself
__________________

Last edited by Obyboby; 05-09-2018 at 08:11.
Obyboby is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 05-09-2018 , 10:54   Re: Best plugin to handle teamkillers?
Reply With Quote #10

you can try my plugin
but you will need translator
Attached Files
File Type: sp Get Plugin or Get Source (antiteamkillcsgo.sp - 124 views - 6.7 KB)
File Type: inc csgo_colors.inc (5.0 KB, 88 views)

Last edited by Indarello; 05-09-2018 at 10:56.
Indarello 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 10:11.


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