sm_antitk_max 3
sm_antitk_type 2
sm_antitk_ban_time 60
Просто я юзаю другой плагины для наказания тим килов, только там нет кика и бана, нужно чтоб некоторые люди сидя в бане подумали о своем поведении.KapaT, Anti-TK Manager у меня сделан через этот плагин, но думаю тебе можно сделать из этого облегчённый вариант плагина.
#include <sourcemod>
// Количество убийств товарищей
#define TEAM_KILL 3
// Причина бана
#define REASON "TeamKill"
// Время бана
#define TIME 60
new TeamKill[MAXPLAYERS + 1] = 0;
public OnPluginStart()
{
HookEvent("player_death", Event_OnPlayerDeath);
}
public OnClientPutInServer(client)
{
if (TeamKill[client] != 0)
{
TeamKill[client] = 0;
}
}
public Event_OnPlayerDeath(Handle:event, const String:name[], bool:silent)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if (attacker > 0)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client > 0)
{
if (attacker != client)
{
if (GetClientTeam(attacker) == GetClientTeam(client))
{
if (++TeamKill[attecker] >= TEAM_KILL)
{
BanClient(attacker, TIME, BANFLAG_AUTO, REASON, REASON, "TK BAN");
}
}
}
}
}
}
TEST
PHP:#include <sourcemod> // Количество убийств товарищей #define TEAM_KILL 3 // Причина бана #define REASON "TeamKill" // Время бана #define TIME 60 new TeamKill[MAXPLAYERS + 1] = 0; public OnPluginStart() { HookEvent("player_death", Event_OnPlayerDeath); } public OnClientPutInServer(client) { if (TeamKill[client] != 0) { TeamKill[client] = 0; } } public Event_OnPlayerDeath(Handle:event, const String:name[], bool:silent) { new attacker = GetClientOfUserId(GetEventInt(event, "attacker")); if (attacker > 0) { new client = GetClientOfUserId(GetEventInt(event, "userid")); if (client > 0) { if (attacker != client) { if (GetClientTeam(attacker) == GetClientTeam(client)) { if (++TeamKill[client] >= TEAM_KILL) { BanClient(client, TIME, BANFLAG_AUTO, REASON, REASON, "TK BAN"); } } } } } }
А можно еще СБ прикрутить?Damage Taken from "bob_marley" - 135 in 3 hits
HooLIGUN : еще
bob_marley attacked a teammate
bob_marley killed HooLIGUN with m4a1.
Scoring will not start until both teams have players
Player: HooLIGUN - Damage Taken
-------------------------
Damage Taken from "bob_marley" - 135 in 3 hits
Disconnect: TeamKill.
Disconnect: TeamKill.
Щас тестил,меня 3 раза убили и плагин забанил меня,а не атакующего
А можно еще СБ прикрутить?
#include <sourcemod>
#include <sourcebans>
// Количество убийств товарищей
#define TEAM_KILL 3
// Причина бана
#define REASON "TeamKill"
// Время бана
#define TIME 60
new bool:SourceBans = false;
new TeamKill[MAXPLAYERS + 1] = 0;
public OnPluginStart()
{
HookEvent("player_death", Event_OnPlayerDeath);
}
public OnAllPluginsLoaded()
{
if (LibraryExists("sourcebans"))
{
if (!SourceBans)
{
SourceBans = !SourceBans;
}
}
}
public OnLibraryAdded(const String:name[])
{
if (strcmp(name, "sourcebans", false) == 0)
{
if (!SourceBans)
{
SourceBans = !SourceBans;
}
}
}
public OnLibraryRemoved(const String:name[])
{
if (strcmp(name, "sourcebans", false) == 0)
{
if (SourceBans)
{
SourceBans = !SourceBans;
}
}
}
public OnClientPutInServer(client)
{
if (TeamKill[client] != 0)
{
TeamKill[client] = 0;
}
}
public Event_OnPlayerDeath(Handle:event, const String:name[], bool:silent)
{
new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
if (attacker > 0)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client > 0)
{
if (attacker != client)
{
if (GetClientTeam(attacker) == GetClientTeam(client))
{
if (++TeamKill[attacker] >= TEAM_KILL)
{
if (SourceBans)
{
SBBanPlayer(0, attacker, TIME, REASON);
}
else
{
BanClient(attacker, TIME, BANFLAG_AUTO, REASON, REASON, "TK BAN");
}
}
}
}
}
}
}
L 07/16/2013 - 15:57:54: [SM] Unable to load plugin "antitk.smx": Could not find required plugin "SourceBans"Исправил.
На счет СБ, посмотрим
Добавлено через 11 минут
ПробуйPHP:#include <sourcemod> #include <sourcebans> // Количество убийств товарищей #define TEAM_KILL 3 // Причина бана #define REASON "TeamKill" // Время бана #define TIME 60 new bool:SourceBans = false; new TeamKill[MAXPLAYERS + 1] = 0; public OnPluginStart() { HookEvent("player_death", Event_OnPlayerDeath); } public OnAllPluginsLoaded() { if (LibraryExists("sourcebans")) { if (!SourceBans) { SourceBans = !SourceBans; } } } public OnLibraryAdded(const String:name[]) { if (strcmp(name, "sourcebans", false) == 0) { if (!SourceBans) { SourceBans = !SourceBans; } } } public OnLibraryRemoved(const String:name[]) { if (strcmp(name, "sourcebans", false) == 0) { if (SourceBans) { SourceBans = !SourceBans; } } } public OnClientPutInServer(client) { if (TeamKill[client] != 0) { TeamKill[client] = 0; } } public Event_OnPlayerDeath(Handle:event, const String:name[], bool:silent) { new attacker = GetClientOfUserId(GetEventInt(event, "attacker")); if (attacker > 0) { new client = GetClientOfUserId(GetEventInt(event, "userid")); if (client > 0) { if (attacker != client) { if (GetClientTeam(attacker) == GetClientTeam(client)) { if (++TeamKill[attacker] >= TEAM_KILL) { if (SourceBans) { SBBanPlayer(0, attacker, TIME, REASON); } else { BanClient(attacker, TIME, BANFLAG_AUTO, REASON, REASON, "TK BAN"); } } } } } } }