#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <dhudmessage>
#include <cstrike>
#define PLUGIN "New Plugin"
#define AUTHOR "Unknown"
#define VERSION "1.0"
new g_iKills[32];
new top1, top2, top3;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "EventDeathMsg", "a")
register_logevent("RoundEnd", 2, "1=Round_End")
}
public client_disconnect(id)
{
g_iKills[id] = 0;
}
public EventDeathMsg()
{
new killer = read_data(1)
new victim = read_data(2)
if(killer != victim && killer && cs_get_user_team(killer) != cs_get_user_team(victim))
{
g_iKills[killer]++;
}
else
g_iKills[killer]--;
}
public RoundEnd()
{
new players[32], num;
get_players(players, num);
SortCustom1D(players, num, "sort_bestplayer")
top1 = players[0]
top2 = players[1]
top3 = players[2]
new top1neve[33], top2neve[33], top3neve[33];
get_user_name(top1, top1neve, charsmax(top1neve))
get_user_name(top2, top2neve, charsmax(top2neve))
get_user_name(top3, top3neve, charsmax(top3neve))
set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,0,6.0,12.0,0.1,0.2)
show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s^n2. %s^n3. %s", top1neve, top2neve, top3neve)
for(new i; i < 31; i++)
{
g_iKills[i] = 0;
}
}
public sort_bestplayer(id1, id2)
{
if(g_iKills[id1] > g_iKills[id2])
return -1;
else if(g_iKills[id1] < g_iKills[id2])
return 1;
return 0;
}