Furien Anti-Camp [ v0.2.1 ][NEW]

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
GE NI
Membru, skill +1
Membru, skill +1
Posts: 186
Joined: 12 Jun 2013, 22:48
Detinator Steam: Nu
Location: Albania
Has thanked: 43 times
Contact:

20 Jul 2013, 17:58

Askhanar wrote:Descriere:
Plugin creat in urma solicitarii acestuia ( . ).
Acest este un plugin Anti-Camp specific modului Furien.
Jucatorii care stau nemiscati ( nu apasa W | A | S | D ) timp de 5 sau mai multe secunde, vor primi blind pana cand se vor misca.
In primele 25 de secunde dupa fiecare spawn.. jucatorii care stau afk mai mult de 5 secunde primesc blind.. si apoi sunt avertizati cum ca daca nici in urmatoarele 5 secunde nu se vor misca, vor primi slay.

Nu ma prea pricep la explicatii.. mai bine dati click pe link-ul de mai sus, acolo unde a fost solicitat plugin-ul.

Descarcare: Acest plugin necesita compilarea locala!
Furien_Anti-Camp.sma | Afiseaza codul
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

#pragma semicolon 1


#define PLUGIN "Furien Anti-Camp"
#define VERSION "0.0.1"

// --|Pentru teste.. cateva mesajela fiecare functie.. sa imi dau seama unde si ce nu merge.
// --|Lasati // in fata!
//#define TESTING

#define TASK_SPAWN	06081993

// --| 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"
};
// --| ColorChat.

new const g_szTag[ ] = "[Furien Anti-Camp]";
new const g_szClassName[ ] = "Askhanar's_MagicEntity";

new Float:g_fUserOrigin[ 33 ][ 3 ];
new Float:g_fUserOldOrigin[ 33 ][ 3 ];

new bool:g_bSpawnCheckEnabled = false;

new bool:g_bAlive[ 33 ];
new bool:g_bConnected[ 33 ];
new bool:g_bUserIsCamping[ 33 ];

new g_iUserCampSeconds[ 33 ];
new g_iMagicEntity;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	register_event( "HLTV", "ev_HookRoundStart", "a", "1=0", "2=0" );
	
	RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawnPost", true );
	RegisterHam( Ham_Killed, "player", "Ham_PlayerKilledPost", true );
	
	
	new iEnt;
	CreateMagicEntity:
	
	iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );
	if( !iEnt || !pev_valid( iEnt ) )
		goto CreateMagicEntity;
	
	set_pev( iEnt, pev_classname, g_szClassName );
	set_pev( iEnt, pev_nextthink, get_gametime(  ) + 0.3 );
	register_forward( FM_Think, "FM_MagicEntityThink" );
	
	g_iMagicEntity = iEnt;
	
}

public client_putinserver( id )
{
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
	
	g_bConnected[ id ] = true;
	g_bAlive[ id ] = false;
	g_bUserIsCamping[ id ] = false;

	// --| Stupid compiler..
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
	
	
	g_bConnected[ id ] = false;
	g_bAlive[ id ] = false;
	g_bUserIsCamping[ id ] = false;
	
	// --| Stupid compiler..
	return PLUGIN_CONTINUE;
}

public Ham_PlayerSpawnPost( id )
{
	if( !is_user_alive( id ) )
		return HAM_IGNORED;
		
	#if defined TESTING
	client_print( 0, print_chat, "Functia PlayerSpawn a fost chemata!" );
	#endif
	g_bAlive[ id ] = true;
	g_bUserIsCamping[ id ] = false;
	g_iUserCampSeconds[ id ] = 0;
	
	return HAM_IGNORED;
}

public Ham_PlayerKilledPost( id )
{
	#if defined TESTING
	client_print( 0, print_chat, "Functia PlayerKilled a fost chemata!" );
	#endif
	g_bAlive[ id ] = false;
}

public ev_HookRoundStart( )
{
	remove_task( TASK_SPAWN );
	
	#if defined TESTING
	client_print( 0, print_chat, "Functia RoundRestart a fost chemata!" );
	#endif
	
	g_bSpawnCheckEnabled = true;
	set_task( 25.0, "TaskDisableSpawnCheck", TASK_SPAWN );
}

public TaskDisableSpawnCheck( )
{
	#if defined TESTING
	client_print( 0, print_chat, "Functia DisableSpawn a fost chemata!" );
	#endif
	g_bSpawnCheckEnabled = false;
}

