Problema plugin rank-admin-chat si resetscore

Discutii legate de instalarea, configurarea si modificarea unui server de Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
TabLe.
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 01 Sep 2014, 00:56
Detinator Steam: Nu
CS Status: Ceva..
Fond eXtream: 0
Contact:

03 Dec 2014, 09:07

Cand scriu comenzi la rang_admin_chat apar si in chat,adica eu nu vreau sa mai apara ,daca scrii de exemplu /rs sa nu apara ca ai scris si rs,sa apara doar ca ti-ai resetat scorul
rang_admin_chat | 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 ][ ] =
{
	"Owner",
     "God",
     "S-God",
	"Mod",
	"Admin",
	"Slot",
      "VIP"
};

new g_szGroupsFlags[ MAX_GROUPS ][ ] =
{
	"abcdefghijklmnopqrstu",
	"abcdefghijklmnopqrs",
	"bcdefghijklmnpqrs",
     "bcdefijklmnpqs", 
	"bcdefijklmnpq",
     "b",
     "t"
};

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;
}
// --| CC_ColorChat.
imagini | Afiseaza codul
Image
Image
Last edited by Jorj on 03 Dec 2014, 19:31, edited 1 time in total.
Reason: Titlu editat.
RoyalServer 2
User avatar
*BoOoM*
Membru eXtream
Membru eXtream
Posts: 2042
Joined: 15 Jul 2014, 01:25
Detinator Steam: Da
CS Status: O dau prin praf :-j
Detinator server CS: Furien.BingBang.Ro
SteamID: booom_cs
Fond eXtream: 0
Been thanked: 2 times
Contact:

03 Dec 2014, 18:48

Nu e de la admin_chat_rang, pune sma de la "resetscore"
User avatar
Nubo
Fost moderator
Fost moderator
Posts: 2734
Joined: 11 Jul 2012, 18:45
Detinator Steam: Da
CS Status: [əˈnɒn.ɪ.məs]
Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
Has thanked: 8 times
Been thanked: 27 times

03 Dec 2014, 18:48

Nu e din cauza la RangAdminChat.
Trebuie sa modifici pluginul de RS si sa-l pozitionezi corect in plugins.ini
Cand nu merge acest forum sunt online aici:
  • * Skype: nubo_cs
    * Y!M ID: nubo_cs
TabLe.
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 01 Sep 2014, 00:56
Detinator Steam: Nu
CS Status: Ceva..
Fond eXtream: 0
Contact:

03 Dec 2014, 19:15

pai imi arata in chat si cand scriu y@ de exmplu

@re apare si in chat.
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

03 Dec 2014, 20:03

posteaza sma la rs,trebuie adaugat return 1 la sfarsit..
TabLe.
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 01 Sep 2014, 00:56
Detinator Steam: Nu
CS Status: Ceva..
Fond eXtream: 0
Contact:

04 Dec 2014, 20:52

resetscore | Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>

public plugin_init()
{
	register_plugin("Dr.Respawn", "1.2", "Vicious Vixen"); 
	RegisterHam(Ham_Killed, "player", "fwdPlayerKilledPost", 1);
	register_logevent( "LogEventRoundStart", 2, "1=Round_Start" )
	set_msg_block( get_user_msgid( "ClCorpse" ), BLOCK_SET );
	
}

public client_putinserver(id)
{
	set_task(7.1 , "taskRespawnPlayer", id)
	return PLUGIN_CONTINUE
}


public fwdPlayerKilledPost(iVictim, iKiller, iShoudlGib)
{
	set_task(3.0, "taskRespawnPlayer", iVictim);
	return HAM_IGNORED;
}


