Rang admin chat MODIFICAT [rezolvat]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

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
User avatar
catalynho
Membru, skill 0
Membru, skill 0
Posts: 21
Joined: 07 Jun 2014, 21:14
Detinator Steam: Da
CS Status: Respect eXtreamCS!
Detinator server CS: Slatina.CS1.Ro
Fond eXtream: 0
Location: Slatina
Has thanked: 9 times
Contact:

22 Jun 2014, 17:57

Descriere plugin cerut: Rang admin chat Modificat
Alte informatii: As vrea si eu daca se poate sa-mi modificati acest plugin sa-mi apara scris-ul adminulu colorat ( orice culoare ) si optional parantezele in care scrie rangul (Fondator) sa fie verzi .
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >

#define PLUGIN "Rang Admin Chat Fixed"
#define VERSION "1.0.1"

#pragma semicolon 1

#define	MAX_GROUPS	7


// --| CC_ColorChat.
enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
};

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};
// --| CC_ColorChat.


new g_szGroups[ MAX_GROUPS ][ ] =
{
	"Fondator",
	"Owner",
      "Co-Owner",
	"God",
	"Moderator",
	"Helper",
	"Slot"
};

new g_szGroupsFlags[ MAX_GROUPS ][ ] =
{
	"abcdefghijklmnopqrstu",
	"bcdefghijklmnopqrstu",
	"bcdefghijklmnopqrst",
	"bcdefghijklm",
	"bcdefghijk",
	"bcdefghij",
	"b"
};

new g_iGroupsFlagsValues[ MAX_GROUPS ];

public plugin_init( )
{
	//Plugin original creat de Ex3cuTioN ( pluginuri-extream/rangadminchat-t81702.html )!
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	
	register_clcmd("say","HookClCmdSay");
	register_clcmd("say_team","HookClCmdSayTeam");
	
	for( new i = 0; i < MAX_GROUPS; i++ )
		g_iGroupsFlagsValues[ i ] = read_flags( g_szGroupsFlags[ i ] );
		
	// Add your code here...
}


public HookClCmdSay( id )
{
	
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
	
	static szChat[ 192 ];
	read_args( szChat, sizeof( szChat ) - 1 );
	remove_quotes( szChat );
	
	if( equali( szChat,"" ) )
		return PLUGIN_CONTINUE;
	
	static szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
		
	if( is_user_admin( id ) )
	{

		for( new i = 0; i < MAX_GROUPS; i++ )
		{
			
			if( get_user_flags( id ) == g_iGroupsFlagsValues[ i ] )
			{
				
				switch( cs_get_user_team( id ) )
				{
					case CS_TEAM_T:		ColorChat( 0, RED,"^x03%s ^x01(^x04%s^x01): %s", szName, g_szGroups[ i ], szChat );
					case CS_TEAM_CT:	ColorChat( 0, BLUE,"^x03%s ^x01(^x04%s^x01): %s", szName, g_szGroups[ i ], szChat );
					case CS_TEAM_SPECTATOR:	ColorChat( 0, GREY,"^x03%s ^x01(^x04%s^x01): %s", szName, g_szGroups[ i ], szChat );
				}
				
				break;
			}
		}
	}
	
	else
	{
		
		switch( cs_get_user_team( id ) )
		{
			case CS_TEAM_T:		ColorChat( 0, RED,"^x03 %s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
			case CS_TEAM_CT:	ColorChat( 0, BLUE,"^x03 %s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
			case CS_TEAM_SPECTATOR:	ColorChat( 0, GREY,"^x03 %s^x01: %s", szName, szChat );
		}
		
	}
	
	
	return PLUGIN_HANDLED_MAIN;
}

public HookClCmdSayTeam( id )
{
	
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
	
	static szChat[ 192 ];
	read_args( szChat, sizeof( szChat ) - 1 );
	remove_quotes( szChat );
	
	if( equali( szChat,"" ) )
		return PLUGIN_CONTINUE;
	
	static szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	static iPlayers[ 32 ];
	static iPlayersNum;
	
	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )
		return PLUGIN_CONTINUE;
					
	static iPlayer, i;
	iPlayer = -1; i = 0;
	
	for( i = 0; i < iPlayersNum; i++ )
	{
		
		iPlayer = iPlayers[ i ];

		if( cs_get_user_team( id ) == cs_get_user_team( iPlayer ) )
		{
			
			switch( cs_get_user_team( id ) )
			{
				
				case CS_TEAM_T:
				{
					if( is_user_admin( id ) )
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03 %s^x01: %s", szName, szChat );
					}
					else
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
					}
				}
				
				case CS_TEAM_CT:
				{
					if( is_user_admin( id ) )
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03 %s^x01: %s", szName, szChat );
					}
					else
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
					}
				}
				
				case CS_TEAM_SPECTATOR:
				{
					if( is_user_admin( id ) )
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x03 %s^x01: %s", szName, szChat );
					}
					else
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x03 %s^x01: %s", szName, szChat );
					}
				}
			}
		}
	}
				
	return PLUGIN_HANDLED_MAIN;
}