public FM_MagicEntityThink( iEnt )
{
	
	if( iEnt != g_iMagicEntity || !pev_valid( iEnt ) )
		return FMRES_IGNORED;
		
	set_pev( iEnt, pev_nextthink, get_gametime(  ) + 1.0 );

		
	#if defined TESTING
	client_print( 0, print_chat, "Entitatea gandeste!" );
	#endif
	
	static iPlayers[ 32 ];
	static iPlayersNum;
	
	get_players( iPlayers, iPlayersNum, "ce", "CT" );
	if( !iPlayersNum )
		return FMRES_IGNORED;
		
	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];
		
		if( g_bConnected[ id ] )
		{
			if( g_bAlive[ id ] )
			{
				pev( id, pev_origin, g_fUserOrigin[ id ] );
					
				if( g_fUserOrigin[ id ][ 0 ] == g_fUserOldOrigin[ id ][ 0 ]
					&& g_fUserOrigin[ id ][ 1 ] == g_fUserOldOrigin[ id ][ 1 ]
					&& g_fUserOrigin[ id ][ 2 ] == g_fUserOldOrigin[ id ][ 2 ] )
				{
					g_iUserCampSeconds[ id ]++;
					#if defined TESTING
					client_print( 0, print_chat, "Originile sunt aceleasi!" );
					#endif
					
					if( g_iUserCampSeconds[ id ] == 5 )
					{
						
						#if defined TESTING
						client_print( 0, print_chat, "Ecranul este inegrit!" );
						#endif
						
						g_bUserIsCamping[ id ] = true;
						FadeScreen( id );
					}
					
					else if( g_iUserCampSeconds[ id ] > 5 && g_bSpawnCheckEnabled )
					{
						
						#if defined TESTING
						client_print( 0, print_chat, "Verificare dupa spawn!" );
						#endif
						
						if( g_iUserCampSeconds[ id ] == 11 )
						{
							new szName[ 32 ];
							get_user_name( id, szName, sizeof ( szName ) -1 );
							ColorChat( 0, RED, "^x04%s^x03 %s^x01 a primit slay pentru ca este afk!", g_szTag, szName );
							
							user_silentkill( id );
							
							g_bUserIsCamping[ id ] = false;
							g_iUserCampSeconds[ id ] = 0;
							
							ResetScreen( id );
							
						}
						else
							ColorChat( id, RED, "^x04%s^x01 Vei primi slay in^x03 %i^x01 secund%s daca nu te misti!",
								g_szTag, 11 - g_iUserCampSeconds[ id ], ( 11 - g_iUserCampSeconds[ id ]  ) == 1 ? "a" : "e" );
					}
				}
	
				else if( g_fUserOrigin[ id ][ 0 ] != g_fUserOldOrigin[ id ][ 0 ]
					|| g_fUserOrigin[ id ][ 1 ] != g_fUserOldOrigin[ id ][ 1 ]
					|| g_fUserOrigin[ id ][ 2 ] != g_fUserOldOrigin[ id ][ 2 ] ) 
				{
	
					#if defined TESTING
					client_print( 0, print_chat, "Orinigile nu sunt aceleasi!" );
					#endif
					
					if( g_bUserIsCamping[ id ] )
					{
						
						#if defined TESTING
						client_print( 0, print_chat, "Scoatem blindul!" );
						#endif
						
						ResetScreen( id );
					}
					
					g_iUserCampSeconds[ id ] = 0;
					g_bUserIsCamping[ id ] = false;
				}
			}
		}
		
		#if defined TESTING
		client_print( 0, print_chat, "Origini salvate in globala!" );
		#endif
		
		g_fUserOldOrigin[ id ][ 0 ] = g_fUserOrigin[ id ][ 0 ];
		g_fUserOldOrigin[ id ][ 1 ] = g_fUserOrigin[ id][ 1 ];
		g_fUserOldOrigin[ id ][ 2 ] = g_fUserOrigin[ id ][ 2 ];
	
	}
	
	return FMRES_IGNORED;
}


FadeScreen( id )
{      
	

	message_begin(MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short(1<<0); // fade lasts this long duration 
	write_short(1<<0); // fade lasts this long hold time 
	write_short(1<<2); // fade type HOLD 
	write_byte(0); // fade red 
	write_byte(0); // fade green 
	write_byte(0); // fade blue  
	write_byte(255); // fade alpha  
	message_end();

			
}

ResetScreen( id )
{
	
	message_begin(MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short(1<<12); // fade lasts this long duration  
	write_short(1<<8); // fade lasts this long hold time  
	write_short(1<<1); // fade type OUT 
	write_byte(0); // fade red  
	write_byte(0); // fade green  
	write_byte(0); // fade blue    
	write_byte(255); // fade alpha    
	message_end();
}


// --| 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;
}
// --| ColorChat.
Nume: Furien Anti-Camp
Versiune: 0.0.1
Autor: Askhanar

Instalare:
1. Fisierul Furien_Anti-Camp.sma il puneti in addons/amxmodx/scripting
2. Fisierul Furien_Anti-Camp.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

Furien_Anti-Camp.amxx
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- fakemeta
- hamsandwich

Imagini: Urmeaza sa adaug.

can you give me an english version pls
if you can
RoyalServer 2
User avatar
Ulquiorra
Fost moderator
Fost moderator
Posts: 2053
Joined: 25 Jul 2010, 17:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Fost Scripter eXtreamCS
Fost Moderator ajutator
Nick anterior: Askhanar
Location: Braila, Romania.
Has thanked: 215 times
Been thanked: 1132 times

20 Jul 2013, 23:56

RO Description | Afiseaza codul
Acest este un plugin Anti-Camp specific modului Furien.
Jucatorii care stau nemiscati ( nu apasa W | A | S | D ) timp de 5 sau mai multe secunde, vor primi blind pana cand se vor misca.
In primele 25 de secunde dupa fiecare spawn.. jucatorii care stau afk mai mult de 5 secunde primesc blind.. si apoi sunt avertizati cum ca daca nici in urmatoarele 5 secunde nu se vor misca, vor primi slay.
-->
EN Description | Afiseaza codul
This is an Anti-Camp plugin for furien mod.
Players that are not moving ( they're not holding any of W | A | S | D key ) for more than 5 seconds will get blinded untill they will.
In the first 25 seconds after every spawn.. players that are afk more than 5 seconds will get blinded..then they'll be warned that if they don't move in next 5 seconds will be slayed.
EN plugin version | Afiseaza codul
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

#pragma semicolon 1


#define PLUGIN "Furien Anti-Camp"
#define VERSION "0.0.1"

// --|Pentru teste.. cateva mesajela fiecare functie.. sa imi dau seama unde si ce nu merge.
// --|Lasati // in fata!
//#define TESTING

#define TASK_SPAWN	06081993

// --| 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"
};
// --| ColorChat.

new const g_szTag[ ] = "[Furien Anti-Camp]";
new const g_szClassName[ ] = "Askhanar's_MagicEntity";

new Float:g_fUserOrigin[ 33 ][ 3 ];
new Float:g_fUserOldOrigin[ 33 ][ 3 ];

new bool:g_bSpawnCheckEnabled = false;

new bool:g_bAlive[ 33 ];
new bool:g_bConnected[ 33 ];
new bool:g_bUserIsCamping[ 33 ];

new g_iUserCampSeconds[ 33 ];
new g_iMagicEntity;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	register_event( "HLTV", "ev_HookRoundStart", "a", "1=0", "2=0" );
	
	RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawnPost", true );
	RegisterHam( Ham_Killed, "player", "Ham_PlayerKilledPost", true );
	
	
	new iEnt;
	CreateMagicEntity:
	
	iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );
	if( !iEnt || !pev_valid( iEnt ) )
		goto CreateMagicEntity;
	
	set_pev( iEnt, pev_classname, g_szClassName );
	set_pev( iEnt, pev_nextthink, get_gametime(  ) + 0.3 );
	register_forward( FM_Think, "FM_MagicEntityThink" );
	
	g_iMagicEntity = iEnt;
	
}

public client_putinserver( id )
{
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
	
	g_bConnected[ id ] = true;
	g_bAlive[ id ] = false;
	g_bUserIsCamping[ id ] = false;

	// --| Stupid compiler..
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
	
	
	g_bConnected[ id ] = false;
	g_bAlive[ id ] = false;
	g_bUserIsCamping[ id ] = false;
	
	// --| Stupid compiler..
	return PLUGIN_CONTINUE;
}

public Ham_PlayerSpawnPost( id )
{
	if( !is_user_alive( id ) )
		return HAM_IGNORED;
		
	#if defined TESTING
	client_print( 0, print_chat, "Functia PlayerSpawn a fost chemata!" );
	#endif
	g_bAlive[ id ] = true;
	g_bUserIsCamping[ id ] = false;
	g_iUserCampSeconds[ id ] = 0;
	
	return HAM_IGNORED;
}

public Ham_PlayerKilledPost( id )
{
	#if defined TESTING
	client_print( 0, print_chat, "Functia PlayerKilled a fost chemata!" );
	#endif
	g_bAlive[ id ] = false;
}

