plugin tag customizat

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
umbra_reflex
Membru, skill 0
Membru, skill 0
Posts: 13
Joined: 26 Oct 2018, 11:23
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

10 Nov 2018, 22:17

Salut doresc si eu acel plugin "tag customizat" , cel cu .ini pentru adaugare ,

PS: ce am gasit pe extream , sau pe google nu mai merg . A lu hattrick cand dau sa scriu pe chat apare s1 : s1 ,, s2 : s2 etc...
Olium
User avatar
DevilBoy.eXe
Membru, skill +3
Membru, skill +3
Posts: 1181
Joined: 05 Jun 2016, 22:04
Detinator Steam: Da
Detinator server CS: GO/CSGO.WARED.RO
SteamID: DevilBoy_eXe
Reputatie: Fost moderator ajutator
Fond eXtream: -1
Location: beyond the time
Has thanked: 1 time
Been thanked: 1 time
Contact:

10 Nov 2018, 22:45

umbra_reflex
Membru, skill 0
Membru, skill 0
Posts: 13
Joined: 26 Oct 2018, 11:23
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

11 Nov 2018, 20:05

Altu ?
smileye
Fost moderator
Fost moderator
Posts: 4665
Joined: 12 Jun 2012, 14:18
Detinator Steam: Da
Reputatie: Fost moderator
Has thanked: 258 times
Been thanked: 38 times
Contact:

11 Nov 2018, 20:11

Players Tags | Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < ColorChat >


#define ADMIN_ACCESS			ADMIN_BAN
#pragma semicolon 1

enum CsTeams 
{
	CS_TEAM_UNASSIGNED = 0,
	CS_TEAM_T = 1,
	CS_TEAM_CT = 2,
	CS_TEAM_SPECTATOR = 3
};

static const PLUGIN[ ] = "Player Tags";
static const VERSION[ ] = "1.0";

new szFile[ 128 ];

new PlayerTag[ 33 ][ 32 ];
new bool: PlayerHasTag[ 33 ];


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	register_concmd( "amx_reloadtags", "ClCmdReloadTags", -1, "" );
	
	register_clcmd("say","hook_say");
	register_clcmd("say_team","hook_say_team");
	
	register_forward( FM_ClientUserInfoChanged, "fwClientUserInfoChanged" );
}

public plugin_precache( ) 
{
	
	get_configsdir( szFile, sizeof ( szFile ) -1 );
	formatex( szFile, sizeof ( szFile ) -1, "%s/PlayerTags.ini", szFile );
	
	if( !file_exists( szFile ) ) 
	{
		write_file( szFile, ";Aici treceti tag-urile jucatorilor !", -1 );
		write_file( szFile, ";ex: ^"Nume Player^" ^"Ip Player^" ^"Tag Player^" ", -1 );
		write_file( szFile, ";Numele sa fie exact( ex: Askhanar va fi Askhanar nu askhanar ! ) ", -1 );
	}

}

public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) ) return 1;
	
	PlayerHasTag[ id ] = false;
	
	LoadPlayerTag( id );
	
	return 0;
}
public fwClientUserInfoChanged( id, buffer )
{
	if ( !is_user_connected( id ) )
		return FMRES_IGNORED;
	
	static newname[ 32 ];
	static name[ 32 ];
	
	get_user_name( id, name, sizeof ( name ) -1 );
	engfunc( EngFunc_InfoKeyValue, buffer, "name", newname, sizeof ( newname ) -1 );
	
	if ( equal( newname, name ) )
		return FMRES_IGNORED;
		
		
	set_task( 0.1, "LoadPlayerTag", id );
	
	return FMRES_SUPERCEDE;
}

