Hey guys, I registered an event, that it'll hopefully work, that like the title says, if you TK twice you get banned for 1 minute, for some reason it doesnt work, maybe the register i did is not correct since im not familliar with it:
PHP Code:
/* Global */
new g_LeftKills[11] // It is set to 2 when a client connects, look at public client_connect()
new bool:g_IsStarted // When a match starts it is set to true, trust me it works cuz i tested it.
/* Global */
public plugin_init()
{
register_event("DeathMsg", "tk", "b")
}
public client_connect(id)
{
g_LeftKills[id] = 2
}
public tk()
{
new killer = read_data(1)
new victim = read_data(2)
if (g_IsStarted)
{
if ((cs_get_user_team(killer) == cs_get_user_team(victim)))
{
if (g_LeftKills[killer] == 2)
{
client_print(killer, print_chat, "%s Warning! DO NOT Team-Kill, 1 more TK and you will be banned.", PREFIX)
client_print(killer, print_chat, "%s Warning! DO NOT Team-Kill, 1 more TK and you will be banned.", PREFIX)
g_LeftKills[killer]--
}
else if (g_LeftKills[killer] == 1)
{
server_cmd("amx_ban #%d 60 Team-Kills are not allowed!", get_user_userid(killer))
}
}
}
}