Код
#include <amxmodx>
#if AMXX_VERSION_NUM > 182
#error "Only for MaxModX 1.8.1"
#endif
new g_iKills[33], g_iHS[33], g_iDmg[33]
public plugin_init()
{
register_event("Damage", "EventDamage", "b", "2!0", "3=0", "4!0")
register_event("DeathMsg", "EventDeathMsg", "a")
register_logevent("EventRoundEnd", 2, "1=Round_End")
}
public EventDamage(victim)
{
new attacker = get_user_attacker(victim)
if(1 <= attacker < 33 && victim != attacker)
{
if(GetUserTeam(victim) != GetUserTeam(attacker)) g_iDmg[attacker] += read_data(2)
else g_iDmg[attacker] -= read_data(2)
}
}
public EventDeathMsg()
{
new killer = read_data(1)
new victim = read_data(2)
if(killer != victim && killer && GetUserTeam(killer) != GetUserTeam(victim))
{
g_iKills[killer]++
if(read_data(3)) g_iHS[killer]++
}
else g_iKills[killer]--
}
public EventRoundEnd()
{
new iKills, iDmg, iHS, iPlayer, szName[32]
for(new i = 1; i < 33; i++)
{
if(is_user_connected(i) && (g_iKills[i] > iKills || g_iDmg[i] > iDmg))
{
iKills = g_iKills[i]
iDmg = g_iDmg[i]
iHS = g_iHS[i]
iPlayer = i
}
g_iDmg[i] = 0
g_iHS[i] = 0
g_iKills[i] = 0
}
if(iPlayer)
{
get_user_name(iPlayer, szName, 31)
ColorChat("[^4Ultimatum^1] Лучший ^3Игрок ^1этого раунда: ^4%s", szName)
ColorChat("[^4Ultimatum^1] Убил ^3%i ^1и с них ^3%i ^1в голову", iKills, iHS)
}
}
GetUserTeam(index)
{
new szTeam[2]
get_user_team(index, szTeam, 1)
switch (szTeam[0])
{
case 'T': return 1
case 'C': return 2
}
return 0
}
ColorChat(const fmt[], any:...)
{
static iSayText; if (!iSayText)iSayText = get_user_msgid("SayText")
new szMessage[191]
vformat(szMessage, 190, fmt, 2)
message_begin(MSG_ALL, iSayText, _, 0);write_byte(0);write_byte(1);write_string(szMessage);message_end()
}