Page 1 of 1

Cerere Plugin new_round_stats

Posted: 25 Sep 2010, 22:58
by Andre
Salut poate cineva sa imi dea acest plugin,"new_round_stats"l-am gasit pe net dar nu merge pagina de download

Re: Cerere Plugin new_round_stats

Posted: 25 Sep 2010, 23:07
by b[L]u
ia vezi
| Afiseaza codul
#include <amxmodx>

#include <amxmisc>



#define PLUGIN "Round Stats"

#define VERSION "1.0"

#define AUTHOR "Alka"



#define MAXSLOTS 32



enum Color {

        

        YELLOW = 1,

        GREEN, 

        TEAM_COLOR,

        GREY,

        RED, 

        BLUE

}



new TeamName[][] = {

        

        "",

        "TERRORIST",

        "CT",

        "SPECTATOR"

}



new bool:IsConnected[MAXSLOTS + 1];

new count_rounds = 0;

new const g_server_name[] = ""

new TeamInfo;

new SayText;

new MaxSlots;



public plugin_init() {

        

        register_plugin(PLUGIN, VERSION, AUTHOR)

        register_logevent("_round_start", 2, "1=Round_Start")

        

        TeamInfo = get_user_msgid("TeamInfo");

        SayText = get_user_msgid("SayText");

        MaxSlots = get_maxplayers();

}



public _round_start()

{

        new mapname[32]

        new players[32], num

        

        get_players(players, num)

        get_mapname(mapname,31)

        

        count_rounds ++

        

        ColorChat(0, GREEN,"^x01-<[ Round: ^x04%d^x01 begins in ^x04%s ^x01]>---<[ ^x04%s ^x01]>---<[^x04%d^x01]>-",count_rounds,g_server_name,mapname,num)

}



public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:.)

{

        static message[256];



        switch(type)

        {

                case YELLOW:

                {

                        message[0] = 0x01;

                }

                case GREEN:

                {

                        message[0] = 0x04;

                }

                default:

                {

                        message[0] = 0x03;

                }

        }



        vformat(message[1], 251, msg, 4);



        message[192] = '^0';



        new team, ColorChange, index, MSG_Type;

        

        if(!id)

        {

                index = FindPlayer();

                MSG_Type = MSG_ALL;

        

        } else {

                MSG_Type = MSG_ONE;

                index = id;

        }

        

        team = get_user_team(index);    

        ColorChange = ColorSelection(index, MSG_Type, type);



        ShowColorMessage(index, MSG_Type, message);

                

        if(ColorChange)

        {

                Team_Info(index, MSG_Type, TeamName[team]);

        }

}



ShowColorMessage(id, type, message[])

{

        message_begin(type, SayText, _, id);

        write_byte(id)          

        write_string(message);

        message_end();  

}



Team_Info(id, type, team[])

{

        message_begin(type, TeamInfo, _, id);

        write_byte(id);

        write_string(team);

        message_end();



        return 1;

}



ColorSelection(index, type, Color:Type)

{

        switch(Type)

        {

                case RED:

                {

                        return Team_Info(index, type, TeamName[1]);

                }

                case BLUE:

                {

                        return Team_Info(index, type, TeamName[2]);

                }

                case GREY:

                {

                        return Team_Info(index, type, TeamName[0]);

                }

        }



        return 0;

}



FindPlayer()

{

        new i = -1;



        while(i <= MaxSlots)

        {

                if(IsConnected[++i])

                {

                        return i;

                }

        }



        return -1;

}

Re: Cerere Plugin new_round_stats

Posted: 26 Sep 2010, 10:29
by Andre
Da eroare la compilare

Re: Cerere Plugin new_round_stats

Posted: 26 Sep 2010, 13:12
by b[L]u
gata asta ar trebui sa mearga ;)
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Round Stats"
#define VERSION "1.0"
#define AUTHOR "Alka"

#define MAXSLOTS 32

enum Color {
	
	YELLOW = 1,
	GREEN, 
	TEAM_COLOR,
	GREY,
	RED, 
	BLUE
}

new TeamName[][] = {
	
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}

new bool:IsConnected[MAXSLOTS + 1];
new count_rounds = 0;
new const g_server_name[] = ""
new TeamInfo;
new SayText;
new MaxSlots;

public plugin_init() {
	
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_logevent("_round_start", 2, "1=Round_Start")
	
	TeamInfo = get_user_msgid("TeamInfo");
	SayText = get_user_msgid("SayText");
	MaxSlots = get_maxplayers();
}

public _round_start()
{
	new mapname[32]
	new players[32], num
	
	get_players(players, num)
	get_mapname(mapname,31)
	
	count_rounds ++
	
	ColorChat(0, GREEN,"^x01-<[ Round: ^x04%d^x01 begins in ^x04%s ^x01]>---<[ ^x04%s ^x01]>---<[^x04%d^x01]>-",count_rounds,g_server_name,mapname,num)
}

public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
	static message[256];

	switch(type)
	{
		case YELLOW:
		{
			message[0] = 0x01;
		}
		case GREEN:
		{
			message[0] = 0x04;
		}
		default:
		{
			message[0] = 0x03;
		}
	}

	vformat(message[1], 251, msg, 4);

	message[192] = '^0';

	new team, ColorChange, index, MSG_Type;
	
	if(!id)
	{
		index = FindPlayer();
		MSG_Type = MSG_ALL;
	
	} else {
		MSG_Type = MSG_ONE;
		index = id;
	}
	
	team = get_user_team(index);	
	ColorChange = ColorSelection(index, MSG_Type, type);

	ShowColorMessage(index, MSG_Type, message);
		
	if(ColorChange)
	{
		Team_Info(index, MSG_Type, TeamName[team]);
	}
}

ShowColorMessage(id, type, message[])
{
	message_begin(type, SayText, _, id);
	write_byte(id)		
	write_string(message);
	message_end();	
}

Team_Info(id, type, team[])
{
	message_begin(type, TeamInfo, _, id);
	write_byte(id);
	write_string(team);
	message_end();

	return 1;
}

ColorSelection(index, type, Color:Type)
{
	switch(Type)
	{
		case RED:
		{
			return Team_Info(index, type, TeamName[1]);
		}
		case BLUE:
		{
			return Team_Info(index, type, TeamName[2]);
		}
		case GREY:
		{
			return Team_Info(index, type, TeamName[0]);
		}
	}

	return 0;
}

FindPlayer()
{
	new i = -1;

	while(i <= MaxSlots)
	{
		if(IsConnected[++i])
		{
			return i;
		}
	}

	return -1;
}

Re: Cerere Plugin new_round_stats

Posted: 01 Oct 2010, 20:46
by Andre
Tot da eroare

Re: Cerere Plugin new_round_stats

Posted: 02 Oct 2010, 09:13
by b[L]u
ba nu avea cum sa nuti mearga na uite ti l-am facut eu http://www39.zippyshare.com/v/44172294/file.html ...

Re: Cerere Plugin new_round_stats

Posted: 06 Oct 2010, 22:22
by Andre
Da iti multumesc mult merge

Re: Cerere Plugin new_round_stats

Posted: 06 Oct 2010, 22:36
by b[L]u
apasa si tu pe buton multumesc...