[rezolvat] 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
Dragos1123
Membru, skill 0
Membru, skill 0
Posts: 25
Joined: 06 Oct 2013, 21:25
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: Hitman.Freakz.Ro
SteamID: Maniacu2
Has thanked: 13 times
Contact:

17 Nov 2013, 23:29

Salut as vrea si eu acest plugin : rank admin chat.. Ms
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#define MAX_GROUPS 14
new g_groupNames[MAX_GROUPS][] = {
"Bo$$$+VIP",
"Owner",
"God+VIP",
"God",
"SuperMod+VIP",
"SuperMod",
"Moderator+VIP",
"Moderator",
"Administrator+VIP",
"Administrator",
"Helper+VIP",
"Helper",
"VIP",
"Slot"
}

new g_groupFlags[MAX_GROUPS][] = {
"abcdefghijklmnopqrstu",
"abcdefghijklmnopqrsu",
"bcdefgijklmnopqrstu",
"bcdAefgijklmnopqrsu",
"bcdefijmnopt",
"bcdefijmnop",
"bcdefijmnot",
"bcdefijmno",
"bcdefijmnt",
"bcdefijmn",
"bcefijmt",
"bcefijm",
"bt",
"b"
}

new g_groupFlagsValue[MAX_GROUPS]
public plugin_init() {
register_plugin("Admin Who", "1.0", "PropheT")
register_concmd("admin_who", "cmdWho", 0)
register_concmd("amx_who", "cmdWho", 0)
register_concmd("amx_admins", "cmdWho", 0)
for(new i = 0; i < MAX_GROUPS; i++) {
g_groupFlagsValue = read_flags(g_groupFlags)
}
}
public cmdWho(id) {
new players[32], inum, player, name[32], i, a
get_players(players, inum)
console_print(id, "--==Admini==--")
for(i = 0; i < MAX_GROUPS; i++) {
console_print(id, "-----[%d]%s-----", i+1, g_groupNames)
for(a = 0; a < inum; ++a) {
player = players[a]
get_user_name(player, name, 31)
if(get_user_flags(player) == g_groupFlagsValue) {
console_print(id, "%s", name)
}
}
}
console_print(id, "--==Admini==--")
return PLUGIN_HANDLED
}
RoyalServer
User avatar
Lothbrok
Membru, skill +1
Membru, skill +1
Posts: 366
Joined: 01 Jan 2013, 15:04
Detinator Steam: Da
Detinator server CS: Te intereseaza?
SteamID: Te intereseaza?
Reputatie: Fost Moderator ajutator
Membru club eXtreamCS (3 luni)
Nume anterior: Vechy!
Restrictie moderator
Location: Constanta
Been thanked: 36 times
Contact:

18 Nov 2013, 10:57

Fii mai exact ca sa stiu si eu ce sa fac? Ai pus un fisier sma .
http://svx.ro - MasterServer in teste.
http://cs16-download.com - Download CS 1.6
http://download-cs16.biz - Download CS 1.6
http://download-cs16.eu - Download CS 1.6
http://download-cs16.org - Download CS 1.6
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:

18 Nov 2013, 11:00

Ai gradele + accesele ce vrei la el mai exact? Trebuie compilat si atata tot
no...
Dragos1123
Membru, skill 0
Membru, skill 0
Posts: 25
Joined: 06 Oct 2013, 21:25
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: Hitman.Freakz.Ro
SteamID: Maniacu2
Has thanked: 13 times
Contact:

18 Nov 2013, 12:31

Sa aibe fiecare grad culoarea lui cand scrie pe "say"

Daca se poate. Multumesc!
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 11:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times

18 Nov 2013, 13:26

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

#include < amxmodx >


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

#pragma semicolon 1

#define	MAX_GROUPS	14


// --| 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.


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

new g_szGroups[ MAX_GROUPS ][ ] =
{
	"Bo$$$+VIP",
	"Owner",
	"God+VIP",
	"God",
	"SuperMod+VIP",
	"SuperMod",
	"Moderator+VIP",
	"Moderator",
	"Administrator+VIP",
	"Administrator",
	"Helper+VIP",
	"Helper",
	"VIP",
	"Slot"
};

new g_szGroupsFlags[ MAX_GROUPS ][ ] =
{
	"abcdefghijklmnopqrstu",
	"abcdefghijklmnopqrsu",
	"bcdefgijklmnopqrstu",
	"bcdAefgijklmnopqrsu",
	"bcdefijmnopt",
	"bcdefijmnop",
	"bcdefijmnot",
	"bcdefijmno",
	"bcdefijmnt",
	"bcdefijmn",
	"bcefijmt",
	"bcefijm",
	"bt",
	"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 ) )
	{
		static i; i = 0;
		
		for( i = 0; i < MAX_GROUPS; i++ )
		{
			
			if( get_user_flags( id ) == g_iGroupsFlagsValues[ i ] )
			{
				
				switch( 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( 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;
	if( is_user_admin( id ) )
	{
		static x; x = 0;
		
		for( x = 0; x < MAX_GROUPS; i++ )
		{
			
			if( get_user_flags( id ) == g_iGroupsFlagsValues[ x ] )
			{	
	
				for( 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, "^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( get_user_team( id ) == get_user_team( iPlayer ) )
			{
				switch( 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;
}
// --| CC_ColorChat.
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
User avatar
R1kKk-
Membru, skill +1
Membru, skill +1
Posts: 178
Joined: 12 Apr 2013, 16:57
Detinator Steam: Da
CS Status: Batman!
Detinator server CS: HNS.JOINET.RO
SteamID: Privat...
Has thanked: 20 times
Been thanked: 17 times
Contact:

18 Nov 2013, 13:27

Nu e posibil asa ceva.
In chat poti sa scrii doar verde, rosu/albastru si con_color-u jucatorului.(galben,alb etc...)
Image Image Image
Dragos1123
Membru, skill 0
Membru, skill 0
Posts: 25
Joined: 06 Oct 2013, 21:25
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: Hitman.Freakz.Ro
SteamID: Maniacu2
Has thanked: 13 times
Contact:

18 Nov 2013, 19:20

ok ms
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests