Cerere Rank_admin_chat

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
aSd.
Membru, skill 0
Membru, skill 0
Posts: 5
Joined: 19 Oct 2013, 09:51
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 1 time
Contact:

19 Oct 2013, 10:12

as vrea si eu acest plugin : rank admin chat

accesele

1."Owner",
2."Co-Owner+vip",
3."Co-Owner",
4."Moderator+vip"
5."Moderator"
6."Administrator+vip"
7."Administrator"
8."Helper+vip"
9."Helper"
10."V.I.P"
11"Slot"

Punctele de acces:
1."abcdefghijklmnopqrstu",
2."bcdefghijlmnopqrstu"
3."bcdefghijlmnopqrsu"
4."bcdefghijmnopqrstu"
5."bcdefghijmnopqrsu"
6."bcdefhijmnqrsut"
7."bcdefhijmnqrstu"
8."bcefhijmnt"
9."bcefhijmn"
10."bit"
11."b"
Last edited by aSd. on 25 Oct 2013, 19:38, edited 1 time in total.
RoyalServer
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2550
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 64 times
Contact:

19 Oct 2013, 10:35

Poftim:
Rank_Admin_Chat.sma => http://www.girlshare.ro/32925847.9
Rank_Admin_Chat.amxx => http://www.girlshare.ro/32925854.5

PS: ai gresit sectiunea pentru Cereri Plugin-uri
no...
aSd.
Membru, skill 0
Membru, skill 0
Posts: 5
Joined: 19 Oct 2013, 09:51
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 1 time
Contact:

19 Oct 2013, 13:27