public ClCmdReloadTags( id )
{
	if( !( get_user_flags( id ) & ADMIN_ACCESS ) )
	{
		client_cmd( id, "echo Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	new iPlayers[ 32 ];
	new iPlayersNum;

	get_players( iPlayers, iPlayersNum, "c" );		
	for( new i = 0 ; i < iPlayersNum ; i++ )
	{
		PlayerHasTag[ iPlayers[ i ] ] = false;
		LoadPlayerTag( iPlayers[ i ] );
	}
	
	client_cmd( id, "echo Tag-urile jucatorilor au fost incarcate cu succes !");
	return 1;
}

public hook_say( id )
{
	
	if( is_user_bot( id ) ) return 0;
	
	static chat[ 192 ];
	read_args( chat, sizeof( chat ) - 1 );
	remove_quotes( chat );
	
	if( equali( chat,"" ) ) return 0;
	
	new name[ 32 ];
	get_user_name( id, name, sizeof ( name ) -1 );
	
	if( PlayerHasTag[ id ] )
	{
		switch( get_user_team( id ) )
		{
			case CS_TEAM_T: 
			{
				ColorChat( 0, RED,"^x03%s^x04 %s^x03 %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
			}
			case CS_TEAM_CT:
			{
				ColorChat( 0, BLUE,"^x03%s^x04 %s^x03 %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
			}
			case CS_TEAM_SPECTATOR:
			{
				ColorChat( 0, GREY,"^x04%s^x03 %s^x01: %s", name ,chat);
			}
		}
	}
	else if( !PlayerHasTag[ id ] )
	{
		switch( get_user_team( id ) )
		{
			case CS_TEAM_T: 
			{
				ColorChat( 0, RED,"^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", name ,chat);
			}
			case CS_TEAM_CT:
			{
				ColorChat( 0, BLUE,"^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", name ,chat);
			}
			case CS_TEAM_SPECTATOR:
			{
				ColorChat( 0, GREY,"^x03%s^x01: %s", name ,chat);
			}
		}
	}
	
	return 1;
}
public hook_say_team( id )
{
	
	if( is_user_bot( id ) ) return 0;
	
	static chat[ 192 ];
	read_args( chat, sizeof( chat ) - 1 );
	remove_quotes( chat );
	
	if( equali( chat, "" ) ) return 0;
	
	new name[ 32 ];
	get_user_name( id, name, sizeof ( name ) -1 );
	
	if( PlayerHasTag[ id ] )
	{
		new iPlayers[ 32 ], iPlayer;
		new iPlayersNum;
	
		get_players( iPlayers, iPlayersNum, "c" );		
		for( new i = 0 ; i < iPlayersNum ; i++ )
		{
			iPlayer = iPlayers[ i ];
			
			if( get_user_team( id ) == get_user_team( iPlayer ) )
			{
				switch( get_user_team( iPlayer ) )
				{
					case CS_TEAM_T: 
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03%s^x04 %s^x03 %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
					}
					case CS_TEAM_CT:
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03%s^x0 4%s^x03 %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
					}
					case CS_TEAM_SPECTATOR:
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x04 %s^x03 %s^x01: %s", PlayerTag[ id ], name ,chat);
					}
				}
			}
		}
	}
	else if( !PlayerHasTag[ id ] )
	{
		new iPlayers[ 32 ], iPlayer;
		new iPlayersNum;
	
		get_players( iPlayers, iPlayersNum, "c" );		
		for( new i = 0 ; i < iPlayersNum ; i++ )
		{
			iPlayer = iPlayers[ i ];
			if( get_user_team( id ) == get_user_team( iPlayer ) )
			{
				switch( get_user_team( id ) )
				{
					case CS_TEAM_T: 
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03%s %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", name ,chat);
					}
					case CS_TEAM_CT:
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03%s %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", name ,chat);
					}
					case CS_TEAM_SPECTATOR:
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x03 %s^x01: %s", name ,chat);
					}
				}
			}
		}
	}
	return 1;
}
public LoadPlayerTag( id )
{
	PlayerHasTag[ id ] = false;
	
	if( !file_exists( szFile ) ) 
	{
		write_file( szFile, ";Aici treceti tag-urile jucatorilor !", -1 );
		write_file( szFile, ";ex: ^"Nume Player^" ^"Ip Player^" ^"Tag Player^" ", -1 );
		write_file( szFile, ";Numele sa fie exact( ex: Askhanar va fi Askhanar nu askhanar ! ) ", -1 );
	}
	
	new f = fopen( szFile, "rt" );
	
	if( !f ) return 0;
	
	new data[ 512 ], buffer[ 3 ][ 32 ] ;
	
	while( !feof( f ) ) 
	{
		fgets( f, data, sizeof ( data ) -1 );
		
		if( !data[ 0 ] || data[ 0 ] == ';' || ( data[ 0 ] == '/' && data[ 1 ] == '/' ) ) 
			continue;
		
		parse(data,\
		buffer[ 0 ], sizeof ( buffer[ ] ) - 1,\
		buffer[ 1 ], sizeof ( buffer[ ] ) - 1,\
		buffer[ 2 ], sizeof ( buffer[ ] ) - 1
		);
		
		new name[ 32 ], ip[ 32 ];
		get_user_name( id, name, sizeof ( name ) -1 );
		get_user_ip( id, ip, sizeof ( ip ) -1, 1 );

		if( equal( name, buffer[ 0 ] ) || equal( ip, buffer[ 1 ] ) )
		{
			PlayerHasTag[ id ] = true;
			copy( PlayerTag[ id ], sizeof ( PlayerTag[ ] ) -1, buffer[ 2 ] );
			break;
		}
	}
	
	return 0;
}
umbra_reflex
Membru, skill 0
Membru, skill 0
Posts: 13
Joined: 26 Oct 2018, 11:23
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