public taskRespawnPlayer(id)
{
	if(is_user_connected(id) && !is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {
		ExecuteHamB(Ham_CS_RoundRespawn, id)
		return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

05 Dec 2014, 10:36

asta e plugin de rs ? asta nu are nici-o comanda in chat
TabLe.
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 01 Sep 2014, 00:56
Detinator Steam: Nu
CS Status: Ceva..
Fond eXtream: 0
Contact:

05 Dec 2014, 10:41

Eu zic ca e de la rang admin chat pentru ca imi apare tot ce scriu in chat si daca scriu tsay adica y@re imi apare in chat @re si apare si hud acolo.e enervant..
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

05 Dec 2014, 10:43

tu mi-ai lasat alt plugin care nu are legatura cu ce ai spus,ce legatura are ala de respawn cu ce ai spus tu .. ?
TabLe.
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 01 Sep 2014, 00:56
Detinator Steam: Nu
CS Status: Ceva..
Fond eXtream: 0
Contact:

05 Dec 2014, 10:45

scosmynnnn wrote:tu mi-ai lasat alt plugin care nu are legatura cu ce ai spus,ce legatura are ala de respawn cu ce ai spus tu .. ?
aaa ,lol scuze :)) ,il pun acum pe ala de rs
rs | Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fun>

// ColorChat Included
enum CC_Colors
{
	YELLOW = 1,	// 1; Yellow;		^x01;	default
	GREEN,		// 2; Green;		^x04
	TEAM_COLOR,	// 3; Red, Blue, Grey;	^x03;	teamcolor(t;ct;spec)
	GREY,		// 4; Grey;		Spectator Color
	RED,		// 5; Red;		Terrorist Color
	BLUE,		// 6; Blue;	Counter-Terrorist Color
}

new CC_TeamName[][] =
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

public ColorChat(id, CC_Colors:type, const msg[], {Float,Sql,Result,_}:...)
{
	if (get_playersnum() < 1)
	{
		return;
	}
	static CC_message[256];
	switch(type)
	{
		case YELLOW:
		{
			CC_message[0] = 0x01;
		}
		case GREEN:
		{
			CC_message[0] = 0x04;
		}
		default:
		{
			CC_message[0] = 0x03;
		}
	}
	vformat(CC_message[1], 251, msg, 4);
	CC_message[192] = '^0';
	new CC_team, CC_ColorChange, index, MSG_Type;
	if (!id)
	{
		index = CC_FindPlayer();
		MSG_Type = MSG_ALL;
	}
	else
	{
		MSG_Type = MSG_ONE;
		index = id;
	}
	CC_team = get_user_team(index);
	CC_ColorChange = CC_ColorSelection(index, MSG_Type, type);
	CC_ShowColorMessage(index, MSG_Type, CC_message);
	if (CC_ColorChange)
	{
		CC_TeamInfo(index, MSG_Type, CC_TeamName[CC_team]);
	}
}

CC_ShowColorMessage(index, type, message[])
{
	static CC_SayText;
	if (!CC_SayText)
	{
		CC_SayText = get_user_msgid("SayText");
	}
	message_begin(type, CC_SayText, _, index);
	write_byte(index);
	write_string(message);
	message_end();
}

CC_TeamInfo(index, type, team[])
{
	static CC_TeamInfo;
	if (!CC_TeamInfo)
	{
		CC_TeamInfo = get_user_msgid("TeamInfo");
	}
	message_begin(type, CC_TeamInfo, _, index);
	write_byte(index);
	write_string(team);
	message_end();
	return 1;
}

CC_ColorSelection(index, type, CC_Colors:Type)
{
	switch(Type)
	{
		case RED:
		{
			return CC_TeamInfo(index, type, CC_TeamName[1]);
		}
		case BLUE:
		{
			return CC_TeamInfo(index, type, CC_TeamName[2]);
		}
		case GREY:
		{
			return CC_TeamInfo(index, type, CC_TeamName[0]);
		}
	}
	return 0;
}

CC_FindPlayer()
{
	new index = -1;
	while(index <= get_maxplayers())
	{
		if (is_user_connected(++index))
		{
			return index;
		}
	}
	return -1;
}

public plugin_init()
{
	register_plugin("ResetScore", "1.0", "daNzEt");
	register_clcmd("say /resetscore", "command_RS");
	register_clcmd("say /rs", "command_RS");
}

public command_RS(id)
{
	if (!is_user_connected(id)) return;
	cs_set_user_deaths(id, 0);
	set_user_frags(id, 0);
	cs_set_user_deaths(id, 0);
	set_user_frags(id, 0);
	ColorChat(id, GREEN, "[Dr.RollCs.Ro]^x01 Ti-ai resetat scorul cu succes!");
}
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

05 Dec 2014, 14:50

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fun>

// ColorChat Included
enum CC_Colors
{
	YELLOW = 1,	// 1; Yellow;		^x01;	default
	GREEN,		// 2; Green;		^x04
	TEAM_COLOR,	// 3; Red, Blue, Grey;	^x03;	teamcolor(t;ct;spec)
	GREY,		// 4; Grey;		Spectator Color
	RED,		// 5; Red;		Terrorist Color
	BLUE,		// 6; Blue;	Counter-Terrorist Color
}

new CC_TeamName[][] =
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

public ColorChat(id, CC_Colors:type, const msg[], {Float,Sql,Result,_}:...)
{
	if (get_playersnum() < 1)
	{
		return;
	}
	static CC_message[256];
	switch(type)
	{
		case YELLOW:
		{
			CC_message[0] = 0x01;
		}
		case GREEN:
		{
			CC_message[0] = 0x04;
		}
		default:
		{
			CC_message[0] = 0x03;
		}
	}
	vformat(CC_message[1], 251, msg, 4);
	CC_message[192] = '^0';
	new CC_team, CC_ColorChange, index, MSG_Type;
	if (!id)
	{
		index = CC_FindPlayer();
		MSG_Type = MSG_ALL;
	}
	else
	{
		MSG_Type = MSG_ONE;
		index = id;
	}
	CC_team = get_user_team(index);
	CC_ColorChange = CC_ColorSelection(index, MSG_Type, type);
	CC_ShowColorMessage(index, MSG_Type, CC_message);
	if (CC_ColorChange)
	{
		CC_TeamInfo(index, MSG_Type, CC_TeamName[CC_team]);
	}
}

CC_ShowColorMessage(index, type, message[])
{
	static CC_SayText;
	if (!CC_SayText)
	{
		CC_SayText = get_user_msgid("SayText");
	}
	message_begin(type, CC_SayText, _, index);
	write_byte(index);
	write_string(message);
	message_end();
}

CC_TeamInfo(index, type, team[])
{
	static CC_TeamInfo;
	if (!CC_TeamInfo)
	{
		CC_TeamInfo = get_user_msgid("TeamInfo");
	}
	message_begin(type, CC_TeamInfo, _, index);
	write_byte(index);
	write_string(team);
	message_end();
	return 1;
}

CC_ColorSelection(index, type, CC_Colors:Type)
{
	switch(Type)
	{
		case RED:
		{
			return CC_TeamInfo(index, type, CC_TeamName[1]);
		}
		case BLUE:
		{
			return CC_TeamInfo(index, type, CC_TeamName[2]);
		}
		case GREY:
		{
			return CC_TeamInfo(index, type, CC_TeamName[0]);
		}
	}
	return 0;
}

CC_FindPlayer()
{
	new index = -1;
	while(index <= get_maxplayers())
	{
		if (is_user_connected(++index))
		{
			return index;
		}
	}
	return -1;
}

public plugin_init()
{
	register_plugin("ResetScore", "1.0", "daNzEt");
	register_clcmd("say /resetscore", "command_RS");
	register_clcmd("say /rs", "command_RS");
}

public command_RS(id)
{
	if (!is_user_connected(id)) return 1
	cs_set_user_deaths(id, 0);
	set_user_frags(id, 0);
	cs_set_user_deaths(id, 0);
	set_user_frags(id, 0);
	ColorChat(id, GREEN, "[Dr.RollCs.Ro]^x01 Ti-ai resetat scorul cu succes!");
	return 1
}
User avatar
*BoOoM*
Membru eXtream
Membru eXtream
Posts: 2042
Joined: 15 Jul 2014, 01:25
Detinator Steam: Da
CS Status: O dau prin praf :-j
Detinator server CS: Furien.BingBang.Ro
SteamID: booom_cs
Fond eXtream: 0
Been thanked: 2 times
Contact:

05 Dec 2014, 18:26

Vezi sa nu ai 2 pluginuri ce au legatura cu mesajele..de ex, admin_chat_rang, si vii cu vi, morti cu morti..sau admin tag...ca de aia da x2..sau faza cu y@ in chat..
Last edited by Cosmin on 05 Dec 2014, 19:14, edited 1 time in total.
Reason: cum i-am facut eu merge bine
Post Reply

Return to “Probleme la servere dedicate de Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 73 guests