Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define KILL_LIMIT 50
new terrorist_kills, ct_kills
public plugin_init()
{
register_plugin("Restart On x Kills", "1.0", "Lee")
}
public client_death(killer, victim, wpnindex, hitplace, TK)
{
switch(cs_get_user_team(killer))
{
case CS_TEAM_T: terrorist_kills++
case CS_TEAM_CT: ct_kills++
}
if(terrorist_kills >= KILL_LIMIT || ct_kills >= KILL_LIMIT)
{
terrorist_kills = 0
ct_kills = 0
server_cmd("sv_restart 5")
}
}
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define KILL_LIMIT 50
new terrorist_kills, ct_kills
public plugin_init()
{
register_plugin("Restart On x Kills", "1.0", "Lee")
}
public client_death(killer, victim, wpnindex, hitplace, TK)
{
switch(cs_get_user_team(killer))
{
case CS_TEAM_T:
if(++terrorist_kills >= KILL_LIMIT)
{
kill_limit_reached()
client_print(0, print_chat, "The terrorist team have reached %d kills..", KILL_LIMIT)
}
case CS_TEAM_CT:
if(++ct_kills >= KILL_LIMIT)
{
kill_limit_reached()
client_print(0, print_chat, "Counter-Terrorists have reached %d kills..", KILL_LIMIT)
}
}
}
public kill_limit_reached()
{
terrorist_kills = 0
ct_kills = 0
server_cmd("sv_restart 5")
}