11 Nov 2018, 22:41

smileye wrote:
Players Tags | Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < ColorChat >


#define ADMIN_ACCESS			ADMIN_BAN
#pragma semicolon 1

enum CsTeams 
{
	CS_TEAM_UNASSIGNED = 0,
	CS_TEAM_T = 1,
	CS_TEAM_CT = 2,
	CS_TEAM_SPECTATOR = 3
};

static const PLUGIN[ ] = "Player Tags";
static const VERSION[ ] = "1.0";

new szFile[ 128 ];

new PlayerTag[ 33 ][ 32 ];
new bool: PlayerHasTag[ 33 ];


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	register_concmd( "amx_reloadtags", "ClCmdReloadTags", -1, "" );
	
	register_clcmd("say","hook_say");
	register_clcmd("say_team","hook_say_team");
	
	register_forward( FM_ClientUserInfoChanged, "fwClientUserInfoChanged" );
}

public plugin_precache( ) 
{
	
	get_configsdir( szFile, sizeof ( szFile ) -1 );
	formatex( szFile, sizeof ( szFile ) -1, "%s/PlayerTags.ini", szFile );
	
	if( !file_exists( szFile ) ) 
	{
		write_file( szFile, ";Aici treceti tag-urile jucatorilor !", -1 );
		write_file( szFile, ";ex: ^"Nume Player^" ^"Ip Player^" ^"Tag Player^" ", -1 );
		write_file( szFile, ";Numele sa fie exact( ex: Askhanar va fi Askhanar nu askhanar ! ) ", -1 );
	}

}

public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) ) return 1;
	
	PlayerHasTag[ id ] = false;
	
	LoadPlayerTag( id );
	
	return 0;
}
public fwClientUserInfoChanged( id, buffer )
{
	if ( !is_user_connected( id ) )
		return FMRES_IGNORED;
	
	static newname[ 32 ];
	static name[ 32 ];
	
	get_user_name( id, name, sizeof ( name ) -1 );
	engfunc( EngFunc_InfoKeyValue, buffer, "name", newname, sizeof ( newname ) -1 );
	
	if ( equal( newname, name ) )
		return FMRES_IGNORED;
		
		
	set_task( 0.1, "LoadPlayerTag", id );
	
	return FMRES_SUPERCEDE;
}

