/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <csx>
#include <hamsandwich>
new kills[32]
public plugin_init()
{
register_plugin("Kills counter", "1.0", "Jelle")
RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
}
public fwHamPlayerSpawnPost(id)
{
if ( is_user_alive(id) )
{
new stats[8], bodyhits[8]
get_user_stats(id, stats, bodyhits)
stats[0] = kills[id]
name_stuff(id)
new rang[][] =
{ "Szar", "Pff", "Noob", "JĂł", "Ăśgyes", "Profi", "ShoOt", "FeeLenG.ShoOt" };
new szintek[9] =
{
10,
50,
100,
150,
200,
300,
500,
1000
};
new rangod = 0;
if(stats[0] > 10)
{
rangod = 0;
}else if(stats[0] > 50)
{
rangod = 1;
}else if(stats[0] > 100)
{
rangod = 2;
}else if(stats[0] > 150)
{
rangod = 3;
}else if(stats[0] > 200)
{
rangod = 4;
}else if(stats[0] > 300)
{
rangod = 5;
}else if(stats[0] > 500)
{
rangod = 6;
}else if(stats[0] > 1000)
{
rangod = 7;
}
client_print(id, print_chat, "Te %d ellenfelet olte'l meg, me'g %d kell a kovetkezo ranghoz, ami a(z) %s!", stats[0], szintek[rangod+1]-stats[0], rang[rangod+1]);
}
}
public client_infochanged(id)
{
new OldName[32], NewName[32]
get_user_name(id, OldName, 31)
get_user_info(id, "name", NewName, 31)
if ( equal(OldName, NewName) ) return
name_stuff(id)
}
name_stuff(id)
{
new Name[32]
get_user_name(id, Name, 31)
if ( kills[id] > 100 )
{
new prefix[] = "[Szar]"
new FullName[64]
formatex(FullName, charsmax(FullName), "%s %s", prefix, Name)
set_user_info(id, "name", FullName)
}
else if ( kills[id] > 200 )
{
new prefix[] = "[Pff]"
new FullName[64]
formatex(FullName, charsmax(FullName), "%s %s", prefix, Name)
set_user_info(id, "name", FullName)
}
else if ( kills[id] > 400 )
{
new prefix[] = "[Noob]"
new FullName[64]
formatex(FullName, charsmax(FullName), "%s %s", prefix, Name)
set_user_info(id, "name", FullName)
}
else if ( kills[id] > 700 )
{
new prefix[] = "[JĂł]"
new FullName[64]
formatex(FullName, charsmax(FullName), "%s %s", prefix, Name)
set_user_info(id, "name", FullName)
}
else if ( kills[id] > 800 )
{
new prefix[] = "[Ăśgyes]"
new FullName[64]
formatex(FullName, charsmax(FullName), "%s %s", prefix, Name)
set_user_info(id, "name", FullName)
}
else if ( kills[id] > 1000 )
{
new prefix[] = "[Profi]"
new FullName[64]
formatex(FullName, charsmax(FullName), "%s %s", prefix, Name)
set_user_info(id, "name", FullName)
}
else if ( kills[id] > 2000 )
{
new prefix[] = "[ShoOt]"
new FullName[64]
formatex(FullName, charsmax(FullName), "%s %s", prefix, Name)
set_user_info(id, "name", FullName)
}
else if ( kills[id] > 2400 )
{
new prefix[] = "[FeeLenG.ShoOt]"
new FullName[64]
formatex(FullName, charsmax(FullName), "%s %s", prefix, Name)
set_user_info(id, "name", FullName)
}
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
}
}