#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))
if(num == 1)
{
set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,1,6.0,12.0,0.1,0.2)
show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s |%d Ölés", top1neve, g_iKills[top1])
}
else if(num == 2)
{
set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,1,6.0,12.0,0.1,0.2)
show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s |%d Ölés^n2. %s |%d Ölés", top1neve, g_iKills[top1], top2neve, g_iKills[top2])
}
else if(num >= 3)
{
set_dhudmessage(random(256), random(256), random(256), 0.29, 0.42,1,6.0,12.0,0.1,0.2)
show_dhudmessage(0, "Ebben a Körben a Legjobb játékosok:^n1. %s |%d Ölés^n2. %s |%d Ölés^n3. %s |%d Ölés", top1neve, g_iKills[top1], top2neve, g_iKills[top2],top3neve, g_iKills[top3])
}
client_print(0, print_chat, "")
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;
}
stock print_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "á", "á")
replace_all(msg, 190, "é", "Ă©")
replace_all(msg, 190, "í", "Ă")
replace_all(msg, 190, "ó", "Ăł")
replace_all(msg, 190, "ö", "ö")
replace_all(msg, 190, "ő", "Ĺ‘")
replace_all(msg, 190, "ú", "Ăş")
replace_all(msg, 190, "ü", "ĂĽ")
replace_all(msg, 190, "ű", "ű")
replace_all(msg, 190, "Á", "Ă")
replace_all(msg, 190, "É", "É")
replace_all(msg, 190, "Í", "ĂŤ")
replace_all(msg, 190, "Ó", "Ă“")
replace_all(msg, 190, "Ö", "Ă–")
replace_all(msg, 190, "Ő", "Ĺ")
replace_all(msg, 190, "Ú", "Ăš")
replace_all(msg, 190, "Ü", "Ăś")
replace_all(msg, 190, "Ű", "Ĺ°")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
}
return PLUGIN_HANDLED
}