public ClCmdReloadTags( id )
{
	if( !( get_user_flags( id ) & ADMIN_ACCESS ) )
	{
		client_cmd( id, "echo Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	new iPlayers[ 32 ];
	new iPlayersNum;

	get_players( iPlayers, iPlayersNum, "c" );		
	for( new i = 0 ; i < iPlayersNum ; i++ )
	{
		PlayerHasTag[ iPlayers[ i ] ] = false;
		LoadPlayerTag( iPlayers[ i ] );
	}
	
	client_cmd( id, "echo Tag-urile jucatorilor au fost incarcate cu succes !");
	return 1;
}

public hook_say( id )
{
	
	if( is_user_bot( id ) ) return 0;
	
	static chat[ 192 ];
	read_args( chat, sizeof( chat ) - 1 );
	remove_quotes( chat );
	
	if( equali( chat,"" ) ) return 0;
	
	new name[ 32 ];
	get_user_name( id, name, sizeof ( name ) -1 );
	
	if( PlayerHasTag[ id ] )
	{
		switch( get_user_team( id ) )
		{
			case CS_TEAM_T: 
			{
				ColorChat( 0, RED,"^x03%s^x04 %s^x03 %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
			}
			case CS_TEAM_CT:
			{
				ColorChat( 0, BLUE,"^x03%s^x04 %s^x03 %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
			}
			case CS_TEAM_SPECTATOR:
			{
				ColorChat( 0, GREY,"^x04%s^x03 %s^x01: %s", name ,chat);
			}
		}
	}
	else if( !PlayerHasTag[ id ] )
	{
		switch( get_user_team( id ) )
		{
			case CS_TEAM_T: 
			{
				ColorChat( 0, RED,"^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", name ,chat);
			}
			case CS_TEAM_CT:
			{
				ColorChat( 0, BLUE,"^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", name ,chat);
			}
			case CS_TEAM_SPECTATOR:
			{
				ColorChat( 0, GREY,"^x03%s^x01: %s", name ,chat);
			}
		}
	}
	
	return 1;
}
public hook_say_team( id )
{
	
	if( is_user_bot( id ) ) return 0;
	
	static chat[ 192 ];
	read_args( chat, sizeof( chat ) - 1 );
	remove_quotes( chat );
	
	if( equali( chat, "" ) ) return 0;
	
	new name[ 32 ];
	get_user_name( id, name, sizeof ( name ) -1 );
	
	if( PlayerHasTag[ id ] )
	{
		new iPlayers[ 32 ], iPlayer;
		new iPlayersNum;
	
		get_players( iPlayers, iPlayersNum, "c" );		
		for( new i = 0 ; i < iPlayersNum ; i++ )
		{
			iPlayer = iPlayers[ i ];
			
			if( get_user_team( id ) == get_user_team( iPlayer ) )
			{
				switch( get_user_team( iPlayer ) )
				{
					case CS_TEAM_T: 
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03%s^x04 %s^x03 %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
					}
					case CS_TEAM_CT:
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03%s^x0 4%s^x03 %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
					}
					case CS_TEAM_SPECTATOR:
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x04 %s^x03 %s^x01: %s", PlayerTag[ id ], name ,chat);
					}
				}
			}
		}
	}
	else if( !PlayerHasTag[ id ] )
	{
		new iPlayers[ 32 ], iPlayer;
		new iPlayersNum;
	
		get_players( iPlayers, iPlayersNum, "c" );		
		for( new i = 0 ; i < iPlayersNum ; i++ )
		{
			iPlayer = iPlayers[ i ];
			if( get_user_team( id ) == get_user_team( iPlayer ) )
			{
				switch( get_user_team( id ) )
				{
					case CS_TEAM_T: 
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03%s %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", name ,chat);
					}
					case CS_TEAM_CT:
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03%s %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", name ,chat);
					}
					case CS_TEAM_SPECTATOR:
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x03 %s^x01: %s", name ,chat);
					}
				}
			}
		}
	}
	return 1;
}
public LoadPlayerTag( id )
{
	PlayerHasTag[ id ] = false;
	
	if( !file_exists( szFile ) ) 
	{
		write_file( szFile, ";Aici treceti tag-urile jucatorilor !", -1 );
		write_file( szFile, ";ex: ^"Nume Player^" ^"Ip Player^" ^"Tag Player^" ", -1 );
		write_file( szFile, ";Numele sa fie exact( ex: Askhanar va fi Askhanar nu askhanar ! ) ", -1 );
	}
	
	new f = fopen( szFile, "rt" );
	
	if( !f ) return 0;
	
	new data[ 512 ], buffer[ 3 ][ 32 ] ;
	
	while( !feof( f ) ) 
	{
		fgets( f, data, sizeof ( data ) -1 );
		
		if( !data[ 0 ] || data[ 0 ] == ';' || ( data[ 0 ] == '/' && data[ 1 ] == '/' ) ) 
			continue;
		
		parse(data,\
		buffer[ 0 ], sizeof ( buffer[ ] ) - 1,\
		buffer[ 1 ], sizeof ( buffer[ ] ) - 1,\
		buffer[ 2 ], sizeof ( buffer[ ] ) - 1
		);
		
		new name[ 32 ], ip[ 32 ];
		get_user_name( id, name, sizeof ( name ) -1 );
		get_user_ip( id, ip, sizeof ( ip ) -1, 1 );

		if( equal( name, buffer[ 0 ] ) || equal( ip, buffer[ 1 ] ) )
		{
			PlayerHasTag[ id ] = true;
			copy( PlayerTag[ id ], sizeof ( PlayerTag[ ] ) -1, buffer[ 2 ] );
			break;
		}
	}
	
	return 0;
}
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/tmp/textOlRF0X.sma(4) : fatal error 100: cannot read from file: "ColorChat"
User avatar
Laurentiu P.
Super moderator
Super moderator
Posts: 2081
Joined: 10 Jul 2013, 20:26
Detinator Steam: Da
CS Status: Activitate scazuta !
Detinator server CS: Da
Reputatie: Super moderator
Nume anterior: Do[N]e ;3
Fond eXtream: 1
Location: Constanta
Has thanked: 3 times
Been thanked: 2 times