Numi merge :( :( :( :( :( :(
OneShot.
Membru, skill +2
Membru, skill +2
Posts: 719
Joined: 12 Sep 2011, 19:17
Detinator Steam: Da
Detinator server CS: drx.indungi.ro
SteamID: oneshot_01
Reputatie: Fost moderator ajutator
Nume anterior: OnlyHD
Location: Bucuresti
Has thanked: 196 times
Been thanked: 66 times
Contact:

19 Oct 2013, 16:30

Mutat in sectiunea corespunzatoare si citeste aceasta regula: http://www.extreamcs.com/forum/cereri-c ... 18661.html apoi editeaza titlul cereri.
aSd.
Membru, skill 0
Membru, skill 0
Posts: 5
Joined: 19 Oct 2013, 09:51
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 1 time
Contact:

20 Oct 2013, 11:07

am gasit un scripting dar nu reusesc sal compilez ma puteti ajuta?

| Afiseaza codul
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 /* Plugin generated by AMXX-Studio */\par
\par
#include < amxmodx >\par
#include < cstrike >\par
\par
#define PLUGIN "Rang Admin Chat Fixed"\par
#define VERSION "1.0.1"\par
\par
#pragma semicolon 1\par
\par
#define\tab MAX_GROUPS\tab 12\par
\par
\par
// --| CC_ColorChat.\par
enum Color\par
\{\par
\tab NORMAL = 1, \tab\tab // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.\par
\tab GREEN, \tab\tab\tab // Culoare Verde.\par
\tab TEAM_COLOR, \tab\tab // Culoare Rosu, Albastru, Gri.\par
\tab GREY, \tab\tab\tab // Culoarea Gri.\par
\tab RED, \tab\tab\tab // Culoarea Rosu.\par
\tab BLUE, \tab\tab\tab // Culoarea Albastru.\par
\};\par
\par
new TeamName[  ][  ] = \par
\{\par
\tab "",\par
\tab "TERRORIST",\par
\tab "CT",\par
\tab "SPECTATOR"\par
\};\par
// --| CC_ColorChat.\par
\par
\par
new g_szGroups[ MAX_GROUPS ][ ] =\par
\{\par
\tab "[DetinatoR]",\par
\tab "[OwneR+Vip]",\par
\tab "[Co-OwneR+Vip]",\par
\tab "[Co-Owner]",\par
\tab "[Moderator+Vip]",\par
\tab "[Moderator]",\par
\tab "[Administrator+Vip]",\par
\tab "[Administrator]",\par
\tab "[Helper+Vip]",\par
            "[Helper]",\par
            "[V.I.P]",\par
            "[Slot]"\par
\};\par
\par
new g_szGroupsFlags[ MAX_GROUPS ][ ] =\par
\{\par
\tab "abcdefghijklmnopqrstu",\par
\tab "bcdefghijklmnopqrst",\par
\tab "bcdefghijlmnopqrstu",\par
\tab "bcdefghijlmnopqrsu",\par
\tab "bcdefghijmnopqrstu",\par
\tab "bcdefghijmnopqrsu",\par
\tab "bcdefhijmnqrsut",\par
\tab "bcdefhijmnqrstu",\par
\tab "bcefhijmnt",\par
            "bcefhijmn",\par
            "bit",\par
            "b"\par
\};\par
\par
new g_iGroupsFlagsValues[ MAX_GROUPS ];\par
\par
public plugin_init( )\par
\{\par
\tab //Plugin original creat de Ex3cuTioN ( pluginuri-extream/rangadminchat-t81702.html )!\par
\tab register_plugin( PLUGIN, VERSION, "Askhanar" );\par
\tab\par
\tab\par
\tab register_clcmd("say","HookClCmdSay");\par
\tab register_clcmd("say_team","HookClCmdSayTeam");\par
\tab\par
\tab for( new i = 0; i < MAX_GROUPS; i++ )\par
\tab\tab g_iGroupsFlagsValues[ i ] = read_flags( g_szGroupsFlags[ i ] );\par
\tab\tab\par
\tab // Add your code here...\par
\}\par
\par
\par
public HookClCmdSay( id )\par
\{\par
\tab\par
\tab if( is_user_bot( id ) )\par
\tab\tab return PLUGIN_CONTINUE;\par
\tab\par
\tab static szChat[ 192 ];\par
\tab read_args( szChat, sizeof( szChat ) - 1 );\par
\tab remove_quotes( szChat );\par
\tab\par
\tab if( equali( szChat,"" ) )\par
\tab\tab return PLUGIN_CONTINUE;\par
\tab\par
\tab static szName[ 32 ];\par
\tab get_user_name( id, szName, sizeof ( szName ) -1 );\par
\tab\tab\par
\tab if( is_user_admin( id ) )\par
\tab\{\par
\par
\tab\tab for( new i = 0; i < MAX_GROUPS; i++ )\par
\tab\tab\{\par
\tab\tab\tab\par
\tab\tab\tab if( get_user_flags( id ) == g_iGroupsFlagsValues[ i ] )\par
\tab\tab\tab\{\par
\tab\tab\tab\tab\par
\tab\tab\tab\tab switch( cs_get_user_team( id ) )\par
\tab\tab\tab\tab\{\par
\tab\tab\tab\tab\tab case CS_TEAM_T:\tab\tab ColorChat( 0, RED,"^x04[%s]^x03 %s^x01: %s", g_szGroups[ i ], szName, szChat );\par
\tab\tab\tab\tab\tab case CS_TEAM_CT:\tab ColorChat( 0, BLUE,"^x04[%s]^x03 %s^x01: %s", g_szGroups[ i ], szName, szChat );\par
\tab\tab\tab\tab\tab case CS_TEAM_SPECTATOR:\tab ColorChat( 0, GREY,"^x04[%s]^x03 %s^x01: %s", g_szGroups[ i ], szName, szChat );\par
\tab\tab\tab\tab\}\par
\tab\tab\tab\tab\par
\tab\tab\tab\tab break;\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab\par
\tab else\par
\tab\{\par
\tab\tab\par
\tab\tab switch( cs_get_user_team( id ) )\par
\tab\tab\{\par
\tab\tab\tab case CS_TEAM_T:\tab\tab ColorChat( 0, RED,"^x03 %s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );\par
\tab\tab\tab case CS_TEAM_CT:\tab ColorChat( 0, BLUE,"^x03 %s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );\par
\tab\tab\tab case CS_TEAM_SPECTATOR:\tab ColorChat( 0, GREY,"^x03 %s^x01: %s", szName, szChat );\par
\tab\tab\}\par
\tab\tab\par
\tab\}\par
\tab\par
\tab\par
\tab return PLUGIN_HANDLED_MAIN;\par
\}\par
\par
public HookClCmdSayTeam( id )\par
\{\par
\tab\par
\tab if( is_user_bot( id ) )\par
\tab\tab return PLUGIN_CONTINUE;\par
\tab\par
\tab static szChat[ 192 ];\par
\tab read_args( szChat, sizeof( szChat ) - 1 );\par
\tab remove_quotes( szChat );\par
\tab\par
\tab if( equali( szChat,"" ) )\par
\tab\tab return PLUGIN_CONTINUE;\par
\tab\par
\tab static szName[ 32 ];\par
\tab get_user_name( id, szName, sizeof ( szName ) -1 );\par
\tab\par
\tab static iPlayers[ 32 ];\par
\tab static iPlayersNum;\par
\tab\par
\tab get_players( iPlayers, iPlayersNum, "ch" );\par
\tab if( !iPlayersNum )\par
\tab\tab return PLUGIN_CONTINUE;\par
\tab\tab\tab\tab\tab\par
\tab static iPlayer, i;\par
\tab iPlayer = -1; i = 0;\par
\tab\par
\tab if( is_user_admin( id ) )\par
\tab\{\par
\tab\tab static x; x = 0;\par
\tab\tab\par
\tab\tab for( x = 0; x < MAX_GROUPS; x++ )\par
\tab\tab\{\par
\tab\tab\tab\par
\tab\tab\tab if( get_user_flags( id ) == g_iGroupsFlagsValues[ x ] )\par
\tab\tab\tab\{\tab\par
\tab\tab\tab\tab\par
\tab\tab\tab\tab for( i = 0; i < iPlayersNum; i++ )\par
\tab\tab\tab\tab\{\par
\tab\tab\tab\tab\tab\par
\tab\tab\tab\tab\tab iPlayer = iPlayers[ i ];\par
\tab\tab\par
\tab\tab\tab\tab\tab if( cs_get_user_team( id ) == cs_get_user_team( iPlayer ) )\par
\tab\tab\tab\tab\tab\{\par
\tab\tab\tab\tab\tab\tab switch( cs_get_user_team( id ) )\par
\tab\tab\tab\tab\tab\tab\{\par
\tab\tab\tab\tab\tab\tab\tab case CS_TEAM_T:\tab\tab ColorChat( iPlayer, RED, "^x04[%s] ^x03(Terrorist) %s^x01: %s", g_szGroups[ x ], szName, szChat );\par
\tab\tab\tab\tab\tab\tab\tab case CS_TEAM_CT:\tab ColorChat( iPlayer, BLUE, "^x04[%s] ^x03(Counter-Terrorist) %s^x01: %s", g_szGroups[ x ], szName, szChat );\par
\tab\tab\tab\tab\tab\tab\tab case CS_TEAM_SPECTATOR:\tab ColorChat( iPlayer, GREY, "^x04[%s] ^x03(Spectator) %s^x01: %s", g_szGroups[ x ], szName, szChat );\par
\tab\tab\tab\tab\tab\tab\}\par
\tab\tab\tab\tab\tab\}\par
\tab\tab\tab\tab\}\par
\tab\tab\tab\tab\par
\tab\tab\tab\tab break;\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab\par
\tab else\par
\tab\{\par
\tab\tab\tab\par
\tab\tab for( i = 0; i < iPlayersNum; i++ )\par
\tab\tab\{\par
\tab\tab\tab\par
\tab\tab\tab iPlayer = iPlayers[ i ];\par
\par
\tab\tab\tab if( cs_get_user_team( id ) == cs_get_user_team( iPlayer ) )\par
\tab\tab\tab\{\par
\tab\tab\tab\tab switch( cs_get_user_team( id ) )\par
\tab\tab\tab\tab\{\par
\tab\tab\tab\tab\tab case CS_TEAM_T:\tab\tab ColorChat( iPlayer, RED, "^x03(Terrorist)%s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );\par
\tab\tab\tab\tab\tab case CS_TEAM_CT:\tab ColorChat( iPlayer, BLUE, "^x03(Counter-Terrorist)%s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );\par
\tab\tab\tab\tab\tab case CS_TEAM_SPECTATOR:\tab ColorChat( iPlayer, GREY, "^x03(Spectator) %s^x01: %s", szName, szChat );\par
\tab\tab\tab\tab\}\par
\tab\tab\tab\}\par
\tab\tab\}\par
\tab\}\par
\tab\tab\tab\tab\par
\tab return PLUGIN_HANDLED_MAIN;\par
\}\par
\par
// From amxmisc.inc\par
stock is_user_admin( id )\par
\{\par
\tab new __flags=get_user_flags(id);\par
\tab return (__flags>0 && !(__flags&ADMIN_USER));\par
\}\par
// -----------------------\par
\par
\par
// --| CC_ColorChat.\par
ColorChat(  id, Color:iType, const msg[  ], \{ Float, Sql, Result, _\}:...  )\par
\{\par
\tab\par
\tab // Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..\par
\tab if( !get_playersnum( ) ) return;\par
\tab\par
\tab new szMessage[ 256 ];\par
\par
\tab switch( iType )\par
\tab\{\par
\tab\tab  // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.\par
\tab\tab case NORMAL:\tab szMessage[ 0 ] = 0x01;\par
\tab\tab\par
\tab\tab // Culoare Verde.\par
\tab\tab case GREEN:\tab szMessage[ 0 ] = 0x04;\par
\tab\tab\par
\tab\tab // Alb, Rosu, Albastru.\par
\tab\tab default: \tab szMessage[ 0 ] = 0x03;\par
\tab\}\par
\par
\tab vformat(  szMessage[ 1 ], 251, msg, 4  );\par
\par
\tab // Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.\par
\tab szMessage[ 192 ] = '^0';\par
\tab\par
\par
\tab new iTeam, iColorChange, iPlayerIndex, MSG_Type;\par
\tab\par
\tab if( id )\par
\tab\{\par
\tab\tab MSG_Type  =  MSG_ONE_UNRELIABLE;\par
\tab\tab iPlayerIndex  =  id;\par
\tab\}\par
\tab else\par
\tab\{\par
\tab\tab iPlayerIndex  =  CC_FindPlayer(  );\par
\tab\tab MSG_Type = MSG_ALL;\par
\tab\}\par
\tab\par
\tab iTeam  =  get_user_team( iPlayerIndex );\par
\tab iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);\par
\par
\tab CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );\par
\tab\tab\par
\tab if(  iColorChange  )\tab CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );\par
\par
\}\par
\par
CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )\par
\{\par
\tab\par
\tab static bool:bSayTextUsed;\par
\tab static iMsgSayText;\par
\tab\par
\tab if(  !bSayTextUsed  )\par
\tab\{\par
\tab\tab iMsgSayText  =  get_user_msgid( "SayText" );\par
\tab\tab bSayTextUsed  =  true;\par
\tab\}\par
\tab\par
\tab message_begin( iType, iMsgSayText, _, id  );\par
\tab write_byte(  id  );\tab\tab\par
\tab write_string(  szMessage  );\par
\tab message_end(  );\par
\}\par
\par
CC_Team_Info( id, const iType, const szTeam[  ] )\par
\{\par
\tab static bool:bTeamInfoUsed;\par
\tab static iMsgTeamInfo;\par
\tab if(  !bTeamInfoUsed  )\par
\tab\{\par
\tab\tab iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );\par
\tab\tab bTeamInfoUsed  =  true;\par
\tab\}\par
\tab\par
\tab message_begin( iType, iMsgTeamInfo, _, id  );\par
\tab write_byte(  id  );\par
\tab write_string(  szTeam  );\par
\tab message_end(  );\par
\par
\tab return 1;\par
\}\par
\par
CC_ColorSelection(  id, const iType, Color:iColorType)\par
\{\par
\tab switch(  iColorType  )\par
\tab\{\par
\tab\tab\par
\tab\tab case RED:\tab return CC_Team_Info(  id, iType, TeamName[ 1 ]  );\par
\tab\tab case BLUE:\tab return CC_Team_Info(  id, iType, TeamName[ 2 ]  );\par
\tab\tab case GREY:\tab return CC_Team_Info(  id, iType, TeamName[ 0 ]  );\par
\par
\tab\}\par
\par
\tab return 0;\par
\}\par
\par
CC_FindPlayer(  )\par
\{\par
\tab new iMaxPlayers  =  get_maxplayers(  );\par
\tab\par
\tab for( new i = 1; i <= iMaxPlayers; i++ )\par
\tab\tab if(  is_user_connected( i )  )\par
\tab\tab\tab return i;\par
\tab\par
\tab return -1;\par
\}\par
// --| CC_ColorChat.\par
}
Last edited by KrAiD. on 20 Oct 2013, 13:07, edited 1 time in total.
Reason: Data viitoare foloseste [Sursa][/Sursa]
User avatar
Rap^
Membru, skill +2
Membru, skill +2
Posts: 621
Joined: 01 Oct 2011, 00:25
Detinator Steam: Da
Reputatie: Fost Scripter eXtreamCS
Fost Super moderator
Location: Bucuresti
Has thanked: 16 times
Been thanked: 156 times

20 Oct 2013, 14:42

Nu inteleg cum au ajuns toate acele \tab si \par acolo dar ti le-am scos eu..
| Afiseaza codul
#include < amxmodx >
#include < cstrike >

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

#pragma semicolon 1

#define	 MAX_GROUPS	 12


// --| 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 ][ ] =
{
	 "[DetinatoR]",
	 "[OwneR+Vip]",
	 "[Co-OwneR+Vip]",
	 "[Co-Owner]",
	 "[Moderator+Vip]",
	 "[Moderator]",
	 "[Administrator+Vip]",
	 "[Administrator]",
	 "[Helper+Vip]",
            "[Helper]",
            "[V.I.P]",
            "[Slot]"
};

new g_szGroupsFlags[ MAX_GROUPS ][ ] =
{
	 "abcdefghijklmnopqrstu",
	 "bcdefghijklmnopqrst",
	 "bcdefghijlmnopqrstu",
	 "bcdefghijlmnopqrsu",
	 "bcdefghijmnopqrstu",
	 "bcdefghijmnopqrsu",
	 "bcdefhijmnqrsut",
	 "bcdefhijmnqrstu",
	 "bcefhijmnt",
            "bcefhijmn",
            "bit",
            "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,"^x04[%s]^x03 %s^x01: %s", g_szGroups[ i ], szName, szChat );
					 case CS_TEAM_CT:	 ColorChat( 0, BLUE,"^x04[%s]^x03 %s^x01: %s", g_szGroups[ i ], szName, szChat );
					 case CS_TEAM_SPECTATOR:	 ColorChat( 0, GREY,"^x04[%s]^x03 %s^x01: %s", g_szGroups[ i ], szName, 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;
	
	 if( is_user_admin( id ) )
	{
		 static x; x = 0;
		
		 for( x = 0; x < MAX_GROUPS; x++ )
		{
			
			 if( get_user_flags( id ) == g_iGroupsFlagsValues[ x ] )
			{	
				
				 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:		 ColorChat( iPlayer, RED, "^x04[%s] ^x03(Terrorist) %s^x01: %s", g_szGroups[ x ], szName, szChat );
							 case CS_TEAM_CT:	 ColorChat( iPlayer, BLUE, "^x04[%s] ^x03(Counter-Terrorist) %s^x01: %s", g_szGroups[ x ], szName, szChat );
							 case CS_TEAM_SPECTATOR:	 ColorChat( iPlayer, GREY, "^x04[%s] ^x03(Spectator) %s^x01: %s", g_szGroups[ x ], szName, szChat );
						}
					}
				}
				
				 break;
			}
		}
	}
	
	 else
	{
			
		 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:		 ColorChat( iPlayer, RED, "^x03(Terrorist)%s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
					 case CS_TEAM_CT:	 ColorChat( iPlayer, BLUE, "^x03(Counter-Terrorist)%s%s^x01: %s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
					 case CS_TEAM_SPECTATOR:	 ColorChat( iPlayer, GREY, "^x03(Spectator) %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;
}
Imagination is more important than knowledge.
Knowledge is limited - Imagination encircles the world.
Post Reply

Return to “Cereri”

  • Information