public ev_HookRoundStart( )
{
	remove_task( TASK_SPAWN );
	
	#if defined TESTING
	client_print( 0, print_chat, "Functia RoundRestart a fost chemata!" );
	#endif
	
	g_bSpawnCheckEnabled = true;
	set_task( 25.0, "TaskDisableSpawnCheck", TASK_SPAWN );
}

public TaskDisableSpawnCheck( )
{
	#if defined TESTING
	client_print( 0, print_chat, "Functia DisableSpawn a fost chemata!" );
	#endif
	g_bSpawnCheckEnabled = false;
}

public FM_MagicEntityThink( iEnt )
{
	
	if( iEnt != g_iMagicEntity || !pev_valid( iEnt ) )
		return FMRES_IGNORED;
		
	set_pev( iEnt, pev_nextthink, get_gametime(  ) + 1.0 );

		
	#if defined TESTING
	client_print( 0, print_chat, "Entitatea gandeste!" );
	#endif
	
	static iPlayers[ 32 ];
	static iPlayersNum;
	
	get_players( iPlayers, iPlayersNum, "ce", "CT" );
	if( !iPlayersNum )
		return FMRES_IGNORED;
		
	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];
		
		if( g_bConnected[ id ] )
		{
			if( g_bAlive[ id ] )
			{
				pev( id, pev_origin, g_fUserOrigin[ id ] );
					
				if( g_fUserOrigin[ id ][ 0 ] == g_fUserOldOrigin[ id ][ 0 ]
					&& g_fUserOrigin[ id ][ 1 ] == g_fUserOldOrigin[ id ][ 1 ]
					&& g_fUserOrigin[ id ][ 2 ] == g_fUserOldOrigin[ id ][ 2 ] )
				{
					g_iUserCampSeconds[ id ]++;
					#if defined TESTING
					client_print( 0, print_chat, "Originile sunt aceleasi!" );
					#endif
					
					if( g_iUserCampSeconds[ id ] == 5 )
					{
						
						#if defined TESTING
						client_print( 0, print_chat, "Ecranul este inegrit!" );
						#endif
						
						g_bUserIsCamping[ id ] = true;
						FadeScreen( id );
					}
					
					else if( g_iUserCampSeconds[ id ] > 5 && g_bSpawnCheckEnabled )
					{
						
						#if defined TESTING
						client_print( 0, print_chat, "Verificare dupa spawn!" );
						#endif
						
						if( g_iUserCampSeconds[ id ] == 11 )
						{
							new szName[ 32 ];
							get_user_name( id, szName, sizeof ( szName ) -1 );
							ColorChat( 0, RED, "^x04%s^x03 %s^x01 got slayed for being afk!", g_szTag, szName );
							
							user_silentkill( id );
							
							g_bUserIsCamping[ id ] = false;
							g_iUserCampSeconds[ id ] = 0;
							
							ResetScreen( id );
							
						}
						else
							ColorChat( id, RED, "^x04%s^x01 You will be slayed in^x03 %i^x01 second%s if you don't move!",
								g_szTag, 11 - g_iUserCampSeconds[ id ], ( 11 - g_iUserCampSeconds[ id ]  ) == 1 ? "" : "s" );
					}
				}
	
				else if( g_fUserOrigin[ id ][ 0 ] != g_fUserOldOrigin[ id ][ 0 ]
					|| g_fUserOrigin[ id ][ 1 ] != g_fUserOldOrigin[ id ][ 1 ]
					|| g_fUserOrigin[ id ][ 2 ] != g_fUserOldOrigin[ id ][ 2 ] ) 
				{
	
					#if defined TESTING
					client_print( 0, print_chat, "Orinigile nu sunt aceleasi!" );
					#endif
					
					if( g_bUserIsCamping[ id ] )
					{
						
						#if defined TESTING
						client_print( 0, print_chat, "Scoatem blindul!" );
						#endif
						
						ResetScreen( id );
					}
					
					g_iUserCampSeconds[ id ] = 0;
					g_bUserIsCamping[ id ] = false;
				}
			}
		}
		
		#if defined TESTING
		client_print( 0, print_chat, "Origini salvate in globala!" );
		#endif
		
		g_fUserOldOrigin[ id ][ 0 ] = g_fUserOrigin[ id ][ 0 ];
		g_fUserOldOrigin[ id ][ 1 ] = g_fUserOrigin[ id][ 1 ];
		g_fUserOldOrigin[ id ][ 2 ] = g_fUserOrigin[ id ][ 2 ];
	
	}
	
	return FMRES_IGNORED;
}


FadeScreen( id )
{      
	

	message_begin(MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short(1<<0); // fade lasts this long duration 
	write_short(1<<0); // fade lasts this long hold time 
	write_short(1<<2); // fade type HOLD 
	write_byte(0); // fade red 
	write_byte(0); // fade green 
	write_byte(0); // fade blue  
	write_byte(255); // fade alpha  
	message_end();

			
}

ResetScreen( id )
{
	
	message_begin(MSG_ONE, get_user_msgid( "ScreenFade" ), _, id );
	write_short(1<<12); // fade lasts this long duration  
	write_short(1<<8); // fade lasts this long hold time  
	write_short(1<<1); // fade type OUT 
	write_byte(0); // fade red  
	write_byte(0); // fade green  
	write_byte(0); // fade blue    
	write_byte(255); // fade alpha    
	message_end();
}


// --| 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;
}
// --| ColorChat.
Caut o persoana dedicata care se pricepe si stie ce face.
Vreau sa creeze si sa se ocupe de administrarea unui server de MU, da e vorba de vechiul joc..ma gandesc undeva la un season 3 ep1/2.

O sa achizitionez un domeniu .ro.
Totodata sponsorizez absolut orice este necesar.
Ma puteti contacta prin: http://solo.to/stfrzv
Flightwow
Membru, skill +1
Membru, skill +1
Posts: 184
Joined: 31 Jan 2012, 21:52
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: DA
Has thanked: 18 times
Been thanked: 1 time
Contact:

23 Jul 2013, 11:17

bun plugin GJ /:)
adriano23
Membru, skill 0
Membru, skill 0
Posts: 8
Joined: 03 Nov 2013, 15:56
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 5 times
Been thanked: 1 time
Contact:

03 Nov 2013, 16:42

nu vad link de download :(
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:

03 Nov 2013, 17:12

Ai sursa in post, apasa pe acel buton sub Download si compileaza local.
User avatar
TGP
Membru, skill +1
Membru, skill +1
Posts: 426
Joined: 26 Oct 2013, 18:34
Detinator Steam: Da
Detinator server CS: Da
Location: Bucureşti
Been thanked: 140 times
Contact:

04 Nov 2013, 01:13

Interesant pluginul şi se poate folosi şi la alte moduri nu numai la furien.
RoCoFeLu
Membru, skill +1
Membru, skill +1
Posts: 284
Joined: 21 Oct 2009, 03:51
Detinator Steam: Nu
Has thanked: 56 times
Been thanked: 6 times

10 Dec 2013, 00:39

Cum pot modifica in asa fel incat sa se aplice doar la Anti-Furieni (Counter-Strike), NU si la furieni.
Si cum pot pune imunitate celor cu flagul S?
RoCoFeLu
Membru, skill +1
Membru, skill +1
Posts: 284
Joined: 21 Oct 2009, 03:51
Detinator Steam: Nu
Has thanked: 56 times
Been thanked: 6 times

12 Dec 2013, 20:09

Nimeni?
RoCoFeLu
Membru, skill +1
Membru, skill +1
Posts: 284
Joined: 21 Oct 2009, 03:51
Detinator Steam: Nu
Has thanked: 56 times
Been thanked: 6 times

18 Dec 2013, 17:06

UP, inca as mai avea nevoie.
User avatar
First Time
Membru, skill +1
Membru, skill +1
Posts: 113
Joined: 05 Feb 2014, 19:38
Detinator Steam: Da
Has thanked: 16 times
Been thanked: 7 times
Contact:

19 Mar 2014, 17:26

La mine nu se compileaza ! are eroare fatala !
Last edited by Ulquiorra on 19 Mar 2014, 21:33, edited 1 time in total.
Reason: trebuie sa pui CC_ColorChat in scripting/includes.
connect furien.watf.ro — Powered by WATF.ro
User avatar
luciansefu9
Membru, skill +1
Membru, skill +1
Posts: 107
Joined: 05 Nov 2013, 19:05
Detinator Steam: Da
CS Status: Invat scripting!
Detinator server CS: da da nu hostat
SteamID: luciansefu9
Has thanked: 9 times
Been thanked: 3 times
Contact:

21 Mar 2014, 11:35

In sfarsit il gasesc majoritatea nu functioneaza ms mult ! :">
TeKtoniKkk
Membru, skill 0
Membru, skill 0
Posts: 9
Joined: 05 Jul 2014, 23:41
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

21 Aug 2014, 22:37

Functioneaza si la ct si la terro :))
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests