View Single Post
Markiez
Junior Member
Join Date: Mar 2018
Location: somewhere over the rainbow
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