hi, i want to add red color to the chat message of this code (printtochatall and kickclient):
could you repost it with the correct code ?
PHP Code:
ConVar sm_teamkill_limit;
public void OnPluginStart()
{
sm_teamkill_limit = CreateConVar("sm_teamkill_limit", "3", "The limit before of team kill before kicking the player", FCVAR_NONE, true, 0.0);
HookEventEx("round_start", event);
HookEventEx("player_death", event);
HookEventEx("player_disconnect", event);
}
public void event(Event event, const char[] name, bool dontBroadcast)
{
static int teamkill_counts[MAXPLAYERS+1];
if(sm_teamkill_limit.IntValue <= 0) return;
if(StrEqual(name, "round_start"))
{
for(int x = 1; x <= MaxClients; x++)
{
teamkill_counts[x] = 0;
}
return;
}
if(StrEqual(name, "player_disconnect"))
{
teamkill_counts[GetClientOfUserId(event.GetInt("userid"))] = 0;
return;
}
int victim = GetClientOfUserId(event.GetInt("userid"));
int attacker = GetClientOfUserId(event.GetInt("attacker"));
if(!attacker || attacker == victim || GetClientTeam(attacker) != GetClientTeam(victim)) return;
teamkill_counts[attacker]++;
PrintToChatAll("%N TEAMKILLED %N (%i/%i).", attacker, victim, teamkill_counts[attacker], sm_teamkill_limit.IntValue);
if(teamkill_counts[attacker] >= sm_teamkill_limit.IntValue && !IsClientInKickQueue(attacker))
{
KickClient(attacker, "Kicked for reaching the TeamKill limit.");
}
}