Adăugare /knife /on şi /off în sma.

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Freezy.
Membru, skill +1
Membru, skill +1
Posts: 385
Joined: 21 Feb 2016, 14:12
Detinator Steam: Da
Detinator server CS: SUD.LEAGUECS.RO
SteamID: /id/fzind/
Fond eXtream: 0
Location: Constanţa
Has thanked: 2 times
Contact:

28 Mar 2020, 12:15

Salutare, îmi poate adăuga cineva pluginul de /knife /on şi /off în sma-ul următor?:
La /kinife aş vrea să fie şi cu un mic mesaj în chat, a fost pornită runda de lame (am transferarea jucătorilor la spec, deci am nevoie doar de /knife sau /lame pentru a nu le permite jucatorilor să folosească alt ceva decât lamele.
mix.sma | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <colorchat>

#define PLUGIN "Meniu MIX"
#define VERSION "1.8"
#define AUTHOR "Edii"

new dem, pw,cmdpre,sfarsit
new demprefix[32],pwmix[32],cmdprefix[32],sfarsitmix[32]
new pwon = 0
new teamA = 0
new teamB = 0
new mixon = 0
new schimbate = 0

public plugin_init()
{
	// Meniu mix
	
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /mixmenu", "mixmenu", ADMIN_KICK)
	register_clcmd("say .mixmenu", "mixmenu", ADMIN_KICK)
	register_clcmd("say_team /mixmenu", "mixmenu", ADMIN_KICK)
	register_clcmd("say_team .mixmenu", "mixmenu", ADMIN_KICK)
	
	// Warm   
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /warm", "warm", ADMIN_KICK)
	register_clcmd("say .warm", "warm", ADMIN_KICK)
	register_clcmd("say_team /warm", "warm", ADMIN_KICK)
	register_clcmd("say_team .warm", "warm", ADMIN_KICK)
	
	// Alegeri   
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /alegeri", "alegeri", ADMIN_KICK)
	register_clcmd("say .alegeri", "alegeri", ADMIN_KICK)
	register_clcmd("say_team /alegeri", "alegeri", ADMIN_KICK)
	register_clcmd("say_team .alegeri", "alegeri", ADMIN_KICK)
	
	// Start Mix
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /start", "startmix", ADMIN_KICK)
	register_clcmd("say .start", "startmix", ADMIN_KICK)
	register_clcmd("say_team /start", "startmix", ADMIN_KICK)
	register_clcmd("say_team .start", "startmix", ADMIN_KICK)
	
	// Change team   
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /changeteam", "schimbari", ADMIN_KICK)
	register_clcmd("say .changeteam", "schimbari", ADMIN_KICK)
	register_clcmd("say_team /changeteam", "schimbari", ADMIN_KICK)
	register_clcmd("say_team .changeteam", "schimbari", ADMIN_KICK)
	
	// Set pw   
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /setpw", "setpw", ADMIN_KICK)
	register_clcmd("say .setpw", "setpw", ADMIN_KICK)
	register_clcmd("say_team /setpw", "setpw", ADMIN_KICK)
	register_clcmd("say_team .setpw", "setpw", ADMIN_KICK)
	
	// Remove pw   
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /removepw", "removepw", ADMIN_KICK)
	register_clcmd("say .removepw", "removepw", ADMIN_KICK)
	register_clcmd("say_team /removepw", "removepw", ADMIN_KICK)
	register_clcmd("say_team .removepw", "removepw", ADMIN_KICK)
	
	// Score   
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say /score", "scor", ADMIN_KICK)
	register_clcmd("say .score", "scor", ADMIN_KICK)
	register_clcmd("say_team /score", "scor", ADMIN_KICK)
	register_clcmd("say_team .score", "scor", ADMIN_KICK)
	
	register_event("HLTV", "new_round", "a", "1=0", "2=0")  
	register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
	register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin")  
	
	dem = register_cvar("amx_demprefix","aimshot")
	pw = register_cvar("amx_pw","mix123")
	cmdpre = register_cvar("amx_cmdprefix","eXtreamCS")
	sfarsit = register_cvar("amx_sfarsitmix","16")
}


public t_win() {
	if ( schimbate == 0 ) {
		teamA = teamA+1
	}
	else {
		teamB = teamB +1   
	}
}

public ct_win() {
	if ( schimbate == 0 ) {
		teamB  = teamB +1
	}
	else {
		teamA = teamA +1
	}
	
}

public new_round(){
	if ( schimbate == 1 )
	{
		get_pcvar_string(sfarsit,sfarsitmix,50);
		if ( teamA + teamB == sfarsit) {
			if ( teamA > teamB ) {
				
				ColorChat(0, GREEN, "^x04 %s //^x01 Mix-ul amical a fost castigat de^x04 ECHIPA A (CTS).", cmdprefix);
				ColorChat(0, GREEN, "^x03[^x04 %s ^x03]^x04 SCOR FINAL ^x03 %d - %d ",cmdprefix, teamA, teamB);
				mixon = 0
			}
			
			if ( teamB > teamA ) {
				ColorChat(0, GREEN, "^x04 %s //^x01 Mix-ul amicat a fost castigat de^x04 ECHIPA B (TS).", cmdprefix);
				ColorChat(0, GREEN, "^x03[^x04 %s ^x03]^x04 SCOR FINAL ^x03 %d - %d ",cmdprefix,teamB,teamA);
				mixon = 0
			}
		}
		
	}
}


public mixmenu(id)
{
	if(!get_user_flags(id) && ADMIN_KICK)
	{
		ColorChat(id, GREEN, "^x04 fun.playarena.ro //^x01 Nu ai acces la acest^x04 meniu.")
		return PLUGIN_HANDLED
	}
	new menu = menu_create("\yFUN.PLAYARENA.RO\r - mixmenu manager^n", "menu_handler")
	menu_additem(menu, "\wRunda de incalzire - \r/warm", "1", 0)
	menu_additem(menu, "\wTransfera spec - \r/alegeri", "2", 0)
	menu_additem(menu, "\wPorneste jocul - \r/start", "3", 0)
	menu_additem(menu, "\wSchimba echipele intre ele - \r/changeteam", "4", 0)
	menu_additem(menu, "\wAdauga parola - \r/setpw", "5", 0)
	menu_additem(menu, "\wScoate parola - \r/removepw", "6", 0)
	menu_additem(menu, "\wAfiseaza scorul - \r/score", "7", 0)
	menu_display(id, menu, 0)
	return PLUGIN_HANDLED
}

public menu_handler(id, menu, item)
{
	if(!get_user_flags(id) && ADMIN_KICK)
	{
		get_pcvar_string(cmdpre,cmdprefix,50);
		ColorChat(0, GREEN, "^x03[^x04 %s ^x03]^x04 Nu ai acces la acest meniu!", cmdprefix);
		return PLUGIN_HANDLED
	}
	
	switch(item)
	{
		case 0:
		{
			client_cmd(0, "ex_interp 0.01");
			client_cmd(0, "rate 25000");
			client_cmd(0, "cl_updaterate 101");
			client_cmd(0, "cl_cmdrate 101");
			client_cmd(0, "fps_max 101");
			
			get_pcvar_string(cmdpre,cmdprefix,50);
			set_cvar_string ( "sv_restart", "1" );
			set_cvar_string ( "mp_freezetime", "0" );
			set_cvar_string ( "mp_startmoney", "16000" );
			mixon = 0;
			schimbate = 0;
			teamA = 0
			teamB = 0
			
			ColorChat(0, GREEN, "^x04 %s //^x01 Runda de incalzire a fost^x04 pornita.", cmdprefix);
		ColorChat(0, GREEN, "^x04 %s //^x01 Toti jucatorii au primit^x04 16.000$", cmdprefix);
			menu_destroy(menu)
		}
		case 1:
		{
			new iPlayers[ 32 ], iNum, i;
			get_players( iPlayers, iNum );

			for( i = 0; i < iNum; i++ )
			{
			cs_set_user_team(iPlayers, CS_TEAM_SPECTATOR);
			user_kill(iPlayers)
			}
			
			get_pcvar_string(cmdpre,cmdprefix,50);
			set_cvar_string ( "sv_restart", "1" );
			set_cvar_string ( "sv_freezetime", "0");
			mixon = 0;
			schimbate = 0;
			teamA = 0
			teamB = 0
			
			ColorChat(0, GREEN, "^x04 %s //^x01 Serverul a mutat toti jucatorii la^x04 spectatori^x01 pentru a se creea^x04 echipele.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Jucatorii care nu sunt online pe^x04 TS.PLAYARENA.RO^x01 nu vor juca.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Cei care nu sunt alesi, sunt rugati sa paraseasca^x04 serverul.", cmdprefix);
			menu_destroy(menu)
		}
		case 2:
		{
			client_cmd(0, "ex_interp 0.01");
			client_cmd(0, "rate 25000");
			client_cmd(0, "cl_updaterate 101");
			client_cmd(0, "cl_cmdrate 101");
			client_cmd(0, "fps_max 101");
			
			get_pcvar_string(cmdpre,cmdprefix,50);
			get_pcvar_string(dem,demprefix,50);
			set_cvar_string ( "sv_restart", "1" );
			set_cvar_string ( "mp_freezetime", "8" );
			set_cvar_string ( "mp_startmoney", "800" );
			client_cmd(0,"record %s_demo",demprefix);
			mixon = 1;
			schimbate = 0;
			teamA = 0
			teamB = 0
			
			ColorChat(0, GREEN, "^x04 %s //^x01 Orice tentativa de fraudare a jocului, se pedepseste cu^x04 ban permanent.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Jocul a fost^x04 resetat^x01 si^x04 pornit.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Va uram succes la^x04 fraguri.^x01 Cea mai buna echipa sa castige.", cmdprefix);
			menu_destroy(menu)
		}
		case 3:
		{
			new iPlayers[ 32 ], iNum, iPlayer
			get_players( iPlayers, iNum )
			
			for ( new a = 0; a < iNum; a++ )
			{
				iPlayer = iPlayers[ a ];
				
				switch ( cs_get_user_team( iPlayer ) )
				{
					case CS_TEAM_T: cs_set_user_team( iPlayer, CS_TEAM_CT )
						case CS_TEAM_CT: cs_set_user_team( iPlayer, CS_TEAM_T )
					}
			} 
			
			set_cvar_string ( "sv_restart", "1" );
			set_cvar_string ( "mp_freezetime", "8" );
			set_cvar_string ( "mp_startmoney", "800" );
			schimbate = 1
			
			ColorChat(0, GREEN, "^x04 %s //^x01 Echipele au fost schimbate intre ele.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Va rugam sa nu parasiti jocul, pastrati-va^x04 echipa^x01 asa cum ati fost pana acum.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Daca parasesti jocul, vei fi considerat un^x04 jucator slab. :D", cmdprefix);
			menu_destroy(menu)
		}
		
		case 4:
		{
			if(pwon == 0)
			{
				get_pcvar_string(cmdpre,cmdprefix,50);
				
				ColorChat(0, GREEN, "^x04 %s //^x01 Serverul a adaugat o^x04 parola personalizata,^x01 nu se mai poate^x04 conecta^x01 nimeni.", cmdprefix);
				get_pcvar_string(pw,pwmix,50);
				server_cmd( "sv_password %d", pwmix);
				pwon = 1;
			}
			else {
				get_pcvar_string(cmdpre,cmdprefix,50);
				ColorChat(id, GREEN, "^x04 %s //^x01 Serverul are deja o^x04 parola^x01 setata.", cmdprefix);
			}
			menu_destroy(menu)
		}
		case 5:
		{
			if(pwon == 0)
			{
				
				ColorChat(id, GREEN, "^x04 %s //^x01 Serverul nu are^x04 cvar-ul parolei^x01 setat.^x04 [amx_pw parola]", cmdprefix);
			}
			else {
				get_pcvar_string(cmdpre,cmdprefix,50);
				ColorChat(0, GREEN, "^x04 %s //^x01 Serverul a eliminat^x04 parola,^x01 oricine se poate^x04 conecta.", cmdprefix);
				set_cvar_string("sv_password", "");
				pwon = 0;
			}
			menu_destroy(menu)
		}
		case 6:
		{
			if ( mixon == 1 )
			{
				if ( teamA > teamB ){
					get_pcvar_string(cmdpre,cmdprefix,50);
					ColorChat(0, GREEN, "^x04 %s //^x01 SCORUL ESTE^x04 %d^x01 -^x04 %d^x01 PENTRU^x04 TEAM A", cmdprefix,teamA,teamB );
				}
				if ( teamB > teamA ) {
					ColorChat(0, GREEN, "x04 %s //^x01 SCORUL ESTE^x04 %d^x01 -^x04 %d^x01 PENTRU^x04 TEAM B", cmdprefix,teamB ,teamA);
				}
				if ( teamB == teamA ) {
					ColorChat(0, GREEN, "^x04 %s //^x01 SCORUL ESTE^x04 %d^x01 -^x04 %d^x01 (EGALITATE)", cmdprefix,teamB ,teamA);
				}
			}
			else
			{
				ColorChat(0, GREEN, "^x04 %s //^x01 Jocul nu a fost^x04 pornit^x01 inca.", cmdprefix);
			}
			menu_destroy(menu)
			
		}
		case MENU_EXIT:
		{
			menu_destroy(menu)
			return PLUGIN_HANDLED
		}
	}
	mixmenu(id)
	return PLUGIN_HANDLED
}

public client_disconnect(id){
	if (get_playersnum() == 0)
		set_cvar_string("sv_password", "");
}

public warm(id){
	
	if(!get_user_flags(id) && ADMIN_KICK)
	{
		ColorChat(id, GREEN, "^x04 fun.playarena.ro //^x01 Nu ai acces la aceasta^x04 comanda.")
		return PLUGIN_HANDLED
	}
	else {
		client_cmd(0, "ex_interp 0.01");
		client_cmd(0, "rate 25000");
		client_cmd(0, "cl_updaterate 101");
		client_cmd(0, "cl_cmdrate 101");
		client_cmd(0, "fps_max 101");
		
		get_pcvar_string(cmdpre,cmdprefix,50);
		set_cvar_string ( "sv_restart", "1" );
		set_cvar_string ( "mp_freezetime", "0" );
		set_cvar_string ( "mp_startmoney", "16000" );
		mixon = 0;
		schimbate = 0;
		teamA = 0
		teamB = 0
		
		ColorChat(0, GREEN, "^x04 %s //^x01 Runda de incalzire a fost^x04 pornita.", cmdprefix);
		ColorChat(0, GREEN, "^x04 %s //^x01 Toti jucatorii au primit^x04 16.000$", cmdprefix);
		
	}
	return PLUGIN_HANDLED
}

public alegeri(id){
	
	if(!get_user_flags(id) && ADMIN_KICK)
	{
		ColorChat(id, GREEN, "^x04 fun.playarena.ro //^x01 Nu ai acces la aceasta^x04 comanda.")
		return PLUGIN_HANDLED
	}
	else {
		new Players [ 32 ];
		new playerCount, ii, player;
		
		get_players ( Players, playerCount, "a" );
		for ( ii=0; ii< playerCount; ii++ ) {
			player = Players [ ii ];
			cs_set_user_team ( player, CS_TEAM_SPECTATOR, CS_DONTCHANGE );
			user_kill ( player );
		}
	}
	get_pcvar_string(cmdpre,cmdprefix,50);
	client_cmd(0, "kill");
	set_cvar_string ( "sv_restart", "1" );
	set_cvar_string ( "sv_freezetime", "0");
	mixon = 0;
	schimbate = 0;
	teamA = 0
	teamB = 0
	
	ColorChat(0, GREEN, "^x04 %s //^x01 Serverul a mutat toti jucatorii la^x04 spectatori^x01 pentru a se creea^x04 echipele.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Jucatorii care nu sunt online pe^x04 TS.PLAYARENA.RO^x01 nu vor juca.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Cei care nu sunt alesi, sunt rugati sa paraseasca^x04 serverul.", cmdprefix);
	
	return PLUGIN_HANDLED
}

public startmix(id){
	
	if(!get_user_flags(id) && ADMIN_KICK)
	{
		ColorChat(id, GREEN, "^x04 fun.playarena.ro //^x01 Nu ai acces la acest la aceasta^x04 comanda.")
		return PLUGIN_HANDLED
	}
	else {
		client_cmd(0, "ex_interp 0.01");
		client_cmd(0, "rate 25000");
		client_cmd(0, "cl_updaterate 101");
		client_cmd(0, "cl_cmdrate 101");
		client_cmd(0, "fps_max 101");
		
		get_pcvar_string(cmdpre,cmdprefix,50);
		get_pcvar_string(dem,demprefix,50);
		set_cvar_string ( "sv_restart", "1" );
		set_cvar_string ( "mp_freezetime", "8" );
		set_cvar_string ( "mp_startmoney", "800" );
		client_cmd(0,"record %s_demo",demprefix);
		mixon = 1;
		schimbate = 0;
		teamA = 0
		teamB = 0
		
		ColorChat(0, GREEN, "^x04 %s //^x01 Orice tentativa de fraudare a jocului, se pedepseste cu^x04 ban permanent.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Jocul a fost^x04 resetat^x01 si^x04 pornit.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Va uram succes la^x04 fraguri.^x01 Cea mai buna echipa sa castige.", cmdprefix);
		
	}
	return PLUGIN_HANDLED
}

public schimbari(id){
	
	if(!get_user_flags(id) && ADMIN_KICK)
	{
		ColorChat(id, GREEN, "^x04 fun.playarena.ro //^x01 Nu ai acces la acest la aceasta^x04 comanda.")
		return PLUGIN_HANDLED
	}
	else {
		new iPlayers[ 32 ], iNum, iPlayer
		get_players( iPlayers, iNum )
		
		for ( new a = 0; a < iNum; a++ )
		{
			iPlayer = iPlayers[ a ];
			
			switch ( cs_get_user_team( iPlayer ) )
			{
				case CS_TEAM_T: cs_set_user_team( iPlayer, CS_TEAM_CT )
					case CS_TEAM_CT: cs_set_user_team( iPlayer, CS_TEAM_T )
				}
		} 
		
		set_cvar_string ( "sv_restart", "1" );
		set_cvar_string ( "mp_freezetime", "8" );
		set_cvar_string ( "mp_startmoney", "800" );
		schimbate = 1
		
		ColorChat(0, GREEN, "^x04 %s //^x01 Echipele au fost schimbate intre ele.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Va rugam sa nu parasiti jocul, pastrati-va^x04 echipa^x01 asa cum ati fost pana acum.", cmdprefix);
			ColorChat(0, GREEN, "^x04 %s //^x01 Daca parasesti jocul, vei fi considerat un^x04 jucator slab. :D", cmdprefix);
		
	}
	return PLUGIN_HANDLED
}

public setpw(id){
	
	if(!get_user_flags(id) && ADMIN_KICK)
	{
		ColorChat(id, GREEN, "^x04 fun.playarena.ro //^x01 Nu ai acces la acest la aceasta^x04 comanda.")
		return PLUGIN_HANDLED
	}
	else {
		if(pwon == 0)
		{
			get_pcvar_string(cmdpre,cmdprefix,50);
			
			ColorChat(0, GREEN, "^x04 %s //^x01 Serverul a adaugat o^x04 parola personalizata,^x01 nu se mai poate^x04 conecta^x01 nimeni.", cmdprefix);
			get_pcvar_string(pw,pwmix,50);
			server_cmd( "sv_password %d", pwmix);
			pwon = 1;
		}
		else {
			get_pcvar_string(cmdpre,cmdprefix,50);
				ColorChat(id, GREEN, "^x04 %s //^x01 Serverul are deja o^x04 parola^x01 setata.", cmdprefix);
			
		}
		
		
	}
	return PLUGIN_HANDLED
}

public removepw(id){
	
	if(!get_user_flags(id) && ADMIN_KICK)
	{
		ColorChat(id, GREEN, "^x04 fun.playarena.ro //^x01 Nu ai acces la acest la aceasta^x04 comanda.")
		return PLUGIN_HANDLED
	}
	else {
		
		if(pwon == 0)
		{
			
			ColorChat(id, GREEN, "^x04 %s //^x01 Serverul nu are^x04 cvar-ul parolei^x01 setat.^x04 [amx_pw parola]", cmdprefix)
		}
		else {
			get_pcvar_string(cmdpre,cmdprefix,50);
			ColorChat(id, GREEN, "^x04 %s //^x01 Serverul nu are^x04 cvar-ul parolei^x01 setat.^x04 [amx_pw parola]", cmdprefix);
			set_cvar_string("sv_password", "");
			pwon = 0;
		}
	}
	return PLUGIN_HANDLED
}

public scor(id){
	
	if(!get_user_flags(id) && ADMIN_KICK)
	{
		ColorChat(id, GREEN, "^x04 fun.playarena.ro //^x01 Nu ai acces la acest la aceasta^x04 comanda.")
		return PLUGIN_HANDLED
	}
	else {
		if ( mixon == 1 )
		{
			if ( teamA > teamB ){
				get_pcvar_string(cmdpre,cmdprefix,50);
				ColorChat(0, GREEN, "^x04 %s //^x01 SCORUL ESTE^x04 %d^x01 -^x04 %d^x01 PENTRU^x04 TEAM A", cmdprefix,teamA,teamB );
			}
			if ( teamB > teamA ) {
				ColorChat(0, GREEN, "^x04 %s //^x01 SCORUL ESTE^x04 %d^x01 -^x04 %d^x01 PENTRU^x04 TEAM B", cmdprefix,teamB ,teamA);
			}
			if ( teamB == teamA ) {
				ColorChat(0, GREEN, "^x04 %s //^x01 SCORUL ESTE^x04 %d^x01 -^x04 %d^x01 (EGALITATE)", cmdprefix,teamB ,teamA);
			}
		}
		else
		{
			ColorChat(0, GREEN, "^x04 %s //^x01 Jocul a fost^x04 pornit,^x01 va urez succes tuturor. :D", cmdprefix);
		}
		
	}
	return PLUGIN_HANDLED
}


Am aici pluginul de chat (sau dacă ştiţi altul mai bun, dar ăsta pare destul de ok):
on/off chat.sma | Afiseaza codul
#include < amxmodx >

#pragma semicolon 1


#define PLUGIN "New Plugin"
#define VERSION "1.0"

/* --| 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 bool:g_bUsersCanChat = true;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );

	register_clcmd( "say /off", "ClCmdSayBlocare" );
	register_clcmd( "say /on", "ClCmdSayDeBlocare" );
	
	register_clcmd( "say", "ClCmdSay" );
        register_clcmd( "say_team", "ClCmdSay" );
}

public ClCmdSay( id )
{
	
	static szArgs[ 192 ];
	read_args( szArgs, sizeof ( szArgs ) -1 );
	
	if( !szArgs[ 0 ] )	return PLUGIN_CONTINUE;
	
	if( !g_bUsersCanChat )
	{
		ColorChat( id, RED, "^x04 fun.playarena.ro //^x01 Doar adminii mai pot debloca chat-ul folosind comanda^x04 /on." );
	}
		
	return g_bUsersCanChat ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
	
}

public ClCmdSayBlocare( id )
{
	if( !UserHasAcces( id ) )
	{
		ColorChat( id, RED, "^x04 fun.playarena.ro // ^x01 Nu ai acces la aceasta^x04 comanda." );
		return PLUGIN_HANDLED;
	}
	
	if( !g_bUsersCanChat )
	{
		ColorChat( id, RED, "^x04 fun.playarena.ro //^x01 Say si sayteam este deja^x04 blocat." );
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	ColorChat( 0, RED, "^x04 fun.playarena.ro //^x01 Say si sayteam a fost blocat de^x04 %s", szName );
	
	g_bUsersCanChat = false;
	
	return PLUGIN_CONTINUE;
}


public ClCmdSayDeBlocare( id )
{
	if( !UserHasAcces( id ) )
	{
		ColorChat( id, RED, "^x04 fun.playarena.ro //^x01 Nu ai acces la aceasta^x04 comanda." );
		return PLUGIN_HANDLED;
	}
	
	if( g_bUsersCanChat )
	{
		ColorChat( id, RED, "^x04 fun.playarena.ro //^x01 Say si sayteam este deja^x04 deblocat." );
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	ColorChat( 0, RED, "^x04 fun.playarena.ro //^x01 Say si sayteam a fost deblocat de^x04 %s", szName );
	
	g_bUsersCanChat = true;
	
	return PLUGIN_CONTINUE;
}

stock bool:UserHasAcces( id )
{
	if( get_user_flags( id ) & ADMIN_RCON )
		return true;
		
	return false;
	
}

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


Mi-ar plăcea dacă se poate să fie adăugată şi comanda /hson /hsoff, când e activă să meargă doar headshot şi când e dezactivată comandă să fie serverul normal, dacă ar putea fi adăugate comenzile şi în meniu, ar fi şi mai bine. De asemenea şi pluginul de ace-semi/ace ar fi fost frumos să fie adăugat tot în sursa asta, dar asta doar dacă se poate.

Lafel ca la knife, un mic mesaj pentru toţi mi-ar fi de ajutor, "A fost pornit modul de hs-only" sau oricum credeţi voi.

ace rap^^.sma | Afiseaza codul
#include < amxmodx >
#include < cstrike >
#include < ColorChat >

#pragma tabsize 0

static const

	PLUGIN[ ] =		"Ace",
	VERSION[ ] =	"1.0",
	AUTHOR[ ] =		"Rap^^",
	TAG[ ] =		"fun.playarena.ro //";

#pragma semicolon 1

#define ACE 5

new g_iFrags[ 33 ];


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, AUTHOR );
	
	register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
	register_event( "DeathMsg", "EventDeathMsg", "a");
	
	register_logevent( "LogEventRoundEnd", 2, "1=Round_End" );
}

public client_connect( id )
{
	g_iFrags[ id ] = 0;
}

public EventNewRound( )
{
	arrayset( g_iFrags, 0, sizeof g_iFrags );
}

public EventDeathMsg( )
{
	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );
	
	CheckAce( iVictim );
	
	if( iKiller == iVictim || !iKiller
	 || cs_get_user_team( iKiller ) == cs_get_user_team( iVictim ) )
	{
		return PLUGIN_CONTINUE;
	}
	
	g_iFrags[ iKiller ]++;
	
	return PLUGIN_CONTINUE;
}

public LogEventRoundEnd( )
{
	new iPlayers[ 32 ], iNum, player;
	
	get_players( iPlayers, iNum, "ch" );
	
	for( new i = 0; i < iNum; i++ )
	{
		player = iPlayers[ i ];
		
		CheckAce( player );
	}
}

public CheckAce( id )
{
	static szName[ 32 ];
	
	if( g_iFrags[id] >= ACE -1 )
	{
		get_user_name( id, szName, sizeof szName -1 );
		
		ColorChat( 0, GREEN, "%s^x01 Jucatorul^x04 %s^x01 a realizat un^x04 %sace.", TAG, szName, g_iFrags [id ] == ACE ? "":"semi-" );
		
		client_cmd( 0, "spk vox/buzwarn" );
	}
	
	g_iFrags[id] = 0;
}


Dacă se poate adăuga şi comanda /comenzi care să afişeze pe două rânduri un mesaj în chat şi consolă (nu neapărat, important e să apară pe chat) cu toate comenzile disponibile afişate în sma, eu acum am din ad_manager cu advertisments.ini

Am observat intre timp un bug... nu schimba echipele intre ele, merge scorul in continuu.
sud.leaguecs.ro # 32/32 non stop. - 5.254.20.19:27015
sudmix.leaguecs.ro # mix our familly - 5.254.20.7:27015 - DE
sudmix2.leaguecs.ro # mix our familly - 109.163.232.164:27015 - RO
leaguecs românia - forum sud: https://bit.ly/3fm6bJK

----------------------------------------------------------
servere găzduite de gphosting.ro
Post Reply

Return to “Modificari pluginuri”

  • Information