12 Nov 2018, 07:15

umbra_reflex wrote:
smileye wrote:
Players Tags | Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < ColorChat >


#define ADMIN_ACCESS			ADMIN_BAN
#pragma semicolon 1

enum CsTeams 
{
	CS_TEAM_UNASSIGNED = 0,
	CS_TEAM_T = 1,
	CS_TEAM_CT = 2,
	CS_TEAM_SPECTATOR = 3
};

static const PLUGIN[ ] = "Player Tags";
static const VERSION[ ] = "1.0";

new szFile[ 128 ];

new PlayerTag[ 33 ][ 32 ];
new bool: PlayerHasTag[ 33 ];


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	register_concmd( "amx_reloadtags", "ClCmdReloadTags", -1, "" );
	
	register_clcmd("say","hook_say");
	register_clcmd("say_team","hook_say_team");
	
	register_forward( FM_ClientUserInfoChanged, "fwClientUserInfoChanged" );
}

public plugin_precache( ) 
{
	
	get_configsdir( szFile, sizeof ( szFile ) -1 );
	formatex( szFile, sizeof ( szFile ) -1, "%s/PlayerTags.ini", szFile );
	
	if( !file_exists( szFile ) ) 
	{
		write_file( szFile, ";Aici treceti tag-urile jucatorilor !", -1 );
		write_file( szFile, ";ex: ^"Nume Player^" ^"Ip Player^" ^"Tag Player^" ", -1 );
		write_file( szFile, ";Numele sa fie exact( ex: Askhanar va fi Askhanar nu askhanar ! ) ", -1 );
	}

}

public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) ) return 1;
	
	PlayerHasTag[ id ] = false;
	
	LoadPlayerTag( id );
	
	return 0;
}
public fwClientUserInfoChanged( id, buffer )
{
	if ( !is_user_connected( id ) )
		return FMRES_IGNORED;
	
	static newname[ 32 ];
	static name[ 32 ];
	
	get_user_name( id, name, sizeof ( name ) -1 );
	engfunc( EngFunc_InfoKeyValue, buffer, "name", newname, sizeof ( newname ) -1 );
	
	if ( equal( newname, name ) )
		return FMRES_IGNORED;
		
		
	set_task( 0.1, "LoadPlayerTag", id );
	
	return FMRES_SUPERCEDE;
}

public ClCmdReloadTags( id )
{
	if( !( get_user_flags( id ) & ADMIN_ACCESS ) )
	{
		client_cmd( id, "echo Nu ai acces la aceasta comanda !");
		return 1;
	}
	
	new iPlayers[ 32 ];
	new iPlayersNum;

	get_players( iPlayers, iPlayersNum, "c" );		
	for( new i = 0 ; i < iPlayersNum ; i++ )
	{
		PlayerHasTag[ iPlayers[ i ] ] = false;
		LoadPlayerTag( iPlayers[ i ] );
	}
	
	client_cmd( id, "echo Tag-urile jucatorilor au fost incarcate cu succes !");
	return 1;
}