// From amxmisc.inc
stock is_user_admin( id )
{
	new __flags=get_user_flags(id);
	return (__flags>0 && !(__flags&ADMIN_USER));
}
// -----------------------


// --| CC_ColorChat.
ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	szMessage[ 192 ] = '^0';
	

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
	
	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer(  );
		MSG_Type = MSG_ALL;
	}
	
	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
		
	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );

}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
	
	static bool:bSayTextUsed;
	static iMsgSayText;
	
	if(  !bSayTextUsed  )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}
	
	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  );		
	write_string(  szMessage  );
	message_end(  );
}

CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}
	
	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte(  id  );
	write_string(  szTeam  );
	message_end(  );

	return 1;
}

CC_ColorSelection(  id, const iType, Color:iColorType)
{
	switch(  iColorType  )
	{
		
		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );

	}

	return 0;
}

CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}
// --| CC_ColorChat.
"Nu voi fi un om obişnuit, pentru că am dreptul să fiu extraordinar".

Image
RoyalServer 2
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

22 Jun 2014, 20:55

| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >

#define PLUGIN "Rang Admin Chat Fixed"
#define VERSION "1.0.1"

#pragma semicolon 1

#define	MAX_GROUPS	7


// --| CC_ColorChat.
enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
};

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};
// --| CC_ColorChat.


new g_szGroups[ MAX_GROUPS ][ ] =
{
	"Fondator",
	"Owner",
      "Co-Owner",
	"God",
	"Moderator",
	"Helper",
	"Slot"
};

new g_szGroupsFlags[ MAX_GROUPS ][ ] =
{
	"abcdefghijklmnopqrstu",
	"bcdefghijklmnopqrstu",
	"bcdefghijklmnopqrst",
	"bcdefghijklm",
	"bcdefghijk",
	"bcdefghij",
	"b"
};

new g_iGroupsFlagsValues[ MAX_GROUPS ];

public plugin_init( )
{
	//Plugin original creat de Ex3cuTioN ( pluginuri-extream/rangadminchat-t81702.html )!
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	
	register_clcmd("say","HookClCmdSay");
	register_clcmd("say_team","HookClCmdSayTeam");
	
	for( new i = 0; i < MAX_GROUPS; i++ )
		g_iGroupsFlagsValues[ i ] = read_flags( g_szGroupsFlags[ i ] );
		
	// Add your code here...
}


