Jump to content

Najlepszy gracz rundy


-_-
 Share

Recommended Posts

  • Root
Nazwa pluginu: Top rundy
Opis pluginu: Pokazuje na końcu rundy informacje o graczu z największą liczbą zabójstw, w tym HS oraz osobę, która zadała najwięcej obrażeń
Instalacja pluginu: Kompilacja pluginów i Instalacja
Cvary: Brak
Komendy:  Brak
Dodatkowe informacje: Jest to edycja tego pluginu  http://amxx.pl/topic/94288-najlepszy-gracz-rundy-say/
Link do pobrania: 
#include <amxmodx>
#include <colorchat>
#include <hamsandwich>

#define PLUGIN "BestPlayer"
#define VERSION "1.0"
#define AUTHOR "KaMaZZ & -_-"

new g_iKills[33]
new g_iDeaths[33]
new g_hs[33]
new Damage[33];

new bestplayer = 0, g_iMaxPlayers;

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_event("DeathMsg", "death_event", "a", "1>0");
	register_event("HLTV", "eHLTV", "a", "1=0", "2=0");
	register_logevent("wiadomosc",2,"1=Round_End")
	RegisterHam(Ham_TakeDamage, "player", "ForwardPlayerDmg", 1);
	g_iMaxPlayers = get_maxplayers();
}

public client_connect(id) 
{
	g_iKills[id] = 0
	g_iDeaths[id] = 0
}

public ForwardPlayerDmg(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits)
 {
	if(is_user_connected(iAttacker) && iAttacker != iVictim)
		Damage[iAttacker] += floatround(fDamage);

}

public death_event()
{
	new iKiller = read_data(1), iVictim = read_data(2), iHitplace = read_data(3);

	if (iKiller == iVictim)
	{
		g_iDeaths[iKiller]++;
		return;
	}

	g_iKills[iKiller]++;
	g_iDeaths[iVictim]++;

	if(iHitplace)
	{
		g_hs[iKiller]++;
	}
}

public wiadomosc() 
{ 
	if(get_playersnum() < 2)
		return
	
	for(new i=1; i <= g_iMaxPlayers; i++)
	{
		if (is_user_connected(i) && g_iKills[i] > g_iKills[bestplayer] || g_iKills[i] == g_iKills[bestplayer] && g_iDeaths[i] < g_iDeaths[bestplayer] || g_iKills[i] == g_iKills[bestplayer] && g_hs[i] > g_hs[bestplayer])
		{
			bestplayer = i;
		}
	}
	
	new name[32];
	get_user_name(bestplayer, name, 31);
	
	new iKills = g_iKills[bestplayer]
	new iHS = g_hs[bestplayer]
	
	ColorChat(0, GREEN,"*Cs-Classic* ^x01| ^x04Gracz rundy: ^x01%s", name)
	if(iKills >= 5 || iKills == 0)
	{
		ColorChat(0, GREEN, "*Cs-Classic* ^x01| ^x04Zdobyl ^x01%d^x04 Fragow", iKills)
	}
	else if(iKills > 1 && iKills < 5)
	{
		ColorChat(0, GREEN, "*Cs-Classic* ^x01| ^x04Zdobyl ^x01%d^x04 Fragi", iKills)
	}
	else if(iKills == 1)
	{
		ColorChat(0, GREEN, "*Cs-Classic* ^x01| ^x04Zdobyl Fraga")
	}
	ColorChat(0, GREEN, "*Cs-Classic* ^x01| ^x04Ustrzelil ^x01%d ^x04 HeadShotow", iHS)
	
	new bestdmg = 0, bestdmgid = 0;
	
	for(new i=1; i<= g_iMaxPlayers; i++)
	{
		if(is_user_connected(i) && Damage[i] > bestdmg)
		{
			bestdmg = Damage[i];
			bestdmgid = i;
		}
	}
	
	if(!bestdmgid)
		return;
	
	get_user_name(bestdmgid, name, 31);
	ColorChat(0, GREEN, "*Cs-Classic* ^x01| ^x04Najwiecej obrazen zadal ^x01%s ^x04(^x01%d ^x04obrazen!).", name, bestdmg);
}


public eHLTV()
{
	for( new i = 1 ; i <= g_iMaxPlayers ; i++ )
	{
		g_iKills[ i ] = 0;
		g_iDeaths[ i ] = 0;
		g_hs[ i ] = 0;
		Damage[i] = 0;
	}
}

 

Autor/Źródło: Jest to moja edycja tego pluginu http://amxx.pl/topic/94288-najlepszy-gracz-rundy-say/
  • Like 6
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site you agree to Privacy Policy