public hook_say( id )
{
	
	if( is_user_bot( id ) ) return 0;
	
	static chat[ 192 ];
	read_args( chat, sizeof( chat ) - 1 );
	remove_quotes( chat );
	
	if( equali( chat,"" ) ) return 0;
	
	new name[ 32 ];
	get_user_name( id, name, sizeof ( name ) -1 );
	
	if( PlayerHasTag[ id ] )
	{
		switch( get_user_team( id ) )
		{
			case CS_TEAM_T: 
			{
				ColorChat( 0, RED,"^x03%s^x04 %s^x03 %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
			}
			case CS_TEAM_CT:
			{
				ColorChat( 0, BLUE,"^x03%s^x04 %s^x03 %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
			}
			case CS_TEAM_SPECTATOR:
			{
				ColorChat( 0, GREY,"^x04%s^x03 %s^x01: %s", name ,chat);
			}
		}
	}
	else if( !PlayerHasTag[ id ] )
	{
		switch( get_user_team( id ) )
		{
			case CS_TEAM_T: 
			{
				ColorChat( 0, RED,"^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", name ,chat);
			}
			case CS_TEAM_CT:
			{
				ColorChat( 0, BLUE,"^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort*", name ,chat);
			}
			case CS_TEAM_SPECTATOR:
			{
				ColorChat( 0, GREY,"^x03%s^x01: %s", name ,chat);
			}
		}
	}
	
	return 1;
}
public hook_say_team( id )
{
	
	if( is_user_bot( id ) ) return 0;
	
	static chat[ 192 ];
	read_args( chat, sizeof( chat ) - 1 );
	remove_quotes( chat );
	
	if( equali( chat, "" ) ) return 0;
	
	new name[ 32 ];
	get_user_name( id, name, sizeof ( name ) -1 );
	
	if( PlayerHasTag[ id ] )
	{
		new iPlayers[ 32 ], iPlayer;
		new iPlayersNum;
	
		get_players( iPlayers, iPlayersNum, "c" );		
		for( new i = 0 ; i < iPlayersNum ; i++ )
		{
			iPlayer = iPlayers[ i ];
			
			if( get_user_team( id ) == get_user_team( iPlayer ) )
			{
				switch( get_user_team( iPlayer ) )
				{
					case CS_TEAM_T: 
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03%s^x04 %s^x03 %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
					}
					case CS_TEAM_CT:
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03%s^x0 4%s^x03 %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", PlayerTag[ id ], name ,chat);
					}
					case CS_TEAM_SPECTATOR:
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x04 %s^x03 %s^x01: %s", PlayerTag[ id ], name ,chat);
					}
				}
			}
		}
	}
	else if( !PlayerHasTag[ id ] )
	{
		new iPlayers[ 32 ], iPlayer;
		new iPlayersNum;
	
		get_players( iPlayers, iPlayersNum, "c" );		
		for( new i = 0 ; i < iPlayersNum ; i++ )
		{
			iPlayer = iPlayers[ i ];
			if( get_user_team( id ) == get_user_team( iPlayer ) )
			{
				switch( get_user_team( id ) )
				{
					case CS_TEAM_T: 
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03%s %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", name ,chat);
					}
					case CS_TEAM_CT:
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03%s %s^x01: %s",is_user_alive(id) ? "" : "*Mort*", name ,chat);
					}
					case CS_TEAM_SPECTATOR:
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x03 %s^x01: %s", name ,chat);
					}
				}
			}
		}
	}
	return 1;
}
public LoadPlayerTag( id )
{
	PlayerHasTag[ id ] = false;
	
	if( !file_exists( szFile ) ) 
	{
		write_file( szFile, ";Aici treceti tag-urile jucatorilor !", -1 );
		write_file( szFile, ";ex: ^"Nume Player^" ^"Ip Player^" ^"Tag Player^" ", -1 );
		write_file( szFile, ";Numele sa fie exact( ex: Askhanar va fi Askhanar nu askhanar ! ) ", -1 );
	}
	
	new f = fopen( szFile, "rt" );
	
	if( !f ) return 0;
	
	new data[ 512 ], buffer[ 3 ][ 32 ] ;
	
	while( !feof( f ) ) 
	{
		fgets( f, data, sizeof ( data ) -1 );
		
		if( !data[ 0 ] || data[ 0 ] == ';' || ( data[ 0 ] == '/' && data[ 1 ] == '/' ) ) 
			continue;
		
		parse(data,\
		buffer[ 0 ], sizeof ( buffer[ ] ) - 1,\
		buffer[ 1 ], sizeof ( buffer[ ] ) - 1,\
		buffer[ 2 ], sizeof ( buffer[ ] ) - 1
		);
		
		new name[ 32 ], ip[ 32 ];
		get_user_name( id, name, sizeof ( name ) -1 );
		get_user_ip( id, ip, sizeof ( ip ) -1, 1 );

		if( equal( name, buffer[ 0 ] ) || equal( ip, buffer[ 1 ] ) )
		{
			PlayerHasTag[ id ] = true;
			copy( PlayerTag[ id ], sizeof ( PlayerTag[ ] ) -1, buffer[ 2 ] );
			break;
		}
	}
	
	return 0;
}
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/tmp/textOlRF0X.sma(4) : fatal error 100: cannot read from file: "ColorChat"

Compileaza-l cu amxx 1.8.2 si adauga in include-ul in folderul ”include”.
Image
Post Reply

Return to “Cereri”

  • Information