public HookClCmdSay( id )
{
	
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
	
	static szChat[ 192 ];
	read_args( szChat, sizeof( szChat ) - 1 );
	remove_quotes( szChat );
	
	if( equali( szChat,"" ) )
		return PLUGIN_CONTINUE;
	
	static szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
		
	if( is_user_admin( id ) )
	{

		for( new i = 0; i < MAX_GROUPS; i++ )
		{
			
			if( get_user_flags( id ) == g_iGroupsFlagsValues[ i ] )
			{
				
				switch( cs_get_user_team( id ) )
				{
					case CS_TEAM_T:		ColorChat( 0, RED,"^x03%s ^x04(%s)^x01:^x04 %s", szName, g_szGroups[ i ], szChat );
					case CS_TEAM_CT:	ColorChat( 0, BLUE,"^x03%s ^x04(%s)^x01:^x04 %s", szName, g_szGroups[ i ], szChat );
					case CS_TEAM_SPECTATOR:	ColorChat( 0, GREY,"^x03%s ^x04(%s)^x01:^x04 %s", szName, g_szGroups[ i ], szChat );
				}
				
				break;
			}
		}
	}
	
	else
	{
		
		switch( cs_get_user_team( id ) )
		{
			case CS_TEAM_T:		ColorChat( 0, RED,"^x03 %s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
			case CS_TEAM_CT:	ColorChat( 0, BLUE,"^x03 %s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
			case CS_TEAM_SPECTATOR:	ColorChat( 0, GREY,"^x03 %s^x01: %s", szName, szChat );
		}
		
	}
	
	
	return PLUGIN_HANDLED_MAIN;
}

public HookClCmdSayTeam( id )
{
	
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
	
	static szChat[ 192 ];
	read_args( szChat, sizeof( szChat ) - 1 );
	remove_quotes( szChat );
	
	if( equali( szChat,"" ) )
		return PLUGIN_CONTINUE;
	
	static szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	static iPlayers[ 32 ];
	static iPlayersNum;
	
	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )
		return PLUGIN_CONTINUE;
					
	static iPlayer, i;
	iPlayer = -1; i = 0;
	
	for( i = 0; i < iPlayersNum; i++ )
	{
		
		iPlayer = iPlayers[ i ];

		if( cs_get_user_team( id ) == cs_get_user_team( iPlayer ) )
		{
			
			switch( cs_get_user_team( id ) )
			{
				
				case CS_TEAM_T:
				{
					if( is_user_admin( id ) )
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03 %s^x01: %s", szName, szChat );
					}
					else
					{
						ColorChat( iPlayer, RED, "^x01(Terrorist)^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
					}
				}
				
				case CS_TEAM_CT:
				{
					if( is_user_admin( id ) )
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03 %s^x01: %s", szName, szChat );
					}
					else
					{
						ColorChat( iPlayer, BLUE, "^x01(Counter-Terrorist)^x03%s %s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
					}
				}
				
				case CS_TEAM_SPECTATOR:
				{
					if( is_user_admin( id ) )
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x03 %s^x01: %s", szName, szChat );
					}
					else
					{
						ColorChat( iPlayer, GREY, "^x01(Spectator)^x03 %s^x01: %s", szName, szChat );
					}
				}
			}
		}
	}
				
	return PLUGIN_HANDLED_MAIN;
}

// From amxmisc.inc
stock is_user_admin( id )
{
	new __flags=get_user_flags(id);
	return (__flags>0 && !(__flags&ADMIN_USER));
}
// -----------------------


// --| CC_ColorChat.
ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	szMessage[ 192 ] = '^0';
	

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
	
	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer(  );
		MSG_Type = MSG_ALL;
	}
	
	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
		
	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );

}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
	
	static bool:bSayTextUsed;
	static iMsgSayText;
	
	if(  !bSayTextUsed  )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}
	
	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  );		
	write_string(  szMessage  );
	message_end(  );
}

CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}
	
	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte(  id  );
	write_string(  szTeam  );
	message_end(  );

	return 1;
}

CC_ColorSelection(  id, const iType, Color:iColorType)
{
	switch(  iColorType  )
	{
		
		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );

	}

	return 0;
}

CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}
// --| CC_ColorChat.
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
User avatar
catalynho
Membru, skill 0
Membru, skill 0
Posts: 21
Joined: 07 Jun 2014, 21:14
Detinator Steam: Da
CS Status: Respect eXtreamCS!
Detinator server CS: Slatina.CS1.Ro
Fond eXtream: 0
Location: Slatina
Has thanked: 9 times
Contact:

22 Jun 2014, 23:18

Mersi mult de tot . Merge perfect , 0 buguri. \:d/
"Nu voi fi un om obişnuit, pentru că am dreptul să fiu extraordinar".

Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests