Raised This Month: $51 Target: $400
 12% 

I need some help with the plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sebiq
Junior Member
Join Date: Jun 2020
Old 06-06-2020 , 15:35   I need some help with the plugin
Reply With Quote #1

hi guys i am from romania and i don't speak english like a pro
so i have a problem with this sma it's a like a war plugin and i can't finish this plugin it's so dificult...
someone can help me? adds is in romanian so i can modify there is not problem..but base for plugin i can't compile..


Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>

#pragma semicolon	1

#define MAX_ROUNDS	15
#define TASK		1337
#define ACCESS ADMIN_KICK
#define TIME 30.0
#define ADVERTISING_TIME 80.0

static const

	PLUGIN[ ] =		"Destroy Mix",
	VERSION[ ] =		"0.0.2",
	AUTHOR[ ] =		"by sebiq.",
	TAG[ ] =		"[Destroy MiX]";

new const g_szInterpCommands[ ][ ] =
{
	"cl_filterstuffcmd 0",
	"ex_interp 0.01",
	"cl_cmdrate 105",
	"cl_updrate 102",
	"rate 25000"
	
};

stock const messages [ ] [ ] =
{
	"!g[Destroy MiX] !tForum!y: !gwww.site.com/forum!y.",
        "!g[Destroy Mix] !yAdresa !tTeamSpeak!y: !gTS.SITE.COM!y.",
	"!g[Destroy Mix] !yPlugin creat !t& !yconfigurat de catre !gsebiq. !ypentru !gwww.site.com"

};

//new g_On[ 33 ] = 0;

new SayText;
	
new bool: g_bMixStarted;
new bool: g_bEndRound;
new bool: g_bSecondPart;

new g_iTeroScore, g_iCTScore;
new g_iTeroSScore, g_iCTSScore;

new cvar_msg;
new SyncHud;
new KNIFE = 0;
new paused = 0;
new amx_gamename;

new Float:player_origin[33][3];
new bool:g_bUsersCanChat = true;
new bool:hasdemo[33];

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd("say .start", "cmdStart", ADMIN_KICK);
	register_clcmd("say .stop", "cmdStop", ADMIN_KICK);
	register_clcmd("say .warm", "cmdWarm", ADMIN_KICK);
        register_clcmd("say .extra", "cmdExtra", ADMIN_KICK);
	register_clcmd("say .lame", "cmdKnife", ADMIN_KICK);
	register_clcmd("say .specall", "moveSpec", ADMIN_KICK);
	register_clcmd("say .rr", "cmdRestart", ADMIN_KICK);
	register_clcmd( "say .off", "cmdBlocare", ADMIN_KICK);
	register_clcmd("say .on", "cmdDeblocare", ADMIN_KICK);
	register_clcmd("say .interp", "cmdSetari", ADMIN_KICK);
	register_clcmd("say .comenzi", "cmdComenzi", ADMIN_KICK);
	register_concmd("amx_t", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
	register_concmd("amx_ct", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
	register_concmd("amx_spec", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
	register_clcmd("say .pause", "cmdPause", ADMIN_KICK);
	register_clcmd("say .unpause", "cmdUnPause", ADMIN_KICK);
	register_clcmd("say_team .start", "cmdStart", ADMIN_KICK);
	register_clcmd("say_team .stop", "cmdStop", ADMIN_KICK);
	register_clcmd("say_team .warm", "cmdWarm", ADMIN_KICK);
        register_clcmd("say_team .extra", "cmdExtra", ADMIN_KICK);
	register_clcmd("say_team .lame", "cmdKnife", ADMIN_KICK);
	register_clcmd("say_team .specall", "moveSpec", ADMIN_KICK);
	register_clcmd("say_team .rr", "cmdRestart", ADMIN_KICK);
	register_clcmd("say_team .off", "cmdBlocare", ADMIN_KICK);
	register_clcmd("say_team .on", "cmdDeblocare", ADMIN_KICK);
	register_clcmd("say_team .interp", "cmdSetari", ADMIN_KICK);
	register_clcmd("say_team .comenzi", "cmdComenzi", ADMIN_KICK);
	register_clcmd("say_team .pause", "cmdPause", ADMIN_KICK);
	register_clcmd("say_team .unpause", "cmdUnPause", ADMIN_KICK);

	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say", "hookSay" );
	register_clcmd( "say_team", "hookSay" );
	
	RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
	amx_gamename = register_cvar( "amx_gamename", "Destroy MiX" );
	register_forward( FM_GetGameDescription, "GameDesc" ); 
	register_event("SendAudio", "EventTeroWin", "a", "2&%!MRAD_terwin");
	register_event("SendAudio", "EventCTWin", "a", "2&%!MRAD_ctwin");
	register_event("CurWeapon","switchweapon","be","1=1","2!29");
	register_logevent("LogEventRoundEnd", 2, "1=Round_End");
	register_logevent("LogEventRound", 2, "1=Round_End");
	register_logevent("LogEventRoundStart", 2, "1=Round_Start");
	set_task ( ADVERTISING_TIME, "show_messages", _, _, _,"b" );
	cvar_msg = register_cvar("score_msg", "3");
	SyncHud = CreateHudSyncObj( );
	SayText = get_user_msgid("SayText");
	
}

//=================================================MIX COMMANDS===============================================//

public switchweapon(id)
{
	if (KNIFE == 1)
	{
		engclient_cmd(id, "weapon_knife");
	}
}

public cmdRestart(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor(id, "%s!y Nu ai acces la aceasta comanda.", TAG);
		return PLUGIN_HANDLED;
	}
	if( !g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti da restart inainte sa inceapa meciul.", TAG);

		return PLUGIN_HANDLED;
	}
	
	if( g_bSecondPart )
	{
		g_iTeroScore = g_iTeroSScore;
		g_iCTScore = g_iCTSScore;
		KNIFE = 0;
		g_bMixStarted = true;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		
		client_printcolor(id, "%s %s a repornit partea a II-a a meciului. Good luck!", TAG, szName);
	}
	
	else if( !g_bSecondPart )
	{
		g_iTeroScore = 0;
		g_iCTScore = 0;
		g_iTeroSScore = 0;
		g_iCTSScore = 0;
		KNIFE = 0;
		g_bMixStarted = true;
		g_bSecondPart = false;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		client_printcolor(id, "%s!y %s a repornit prima parte a meciului. Good luck!", TAG, szName);
	}
	
	server_cmd("sv_restart 1");
	
	return PLUGIN_HANDLED;
}

public cmdKnife(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti porni runda de lame in timpul meciului.", TAG);
		
		return PLUGIN_HANDLED;
	}
	KNIFE = 1;
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	server_cmd("sv_restart 1");
	server_cmd("exec live.cfg");
	server_cmd("mp_freezetime 0");
	client_printcolor(id, "%s!y %s a pornit runda de lame.", TAG, szName);
	strip_user_weapons(0);
	
	return PLUGIN_HANDLED;
}

public cmdStart(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( !g_bSecondPart )
	{
		if( g_bMixStarted )
		{
			client_printcolor(id, "%s!y Meciul este deja pornit.", TAG);
			
			return PLUGIN_HANDLED;
		}
		
		g_iTeroScore = 0;
		g_iCTScore = 0;
		g_iTeroSScore = 0;
		g_iCTSScore = 0;
		KNIFE = 0;
		g_bMixStarted = true;
		g_bSecondPart = false;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		taskMSG(TASK);
		
		server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		
		client_printcolor(id, "%s!y %s a pornit prima parte a meciului. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	else if( g_bSecondPart )
	{
		KNIFE = 0;
		g_bMixStarted = true;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		
		client_printcolor(id, "%s!y %s a pornit a II-a parte a meciului. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	return PLUGIN_HANDLED;
}

public cmdWarm(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti da warm in timpul meciului.", TAG);
		
		return PLUGIN_HANDLED;
	}
	
	g_iTeroScore = 0;
	g_iCTScore = 0;
	KNIFE = 0;
	g_bMixStarted = false;
	g_bSecondPart = false;
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	if( task_exists(TASK) )
	{
		remove_task(TASK);
	}
	
	client_printcolor(id, "%s!y %s a pornit rundele de incalzire.", TAG, szName);
	server_cmd("sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");

	
	return PLUGIN_HANDLED;
}

public cmdStop(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( !g_bMixStarted )
	{
		client_printcolor(id, "%s!y Meciul este deja oprit.", TAG);
		
		return PLUGIN_HANDLED;
	}
	
	g_iTeroScore = 0;
	g_iCTScore = 0;
	g_iTeroSScore = 0;
	g_iCTSScore = 0;
	
	g_bMixStarted = false;
	g_bSecondPart = false;
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	if( task_exists(TASK) )
	{
		remove_task(TASK);
	}
	
	client_printcolor(id, "%s!y %s a anulat meciul.", TAG, szName);
        server_cmd("sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");

	return PLUGIN_HANDLED;
}

public EventTeroWin( )
{
	if( g_bMixStarted && !g_bEndRound )
	{
		g_bEndRound = true;
    
		g_iTeroScore++;
	
	}
}

public EventCTWin( )
{
	if( g_bMixStarted && !g_bEndRound )
	{
		g_bEndRound = true;
		
		g_iCTScore++;
   
	}
}

public LogEventRoundStart( )
{
	g_bEndRound = false;
        
}

public LogEventRoundEnd( )
{
	if( g_bMixStarted )
	{
		if( g_iTeroScore + g_iCTScore == MAX_ROUNDS )
		{
			new iPlayers[32], iNum, player;
			
			get_players(iPlayers, iNum, "h");
			
			for( new i = 0; i < iNum; i++ )
			{
				player = iPlayers;
				
				if( cs_get_user_team(player) == CS_TEAM_T )
				{
					cs_set_user_team(player, CS_TEAM_CT);
				}
				
				else if( cs_get_user_team(player) == CS_TEAM_CT )
				{
					cs_set_user_team(player, CS_TEAM_T);
				}
			}
		server_cmd( "sv_restart 1");
        server_cmd( "mp_freezetime 10" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 800" );
        server_cmd( "mp_roundtime 1.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");
			
			new iAux = g_iTeroScore;
			g_iTeroScore = g_iCTScore;
			g_iCTScore = iAux;
			
			g_iTeroSScore = g_iTeroScore;
			g_iCTSScore = g_iCTScore;
			
			g_bSecondPart = true;
			g_bMixStarted = false;
			
			server_cmd("sv_restart 1");
		}
		
		if( g_iTeroScore >= MAX_ROUNDS + 1 )
		
		{
		
			client_printcolor(0, "%s!t Echipa Tero!y a castigat meciul cu!g %d!y la!g %d!y.", TAG, g_iTeroScore, g_iCTScore);
		server_cmd( "sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");
	if( task_exists(TASK) )
	{
		remove_task(TASK);
	}
			cmdStop(TASK);
			
			return PLUGIN_HANDLED;
		}
		
		else if( g_iCTScore >= MAX_ROUNDS + 1 )
		{
			client_printcolor(0, "%s!t Echipa CT!y a castigat meciul cu!g %d!y la!g %d!y.", TAG, g_iCTScore, g_iTeroScore);
		server_cmd( "sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");	
	if( task_exists(TASK) )
	{
		remove_task(TASK);
	}
			cmdStop(TASK);
			
			return PLUGIN_HANDLED;
		}
			
		else if( g_iTeroScore == MAX_ROUNDS && g_iCTScore == MAX_ROUNDS )
		{
			client_printcolor(0, "%s!y Meciul s-a terminat egal.", TAG);
			client_printcolor(0, "%s!y Pentru prelungiri, tastati comanda !g/extra!y.", TAG);
			
			cmdStop(TASK);
			
			return PLUGIN_HANDLED;
		}
		
		if( get_pcvar_num(cvar_msg) != 2 )
		{
			client_printcolor(0, "%s!y Terrorists!g %d!y -!g %d!y Counter-Terrorists", TAG, g_iTeroScore, g_iCTScore);
		}
	}
	
	return PLUGIN_HANDLED;
}

public taskMSG(T_A_S_K)
{
	if( get_pcvar_num(cvar_msg) > 1 )
	{
		set_hudmessage(80, 80, 80, -1.0, 0.03, 0, 0.0, 1.1, 0.0, 0.0, -1);
		ShowSyncHudMsg(0, SyncHud, "Echipa TERO %d - %d Echipa CT", g_iTeroScore, g_iCTScore);
	}
	
	set_task(1.0, "taskMSG", TASK);
}

public moveSpec(id, level, cid)
{
		if (!cmd_access(id, level, cid, 2))
		{
			return PLUGIN_HANDLED;
		}
		if( g_bMixStarted )
		{
		client_printcolor(id, "%s!y Nu poti pune jucatorii !gSpectator !yin timpul meciului.", TAG);
		
		return PLUGIN_HANDLED;
		}
		new players[32], total, i;
		get_players(players,total,"h");
		for (i=0; i<total;i++)
		{
			user_kill(players, 0);
			cs_set_user_team(players, CS_TEAM_SPECTATOR);
		}
		client_printcolor(id, "%s!y Jucatorii au fost pusi !gSpectator !ypentru alegeri.", TAG);
		return PLUGIN_HANDLED;
}

//===============================================================================================//
//==================================AFK REPORT=======================================================================//
public e_Spawn(id)
{
    remove_task(id);
    if(is_user_alive(id))
    {
        set_task(0.8, "get_spawn", id);
    }
    return HAM_IGNORED;
}

public get_spawn(id)
{
    pev(id, pev_origin, player_origin[id]);
    set_task(TIME, "check_afk", id);
}

public check_afk(id)
{
    if(is_user_alive(id))
    {
        if(same_origin(id))
        {
            new name[33];
            get_user_name(id, name, 32);
            client_printcolor(id, "%s!y Player-ul!g %s!y a fost raportat ca AFK!", TAG, name);
        }
    }
}

public same_origin(id)
{
    new Float:origin[3];
    pev(id, pev_origin, origin);
    for(new i = 0; i < 3; i++)
        if(origin != player_origin[id])
            return 0;
    return 1;
}

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

//===============================================BLOCK CHAT=============================================================
public ClCmdSay( id )
{
	
	static szArgs[ 192 ];
	read_args( szArgs, sizeof ( szArgs ) -1 );
	
	if( !szArgs[ 0 ] )	return PLUGIN_CONTINUE;
	
	if( !g_bUsersCanChat )
	{
		client_printcolor( id, "%s!y Chat-ul este!g blocat!y, folositi functia !tsay_team!y!", TAG );
	}
		
	return g_bUsersCanChat ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
	
}

public cmdBlocare( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	if( !g_bUsersCanChat )
	{
		client_printcolor( id, "%s!y Chat-ul este deja!g blocat!y.", TAG );
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	client_printcolor( id, "%s!y Chat-ul a fost!g blocat!y de catre adminul!g %s!y.", TAG, szName );
	
	g_bUsersCanChat = false;
	
	return PLUGIN_CONTINUE;
}

public cmdDeblocare( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	if( g_bUsersCanChat )
	{
		client_printcolor( id, "%s!y Chat-ul este deja!g deblocat!y.", TAG );
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	client_printcolor( id, "%s!y Chat-ul a fost!g deblocat!y de catre adminul!y %s!g.", TAG, szName );
	
	g_bUsersCanChat = true;
	
	return PLUGIN_CONTINUE;
}

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

public cmdSetari( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	static iSize = sizeof ( g_szInterpCommands );
	
	for( new i = 0; i < iSize; i++ )
		client_cmd( 0, g_szInterpCommands[ i ] );
		
	client_print( 0, print_console, "=================== Setari War-Mix ================" );
	client_print( 0, print_console, "[Destroy] Comenzile ti-au fost setate! (cl_cmdrate 105, cl_updrate 102, rate 25000 si ex_interp 0.01." );
	client_print( 0, print_console, "====================================================" );
			
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	client_printcolor( id, "%s !g%s!y executa interp pe jucatori. Verificati consola.", TAG, szName );
	
	return PLUGIN_CONTINUE;
}

public cmdComenzi( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	static iSize = sizeof ( g_szInterpCommands );
	
	for( new i = 0; i < iSize; i++ )
		client_cmd( 0, g_szInterpCommands[ i ] );
		
	client_print( 0, print_console, "=================== Comenzi War-Mix ================" );

	client_print( 0, print_console, "/comenzi - Lista comenzi war" );
	client_print( 0, print_console, "/start - Porneste meciul" );
	client_print( 0, print_console, "/stop - Opreste meciul" );
	client_print( 0, print_console, "/lame - Porneste runda de lame" );
	client_print( 0, print_console, "/off - Opreste chat-ul" );
	client_print( 0, print_console, "/on - Porneste chat-ul " );
	client_print( 0, print_console, "/interp - Seteaza interp 0.01 playerilor" );
	client_print( 0, print_console, "/warm - Porneste warm-up" );
	client_print( 0, print_console, "/rr - Restart" );
	client_print( 0, print_console, "/money - Arata situatia financiara" );
	client_print( 0, print_console, "/demo nick - Porneste demo jucatorului respectiv" );
	client_print( 0, print_console, "/extra - Porneste rundele de departajare in caz de egal" );
	client_print( 0, print_console, "/specall- Transferi toti playerii la SPEC" );
 
	client_print( 0, print_console, "----------------------------------------" );
	client_print( 0, print_console, "----Comenzi amx: ----" );
	client_print( 0, print_console, "---------------------------------------" );

	client_print( 0, print_console, "amx_ct nume - Transferi player-ul la CT" );
	client_print( 0, print_console, "amx_t nume - Transferi player-ul la T" );
	client_print( 0, print_console, "amx_spec nume - Transferi player-ul la spectatori" );
	client_print( 0, print_console, "====================================================" );
			
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	
	
	return PLUGIN_CONTINUE;
}

//======================================= Prelungiri =================================================
public cmdExtra(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( !g_bSecondPart )
	{
		if( g_bMixStarted )
		{
			ColorChat(id, "%s!y Meciul este deja pornit.", TAG);
			
			return PLUGIN_HANDLED;
		}
		
		g_iTeroScore = 0;
		g_iCTScore = 0;
		g_iTeroSScore = 0;
		g_iCTSScore = 0;
		KNIFE = 0;
		g_bMixStarted = true;
		g_bSecondPart = false;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		taskMSG(TASK);
		
		        server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 10000" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		
		client_printcolor(id, "%s!y %s a pornit prima parte a prelungirilor. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	else if( g_bSecondPart )
	{
		KNIFE = 0;
		g_bMixStarted = true;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 10000" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		
		client_printcolor(id, "%s!y %s a pornit a II-a parte a prelungirilor. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	return PLUGIN_HANDLED;
}

//==========================================DEMO=======================================================
      
new const g_Demoname[] = "DEMO_Destroy_RO";


public client_connect(id)
{
	hasdemo[id] = false;

}

public hookSay( id )
{
	new szSaid[ 192 ];
	read_args( szSaid, sizeof( szSaid ) -1 );
	remove_quotes( szSaid );
	
	if( contain( szSaid, "/demo" ) != -1 )
	{
		if( get_user_flags( id ) & ADMIN_KICK )
		{
			new target[ 32 ];
			copy( target, sizeof( target ) -1, szSaid[ 6 ] );
			
			new id2 = cmd_target( id, target, 2 );
			
			if(hasdemo[id2])
			{
				static szName[ 32 ]; 
				new mapname[32];
				get_user_name( id2, szName, sizeof( szName ) -1 );
				get_mapname(mapname,31);
				client_printcolor( id, "%s !y Jucatorul %s are deja demo!", TAG, szName );
				return PLUGIN_HANDLED;
			}
			
			if( id2 )
			{
				static szName[ 32 ]; 
				new mapname[32];
				get_user_name( id2, szName, sizeof( szName ) -1 );
				get_mapname(mapname,31);
				hasdemo[id2] = true;
				
				client_cmd( id2, "record ^"%s-%s^"", g_Demoname, mapname);
				
				client_printcolor( id, "%s!y Ai pornit demo pe jucatorul!g %s!y!", TAG, szName );
			}
			
			else
			{
				console_print( id, "Player-ul nu exista !!!" );
			}
			
			return PLUGIN_HANDLED;
		}
	}
	return PLUGIN_CONTINUE;
}

//========================================TRANSFER===================================================
public admin_chteam(id, level, cid) {
   if (!cmd_access(id, level, cid, 2))
      return PLUGIN_HANDLED;
   
   new cmd[10];
   new arg[32];
   new name[32], name2[32];
   
   read_argv(0,cmd,9);
   read_argv(1,arg,31);
   new player = cmd_target(id,arg,2);
   if (!player) return PLUGIN_HANDLED;
  
   user_kill(player, 1);
   get_user_name(id, name, 31);
   get_user_name(player, name2, 31);
   
   if(cmd[4]=='t')
   {
      cs_set_user_team(player,1);
      client_printcolor( id, "%s!y Adminul!g %s!y l-a mutat pe!g %s!y la!g TERO!y.", TAG, name, name2 );
   }
   if(cmd[4]=='c')
   {
      cs_set_user_team(player,2);
      client_printcolor( id, "%s!y Adminul!g %s!y l-a mutat pe!g %s!y la!g CT!y.", TAG, name, name2 );
   }
   if(cmd[4]=='s')
   {
      cs_set_user_team(player,3);
      client_printcolor( id, "%s!y Adminul!g %s!y l-a mutat pe!g %s!y la!g Spectator!y.", TAG, name, name2 );
   }
   return PLUGIN_HANDLED;
} 

//============================================PAUSE & NOPAUSE=========================================
public cmdPause(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
if (paused == 0)
{
paused = 1;
server_cmd("amx_pause");
client_printcolor( id, "%s!y SERVER PAUSED!", TAG);
}
return PLUGIN_HANDLED;
}
public cmdUnPause(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
if (paused == 1)
{
paused = 0;
server_cmd("amx_pause");
client_printcolor( id, "%s!y SERVER UNPAUSED!", TAG);
}
return PLUGIN_HANDLED;
}

public show_messages ( )
{
	new Buffer[256];
	formatex(Buffer, sizeof Buffer - 1, "!g%s", messages[random(sizeof messages)]);
	
	new players[32], num, id;
	get_players(players, num);
	
	for(new i = 0 ; i < num ; i++)
	{
		id = players;
	
		message_begin(MSG_ONE, get_user_msgid("SayText"), _, id);
		write_byte(id);
		write_string(Buffer);
		message_end();
	}
}

public GameDesc( ) {
static gamename[32];
get_pcvar_string( amx_gamename, gamename, 31 );
forward_return( FMV_STRING, gamename );
return FMRES_SUPERCEDE;
}


stock client_printcolor(const id, const input[], any:...) // stock in client_printcolor
{
        new count = 1, players[32]
        static msg[191]
        vformat(msg, 190, input, 3)
       
        replace_all(msg, 190, "!g", "^4") // Green Color
        replace_all(msg, 190, "!y", "^1") // Default Color
        replace_all(msg, 190, "!t", "^3") // Team Color
       
        if (id) players[0] = id; else get_players(players, count, "ch")
        {
                for ( new i = 0; i < count; i++ )
                {
                        if ( is_user_connected(players[i]) )
                        {
                                message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i])
                                write_byte(players[i]);
                                write_string(msg);
                                message_end();
                        }
                }
        }

Last edited by sebiq; 06-06-2020 at 16:15.
sebiq is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-06-2020 , 16:00   Re: I need some help with the plugin
Reply With Quote #2

I think you're in over your head trying to make this work. There are a ton of code errors.
__________________
Bugsy is offline
sebiq
Junior Member
Join Date: Jun 2020
Old 06-06-2020 , 16:15   Re: I need some help with the plugin
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
I think you're in over your head trying to make this work. There are a ton of code errors.
In romania, it's something like medium difficulty
We have good scripters but we must to pay
sebiq is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-06-2020 , 16:21   Re: I need some help with the plugin
Reply With Quote #4

It looks like someone, maybe you?, tried to modify the code and there are thing done incorrectly in many places. Even if you get it to compile, I wouldn't bank on it working as you expect.

For one, everywhere that you use get_player(), you need to use players[ i ] instead of players to reference the player.
And you're missing a closing bracket at the very bottom '}'
__________________

Last edited by Bugsy; 06-06-2020 at 16:22.
Bugsy is offline
lobopack23
Senior Member
Join Date: Jun 2009
Location: California , United Stat
Old 06-06-2020 , 16:28   Re: I need some help with the plugin
Reply With Quote #5

I updated it, took me like 3-4 minutes, some of the arrays that you put just needed to add [i], for example you put players = iPlayers, needed to change it to players = iPlayers[id]. I had to add some semicolons ( ; ) to the end of some lines. And also, in one line you added ColorChat but needed to change to client_printcolor instead..

here is the code below

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>

#pragma semicolon	1

#define MAX_ROUNDS	15
#define TASK		1337
#define ACCESS ADMIN_KICK
#define TIME 30.0
#define ADVERTISING_TIME 80.0

static const

	PLUGIN[ ] =		"Destroy Mix",
	VERSION[ ] =		"0.0.2",
	AUTHOR[ ] =		"by sebiq.",
	TAG[ ] =		"[Destroy MiX]";

new const g_szInterpCommands[ ][ ] =
{
	"cl_filterstuffcmd 0",
	"ex_interp 0.01",
	"cl_cmdrate 105",
	"cl_updrate 102",
	"rate 25000"
	
};

stock const messages [ ] [ ] =
{
	"!g[Destroy MiX] !tForum!y: !gwww.site.com/forum!y.",
        "!g[Destroy Mix] !yAdresa !tTeamSpeak!y: !gTS.SITE.COM!y.",
	"!g[Destroy Mix] !yPlugin creat !t& !yconfigurat de catre !gsebiq. !ypentru !gwww.site.com"

};

//new g_On[ 33 ] = 0;

new SayText;
	
new bool: g_bMixStarted;
new bool: g_bEndRound;
new bool: g_bSecondPart;

new g_iTeroScore, g_iCTScore;
new g_iTeroSScore, g_iCTSScore;

new cvar_msg;
new SyncHud;
new KNIFE = 0;
new paused = 0;
new amx_gamename;

new Float:player_origin[33][3];
new bool:g_bUsersCanChat = true;
new bool:hasdemo[33];

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd("say .start", "cmdStart", ADMIN_KICK);
	register_clcmd("say .stop", "cmdStop", ADMIN_KICK);
	register_clcmd("say .warm", "cmdWarm", ADMIN_KICK);
        register_clcmd("say .extra", "cmdExtra", ADMIN_KICK);
	register_clcmd("say .lame", "cmdKnife", ADMIN_KICK);
	register_clcmd("say .specall", "moveSpec", ADMIN_KICK);
	register_clcmd("say .rr", "cmdRestart", ADMIN_KICK);
	register_clcmd( "say .off", "cmdBlocare", ADMIN_KICK);
	register_clcmd("say .on", "cmdDeblocare", ADMIN_KICK);
	register_clcmd("say .interp", "cmdSetari", ADMIN_KICK);
	register_clcmd("say .comenzi", "cmdComenzi", ADMIN_KICK);
	register_concmd("amx_t", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
	register_concmd("amx_ct", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
	register_concmd("amx_spec", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
	register_clcmd("say .pause", "cmdPause", ADMIN_KICK);
	register_clcmd("say .unpause", "cmdUnPause", ADMIN_KICK);
	register_clcmd("say_team .start", "cmdStart", ADMIN_KICK);
	register_clcmd("say_team .stop", "cmdStop", ADMIN_KICK);
	register_clcmd("say_team .warm", "cmdWarm", ADMIN_KICK);
        register_clcmd("say_team .extra", "cmdExtra", ADMIN_KICK);
	register_clcmd("say_team .lame", "cmdKnife", ADMIN_KICK);
	register_clcmd("say_team .specall", "moveSpec", ADMIN_KICK);
	register_clcmd("say_team .rr", "cmdRestart", ADMIN_KICK);
	register_clcmd("say_team .off", "cmdBlocare", ADMIN_KICK);
	register_clcmd("say_team .on", "cmdDeblocare", ADMIN_KICK);
	register_clcmd("say_team .interp", "cmdSetari", ADMIN_KICK);
	register_clcmd("say_team .comenzi", "cmdComenzi", ADMIN_KICK);
	register_clcmd("say_team .pause", "cmdPause", ADMIN_KICK);
	register_clcmd("say_team .unpause", "cmdUnPause", ADMIN_KICK);

	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say", "hookSay" );
	register_clcmd( "say_team", "hookSay" );
	
	RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
	amx_gamename = register_cvar( "amx_gamename", "Destroy MiX" );
	register_forward( FM_GetGameDescription, "GameDesc" ); 
	register_event("SendAudio", "EventTeroWin", "a", "2&%!MRAD_terwin");
	register_event("SendAudio", "EventCTWin", "a", "2&%!MRAD_ctwin");
	register_event("CurWeapon","switchweapon","be","1=1","2!29");
	register_logevent("LogEventRoundEnd", 2, "1=Round_End");
	register_logevent("LogEventRound", 2, "1=Round_End");
	register_logevent("LogEventRoundStart", 2, "1=Round_Start");
	set_task ( ADVERTISING_TIME, "show_messages", _, _, _,"b" );
	cvar_msg = register_cvar("score_msg", "3");
	SyncHud = CreateHudSyncObj( );
	SayText = get_user_msgid("SayText");
	
}

//=================================================MIX COMMANDS===============================================//

public switchweapon(id)
{
	if (KNIFE == 1)
	{
		engclient_cmd(id, "weapon_knife");
	}
}

public cmdRestart(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor(id, "%s!y Nu ai acces la aceasta comanda.", TAG);
		return PLUGIN_HANDLED;
	}
	if( !g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti da restart inainte sa inceapa meciul.", TAG);

		return PLUGIN_HANDLED;
	}
	
	if( g_bSecondPart )
	{
		g_iTeroScore = g_iTeroSScore;
		g_iCTScore = g_iCTSScore;
		KNIFE = 0;
		g_bMixStarted = true;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		
		client_printcolor(id, "%s %s a repornit partea a II-a a meciului. Good luck!", TAG, szName);
	}
	
	else if( !g_bSecondPart )
	{
		g_iTeroScore = 0;
		g_iCTScore = 0;
		g_iTeroSScore = 0;
		g_iCTSScore = 0;
		KNIFE = 0;
		g_bMixStarted = true;
		g_bSecondPart = false;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		client_printcolor(id, "%s!y %s a repornit prima parte a meciului. Good luck!", TAG, szName);
	}
	
	server_cmd("sv_restart 1");
	
	return PLUGIN_HANDLED;
}

public cmdKnife(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti porni runda de lame in timpul meciului.", TAG);
		
		return PLUGIN_HANDLED;
	}
	KNIFE = 1;
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	server_cmd("sv_restart 1");
	server_cmd("exec live.cfg");
	server_cmd("mp_freezetime 0");
	client_printcolor(id, "%s!y %s a pornit runda de lame.", TAG, szName);
	strip_user_weapons(0);
	
	return PLUGIN_HANDLED;
}

public cmdStart(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( !g_bSecondPart )
	{
		if( g_bMixStarted )
		{
			client_printcolor(id, "%s!y Meciul este deja pornit.", TAG);
			
			return PLUGIN_HANDLED;
		}
		
		g_iTeroScore = 0;
		g_iCTScore = 0;
		g_iTeroSScore = 0;
		g_iCTSScore = 0;
		KNIFE = 0;
		g_bMixStarted = true;
		g_bSecondPart = false;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		taskMSG(TASK);
		
		server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		
		client_printcolor(id, "%s!y %s a pornit prima parte a meciului. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	else if( g_bSecondPart )
	{
		KNIFE = 0;
		g_bMixStarted = true;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		
		client_printcolor(id, "%s!y %s a pornit a II-a parte a meciului. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	return PLUGIN_HANDLED;
}

public cmdWarm(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti da warm in timpul meciului.", TAG);
		
		return PLUGIN_HANDLED;
	}
	
	g_iTeroScore = 0;
	g_iCTScore = 0;
	KNIFE = 0;
	g_bMixStarted = false;
	g_bSecondPart = false;
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	if( task_exists(TASK) )
	{
		remove_task(TASK);
	}
	
	client_printcolor(id, "%s!y %s a pornit rundele de incalzire.", TAG, szName);
	server_cmd("sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");

	
	return PLUGIN_HANDLED;
}

public cmdStop(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( !g_bMixStarted )
	{
		client_printcolor(id, "%s!y Meciul este deja oprit.", TAG);
		
		return PLUGIN_HANDLED;
	}
	
	g_iTeroScore = 0;
	g_iCTScore = 0;
	g_iTeroSScore = 0;
	g_iCTSScore = 0;
	
	g_bMixStarted = false;
	g_bSecondPart = false;
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	if( task_exists(TASK) )
	{
		remove_task(TASK);
	}
	
	client_printcolor(id, "%s!y %s a anulat meciul.", TAG, szName);
        server_cmd("sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");

	return PLUGIN_HANDLED;
}

public EventTeroWin( )
{
	if( g_bMixStarted && !g_bEndRound )
	{
		g_bEndRound = true;
    
		g_iTeroScore++;
	
	}
}

public EventCTWin( )
{
	if( g_bMixStarted && !g_bEndRound )
	{
		g_bEndRound = true;
		
		g_iCTScore++;
   
	}
}

public LogEventRoundStart( )
{
	g_bEndRound = false;
        
}

public LogEventRoundEnd( )
{
	if( g_bMixStarted )
	{
		if( g_iTeroScore + g_iCTScore == MAX_ROUNDS )
		{
			new iPlayers[32], iNum, player;
			
			get_players(iPlayers, iNum, "h");
			
			for( new i = 0; i < iNum; i++ )
			{
				player = iPlayers[i];
				
				if( cs_get_user_team(player) == CS_TEAM_T )
				{
					cs_set_user_team(player, CS_TEAM_CT);
				}
				
				else if( cs_get_user_team(player) == CS_TEAM_CT )
				{
					cs_set_user_team(player, CS_TEAM_T);
				}
			}
			server_cmd( "sv_restart 1");
        		server_cmd( "mp_freezetime 10" );
        		server_cmd( "mp_buytime 0.25" );
        		server_cmd( "mp_startmoney 800" );
        		server_cmd( "mp_roundtime 1.75" );
        		server_cmd( "mp_forcecamera 2" );
       	 		server_cmd( "mp_friendlyfire 0");
        		server_cmd( "mp_c4timer 35");
			
			new iAux = g_iTeroScore;
			g_iTeroScore = g_iCTScore;
			g_iCTScore = iAux;
			
			g_iTeroSScore = g_iTeroScore;
			g_iCTSScore = g_iCTScore;
			
			g_bSecondPart = true;
			g_bMixStarted = false;
			
			server_cmd("sv_restart 1");
		}
		
		if( g_iTeroScore >= MAX_ROUNDS + 1 )
		{
			client_printcolor(0, "%s!t Echipa Tero!y a castigat meciul cu!g %d!y la!g %d!y.", TAG, g_iTeroScore, g_iCTScore);
			server_cmd( "sv_restart 1");
        		server_cmd( "mp_freezetime 0" );
        		server_cmd( "mp_buytime 0.25" );
			server_cmd( "mp_startmoney 16000" );
			server_cmd( "mp_roundtime 8.75" );
        		server_cmd( "mp_forcecamera 2" );
       	 		server_cmd( "mp_friendlyfire 0");
        		server_cmd( "mp_c4timer 35");

			if( task_exists(TASK) )
			{
				remove_task(TASK);
			}
			cmdStop(TASK);
			return PLUGIN_HANDLED;
		}
		
		else if( g_iCTScore >= MAX_ROUNDS + 1 )
		{
			client_printcolor(0, "%s!t Echipa CT!y a castigat meciul cu!g %d!y la!g %d!y.", TAG, g_iCTScore, g_iTeroScore);
			server_cmd( "sv_restart 1");
       			server_cmd( "mp_freezetime 0" );
        		server_cmd( "mp_buytime 0.25" );
        		server_cmd( "mp_startmoney 16000" );
        		server_cmd( "mp_roundtime 8.75" );
        		server_cmd( "mp_forcecamera 2" );
        		server_cmd( "mp_friendlyfire 0");
        		server_cmd( "mp_c4timer 35");	

			if( task_exists(TASK) )
			{
				remove_task(TASK);
			}
			cmdStop(TASK);
			
			return PLUGIN_HANDLED;
		}
			
		else if( g_iTeroScore == MAX_ROUNDS && g_iCTScore == MAX_ROUNDS )
		{
			client_printcolor(0, "%s!y Meciul s-a terminat egal.", TAG);
			client_printcolor(0, "%s!y Pentru prelungiri, tastati comanda !g/extra!y.", TAG);
			
			cmdStop(TASK);
			
			return PLUGIN_HANDLED;
		}
		
		if( get_pcvar_num(cvar_msg) != 2 )
		{
			client_printcolor(0, "%s!y Terrorists!g %d!y -!g %d!y Counter-Terrorists", TAG, g_iTeroScore, g_iCTScore);
		}
	}
	return PLUGIN_HANDLED;
}

public taskMSG(T_A_S_K)
{
	if( get_pcvar_num(cvar_msg) > 1 )
	{
		set_hudmessage(80, 80, 80, -1.0, 0.03, 0, 0.0, 1.1, 0.0, 0.0, -1);
		ShowSyncHudMsg(0, SyncHud, "Echipa TERO %d - %d Echipa CT", g_iTeroScore, g_iCTScore);
	}
	
	set_task(1.0, "taskMSG", TASK);
}

public moveSpec(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}

	if( g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti pune jucatorii !gSpectator !yin timpul meciului.", TAG);
		return PLUGIN_HANDLED;
	}

	new players[32], total, i;
	get_players(players,total,"h");
	for (i=0; i<total;i++)
	{
		user_kill(players[i], 0);
		cs_set_user_team(players[i], CS_TEAM_SPECTATOR);
	}
	client_printcolor(id, "%s!y Jucatorii au fost pusi !gSpectator !ypentru alegeri.", TAG);
	return PLUGIN_HANDLED;
}

//===============================================================================================//
//==================================AFK REPORT=======================================================================//
public e_Spawn(id)
{
    remove_task(id);
    if(is_user_alive(id))
    {
        set_task(0.8, "get_spawn", id);
    }
    return HAM_IGNORED;
}

public get_spawn(id)
{
    pev(id, pev_origin, player_origin[id]);
    set_task(TIME, "check_afk", id);
}

public check_afk(id)
{
    if(is_user_alive(id))
    {
        if(same_origin(id))
        {
            new name[33];
            get_user_name(id, name, 32);
            client_printcolor(id, "%s!y Player-ul!g %s!y a fost raportat ca AFK!", TAG, name);
        }
    }
}

public same_origin(id)
{
	new Float:origin[3];
	new Float:player_origin[3];
	pev(id, pev_origin, origin);

	for(new i = 0; i < 3; i++)
		if ( origin[i] != player_origin[id])
           		 return 0;
	return 1;
}

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

//===============================================BLOCK CHAT=============================================================
public ClCmdSay( id )
{
	
	static szArgs[ 192 ];
	read_args( szArgs, sizeof ( szArgs ) -1 );
	
	if( !szArgs[ 0 ] )	return PLUGIN_CONTINUE;
	
	if( !g_bUsersCanChat )
	{
		client_printcolor( id, "%s!y Chat-ul este!g blocat!y, folositi functia !tsay_team!y!", TAG );
	}
		
	return g_bUsersCanChat ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
	
}

public cmdBlocare( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	if( !g_bUsersCanChat )
	{
		client_printcolor( id, "%s!y Chat-ul este deja!g blocat!y.", TAG );
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	client_printcolor( id, "%s!y Chat-ul a fost!g blocat!y de catre adminul!g %s!y.", TAG, szName );
	
	g_bUsersCanChat = false;
	
	return PLUGIN_CONTINUE;
}

public cmdDeblocare( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	if( g_bUsersCanChat )
	{
		client_printcolor( id, "%s!y Chat-ul este deja!g deblocat!y.", TAG );
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	client_printcolor( id, "%s!y Chat-ul a fost!g deblocat!y de catre adminul!y %s!g.", TAG, szName );
	
	g_bUsersCanChat = true;
	
	return PLUGIN_CONTINUE;
}

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

public cmdSetari( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	static iSize = sizeof ( g_szInterpCommands );
	
	for( new i = 0; i < iSize; i++ )
		client_cmd( 0, g_szInterpCommands[ i ] );
		
	client_print( 0, print_console, "=================== Setari War-Mix ================" );
	client_print( 0, print_console, "[Destroy] Comenzile ti-au fost setate! (cl_cmdrate 105, cl_updrate 102, rate 25000 si ex_interp 0.01." );
	client_print( 0, print_console, "====================================================" );
			
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	client_printcolor( id, "%s !g%s!y executa interp pe jucatori. Verificati consola.", TAG, szName );
	
	return PLUGIN_CONTINUE;
}

public cmdComenzi( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	static iSize = sizeof ( g_szInterpCommands );
	
	for( new i = 0; i < iSize; i++ )
		client_cmd( 0, g_szInterpCommands[ i ] );
		
	client_print( 0, print_console, "=================== Comenzi War-Mix ================" );

	client_print( 0, print_console, "/comenzi - Lista comenzi war" );
	client_print( 0, print_console, "/start - Porneste meciul" );
	client_print( 0, print_console, "/stop - Opreste meciul" );
	client_print( 0, print_console, "/lame - Porneste runda de lame" );
	client_print( 0, print_console, "/off - Opreste chat-ul" );
	client_print( 0, print_console, "/on - Porneste chat-ul " );
	client_print( 0, print_console, "/interp - Seteaza interp 0.01 playerilor" );
	client_print( 0, print_console, "/warm - Porneste warm-up" );
	client_print( 0, print_console, "/rr - Restart" );
	client_print( 0, print_console, "/money - Arata situatia financiara" );
	client_print( 0, print_console, "/demo nick - Porneste demo jucatorului respectiv" );
	client_print( 0, print_console, "/extra - Porneste rundele de departajare in caz de egal" );
	client_print( 0, print_console, "/specall- Transferi toti playerii la SPEC" );
 
	client_print( 0, print_console, "----------------------------------------" );
	client_print( 0, print_console, "----Comenzi amx: ----" );
	client_print( 0, print_console, "---------------------------------------" );

	client_print( 0, print_console, "amx_ct nume - Transferi player-ul la CT" );
	client_print( 0, print_console, "amx_t nume - Transferi player-ul la T" );
	client_print( 0, print_console, "amx_spec nume - Transferi player-ul la spectatori" );
	client_print( 0, print_console, "====================================================" );
			
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	
	
	return PLUGIN_CONTINUE;
}

//======================================= Prelungiri =================================================
public cmdExtra(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( !g_bSecondPart )
	{
		if( g_bMixStarted )
		{
			client_printcolor(id, "%s!y Meciul este deja pornit.", TAG);
			
			return PLUGIN_HANDLED;
		}
		
		g_iTeroScore = 0;
		g_iCTScore = 0;
		g_iTeroSScore = 0;
		g_iCTSScore = 0;
		KNIFE = 0;
		g_bMixStarted = true;
		g_bSecondPart = false;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		taskMSG(TASK);
		
		server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 10000" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		client_printcolor(id, "%s!y %s a pornit prima parte a prelungirilor. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	else if( g_bSecondPart )
	{
		KNIFE = 0;
		g_bMixStarted = true;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 10000" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");
		
		client_printcolor(id, "%s!y %s a pornit a II-a parte a prelungirilor. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	return PLUGIN_HANDLED;
}

//==========================================DEMO=======================================================
      
new const g_Demoname[] = "DEMO_Destroy_RO";


public client_connect(id)
{
	hasdemo[id] = false;
}

public hookSay( id )
{
	new szSaid[ 192 ];
	read_args( szSaid, sizeof( szSaid ) -1 );
	remove_quotes( szSaid );
	
	if( contain( szSaid, "/demo" ) != -1 )
	{
		if( get_user_flags( id ) & ADMIN_KICK )
		{
			new target[ 32 ];
			copy( target, sizeof( target ) -1, szSaid[ 6 ] );
			
			new id2 = cmd_target( id, target, 2 );
			
			if(hasdemo[id2])
			{
				static szName[ 32 ]; 
				new mapname[32];
				get_user_name( id2, szName, sizeof( szName ) -1 );
				get_mapname(mapname,31);
				client_printcolor( id, "%s !y Jucatorul %s are deja demo!", TAG, szName );
				return PLUGIN_HANDLED;
			}
			
			if( id2 )
			{
				static szName[ 32 ]; 
				new mapname[32];
				get_user_name( id2, szName, sizeof( szName ) -1 );
				get_mapname(mapname,31);
				hasdemo[id2] = true;
				
				client_cmd( id2, "record ^"%s-%s^"", g_Demoname, mapname);
				
				client_printcolor( id, "%s!y Ai pornit demo pe jucatorul!g %s!y!", TAG, szName );
			}
			
			else
			{
				console_print( id, "Player-ul nu exista !!!" );
			}
			
			return PLUGIN_HANDLED;
		}
	}
	return PLUGIN_CONTINUE;
}

//========================================TRANSFER===================================================
public admin_chteam(id, level, cid) {
   if (!cmd_access(id, level, cid, 2))
      return PLUGIN_HANDLED;
   
   new cmd[10];
   new arg[32];
   new name[32], name2[32];
   
   read_argv(0,cmd,9);
   read_argv(1,arg,31);
   new player = cmd_target(id,arg,2);
   if (!player) return PLUGIN_HANDLED;
  
   user_kill(player, 1);
   get_user_name(id, name, 31);
   get_user_name(player, name2, 31);
   
   if(cmd[4]=='t')
   {
      cs_set_user_team(player,1);
      client_printcolor( id, "%s!y Adminul!g %s!y l-a mutat pe!g %s!y la!g TERO!y.", TAG, name, name2 );
   }
   if(cmd[4]=='c')
   {
      cs_set_user_team(player,2);
      client_printcolor( id, "%s!y Adminul!g %s!y l-a mutat pe!g %s!y la!g CT!y.", TAG, name, name2 );
   }
   if(cmd[4]=='s')
   {
      cs_set_user_team(player,3);
      client_printcolor( id, "%s!y Adminul!g %s!y l-a mutat pe!g %s!y la!g Spectator!y.", TAG, name, name2 );
   }
   return PLUGIN_HANDLED;
} 

//============================================PAUSE & NOPAUSE=========================================
public cmdPause(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
if (paused == 0)
{
paused = 1;
server_cmd("amx_pause");
client_printcolor( id, "%s!y SERVER PAUSED!", TAG);
}
return PLUGIN_HANDLED;
}
public cmdUnPause(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
if (paused == 1)
{
paused = 0;
server_cmd("amx_pause");
client_printcolor( id, "%s!y SERVER UNPAUSED!", TAG);
}
return PLUGIN_HANDLED;
}

public show_messages ( )
{
	new Buffer[256];
	formatex(Buffer, sizeof Buffer - 1, "!g%s", messages[random(sizeof messages)]);
	
	new players[32], num, id;
	get_players(players, num);
	
	for(new i = 0 ; i < num ; i++)
	{
		id = players[id];
	
		message_begin(MSG_ONE, get_user_msgid("SayText"), _, id);
		write_byte(id);
		write_string(Buffer);
		message_end();
	}
}

public GameDesc( ) {
static gamename[32];
get_pcvar_string( amx_gamename, gamename, 31 );
forward_return( FMV_STRING, gamename );
return FMRES_SUPERCEDE;
}


stock client_printcolor(const id, const input[], any:...) // stock in client_printcolor
{
        new count = 1, players[32];
        static msg[191];
        vformat(msg, 190, input, 3);
       
        replace_all(msg, 190, "!g", "^4"); // Green Color
        replace_all(msg, 190, "!y", "^1"); // Default Color
        replace_all(msg, 190, "!t", "^3"); // Team Color
       
        if (id) 
		players[0] = id; 
	
	else get_players(players, count, "ch");
	{
                for ( new i = 0; i < count; i++ )
                {
                        if ( is_user_connected(players[i]) )
                        {
                                message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i]);
                                write_byte(players[i]);
                                write_string(msg);
                                message_end();
                        }
                }
        }
}
It compiles, not sure if it works. I just took care of your errors and indentation issues.
__________________
- Steam: Lobopack23 - Link
Contact me if you need any help with Pokemod.
- 2nd Generation Pokemod - Link
(new skills, items, and pokemons)
- Buy Xp - Link
lobopack23 is offline
lobopack23
Senior Member
Join Date: Jun 2009
Location: California , United Stat
Old 06-06-2020 , 16:29   Re: I need some help with the plugin
Reply With Quote #6

Quote:
Originally Posted by Bugsy View Post
And you're missing a closing bracket at the very bottom '}'
i think he forgot to add it when he pasted it but i got the same errors he did. but i took care of them
__________________
- Steam: Lobopack23 - Link
Contact me if you need any help with Pokemod.
- 2nd Generation Pokemod - Link
(new skills, items, and pokemons)
- Buy Xp - Link
lobopack23 is offline
sebiq
Junior Member
Join Date: Jun 2020
Old 06-06-2020 , 16:38   Re: I need some help with the plugin
Reply With Quote #7

Quote:
Originally Posted by lobopack23 View Post
I updated it, took me like 3-4 minutes, some of the arrays that you put just needed to add [i], for example you put players = iPlayers, needed to change it to players = iPlayers[id]. I had to add some semicolons ( ; ) to the end of some lines. And also, in one line you added ColorChat but needed to change to client_printcolor instead..

here is the code below

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>

#pragma semicolon	1

#define MAX_ROUNDS	15
#define TASK		1337
#define ACCESS ADMIN_KICK
#define TIME 30.0
#define ADVERTISING_TIME 80.0

static const

	PLUGIN[ ] =		"Destroy Mix",
	VERSION[ ] =		"0.0.2",
	AUTHOR[ ] =		"by sebiq.",
	TAG[ ] =		"[Destroy MiX]";

new const g_szInterpCommands[ ][ ] =
{
	"cl_filterstuffcmd 0",
	"ex_interp 0.01",
	"cl_cmdrate 105",
	"cl_updrate 102",
	"rate 25000"
	
};

stock const messages [ ] [ ] =
{
	"!g[Destroy MiX] !tForum!y: !gwww.site.com/forum!y.",
        "!g[Destroy Mix] !yAdresa !tTeamSpeak!y: !gTS.SITE.COM!y.",
	"!g[Destroy Mix] !yPlugin creat !t& !yconfigurat de catre !gsebiq. !ypentru !gwww.site.com"

};

//new g_On[ 33 ] = 0;

new SayText;
	
new bool: g_bMixStarted;
new bool: g_bEndRound;
new bool: g_bSecondPart;

new g_iTeroScore, g_iCTScore;
new g_iTeroSScore, g_iCTSScore;

new cvar_msg;
new SyncHud;
new KNIFE = 0;
new paused = 0;
new amx_gamename;

new Float:player_origin[33][3];
new bool:g_bUsersCanChat = true;
new bool:hasdemo[33];

public plugin_init( )
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd("say .start", "cmdStart", ADMIN_KICK);
	register_clcmd("say .stop", "cmdStop", ADMIN_KICK);
	register_clcmd("say .warm", "cmdWarm", ADMIN_KICK);
        register_clcmd("say .extra", "cmdExtra", ADMIN_KICK);
	register_clcmd("say .lame", "cmdKnife", ADMIN_KICK);
	register_clcmd("say .specall", "moveSpec", ADMIN_KICK);
	register_clcmd("say .rr", "cmdRestart", ADMIN_KICK);
	register_clcmd( "say .off", "cmdBlocare", ADMIN_KICK);
	register_clcmd("say .on", "cmdDeblocare", ADMIN_KICK);
	register_clcmd("say .interp", "cmdSetari", ADMIN_KICK);
	register_clcmd("say .comenzi", "cmdComenzi", ADMIN_KICK);
	register_concmd("amx_t", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
	register_concmd("amx_ct", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
	register_concmd("amx_spec", "admin_chteam", ADMIN_KICK, "<authid, nick or #userid>");
	register_clcmd("say .pause", "cmdPause", ADMIN_KICK);
	register_clcmd("say .unpause", "cmdUnPause", ADMIN_KICK);
	register_clcmd("say_team .start", "cmdStart", ADMIN_KICK);
	register_clcmd("say_team .stop", "cmdStop", ADMIN_KICK);
	register_clcmd("say_team .warm", "cmdWarm", ADMIN_KICK);
        register_clcmd("say_team .extra", "cmdExtra", ADMIN_KICK);
	register_clcmd("say_team .lame", "cmdKnife", ADMIN_KICK);
	register_clcmd("say_team .specall", "moveSpec", ADMIN_KICK);
	register_clcmd("say_team .rr", "cmdRestart", ADMIN_KICK);
	register_clcmd("say_team .off", "cmdBlocare", ADMIN_KICK);
	register_clcmd("say_team .on", "cmdDeblocare", ADMIN_KICK);
	register_clcmd("say_team .interp", "cmdSetari", ADMIN_KICK);
	register_clcmd("say_team .comenzi", "cmdComenzi", ADMIN_KICK);
	register_clcmd("say_team .pause", "cmdPause", ADMIN_KICK);
	register_clcmd("say_team .unpause", "cmdUnPause", ADMIN_KICK);

	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say", "hookSay" );
	register_clcmd( "say_team", "hookSay" );
	
	RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
	amx_gamename = register_cvar( "amx_gamename", "Destroy MiX" );
	register_forward( FM_GetGameDescription, "GameDesc" ); 
	register_event("SendAudio", "EventTeroWin", "a", "2&%!MRAD_terwin");
	register_event("SendAudio", "EventCTWin", "a", "2&%!MRAD_ctwin");
	register_event("CurWeapon","switchweapon","be","1=1","2!29");
	register_logevent("LogEventRoundEnd", 2, "1=Round_End");
	register_logevent("LogEventRound", 2, "1=Round_End");
	register_logevent("LogEventRoundStart", 2, "1=Round_Start");
	set_task ( ADVERTISING_TIME, "show_messages", _, _, _,"b" );
	cvar_msg = register_cvar("score_msg", "3");
	SyncHud = CreateHudSyncObj( );
	SayText = get_user_msgid("SayText");
	
}

//=================================================MIX COMMANDS===============================================//

public switchweapon(id)
{
	if (KNIFE == 1)
	{
		engclient_cmd(id, "weapon_knife");
	}
}

public cmdRestart(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor(id, "%s!y Nu ai acces la aceasta comanda.", TAG);
		return PLUGIN_HANDLED;
	}
	if( !g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti da restart inainte sa inceapa meciul.", TAG);

		return PLUGIN_HANDLED;
	}
	
	if( g_bSecondPart )
	{
		g_iTeroScore = g_iTeroSScore;
		g_iCTScore = g_iCTSScore;
		KNIFE = 0;
		g_bMixStarted = true;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		
		client_printcolor(id, "%s %s a repornit partea a II-a a meciului. Good luck!", TAG, szName);
	}
	
	else if( !g_bSecondPart )
	{
		g_iTeroScore = 0;
		g_iCTScore = 0;
		g_iTeroSScore = 0;
		g_iCTSScore = 0;
		KNIFE = 0;
		g_bMixStarted = true;
		g_bSecondPart = false;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		client_printcolor(id, "%s!y %s a repornit prima parte a meciului. Good luck!", TAG, szName);
	}
	
	server_cmd("sv_restart 1");
	
	return PLUGIN_HANDLED;
}

public cmdKnife(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti porni runda de lame in timpul meciului.", TAG);
		
		return PLUGIN_HANDLED;
	}
	KNIFE = 1;
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	server_cmd("sv_restart 1");
	server_cmd("exec live.cfg");
	server_cmd("mp_freezetime 0");
	client_printcolor(id, "%s!y %s a pornit runda de lame.", TAG, szName);
	strip_user_weapons(0);
	
	return PLUGIN_HANDLED;
}

public cmdStart(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( !g_bSecondPart )
	{
		if( g_bMixStarted )
		{
			client_printcolor(id, "%s!y Meciul este deja pornit.", TAG);
			
			return PLUGIN_HANDLED;
		}
		
		g_iTeroScore = 0;
		g_iCTScore = 0;
		g_iTeroSScore = 0;
		g_iCTSScore = 0;
		KNIFE = 0;
		g_bMixStarted = true;
		g_bSecondPart = false;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		taskMSG(TASK);
		
		server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		
		client_printcolor(id, "%s!y %s a pornit prima parte a meciului. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	else if( g_bSecondPart )
	{
		KNIFE = 0;
		g_bMixStarted = true;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 800" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		
		client_printcolor(id, "%s!y %s a pornit a II-a parte a meciului. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	return PLUGIN_HANDLED;
}

public cmdWarm(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti da warm in timpul meciului.", TAG);
		
		return PLUGIN_HANDLED;
	}
	
	g_iTeroScore = 0;
	g_iCTScore = 0;
	KNIFE = 0;
	g_bMixStarted = false;
	g_bSecondPart = false;
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	if( task_exists(TASK) )
	{
		remove_task(TASK);
	}
	
	client_printcolor(id, "%s!y %s a pornit rundele de incalzire.", TAG, szName);
	server_cmd("sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");

	
	return PLUGIN_HANDLED;
}

public cmdStop(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( !g_bMixStarted )
	{
		client_printcolor(id, "%s!y Meciul este deja oprit.", TAG);
		
		return PLUGIN_HANDLED;
	}
	
	g_iTeroScore = 0;
	g_iCTScore = 0;
	g_iTeroSScore = 0;
	g_iCTSScore = 0;
	
	g_bMixStarted = false;
	g_bSecondPart = false;
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	if( task_exists(TASK) )
	{
		remove_task(TASK);
	}
	
	client_printcolor(id, "%s!y %s a anulat meciul.", TAG, szName);
        server_cmd("sv_restart 1");
        server_cmd( "mp_freezetime 0" );
        server_cmd( "mp_buytime 0.25" );
        server_cmd( "mp_startmoney 16000" );
        server_cmd( "mp_roundtime 8.75" );
        server_cmd( "mp_forcecamera 2" );
        server_cmd( "mp_friendlyfire 0");
        server_cmd( "mp_c4timer 35");

	return PLUGIN_HANDLED;
}

public EventTeroWin( )
{
	if( g_bMixStarted && !g_bEndRound )
	{
		g_bEndRound = true;
    
		g_iTeroScore++;
	
	}
}

public EventCTWin( )
{
	if( g_bMixStarted && !g_bEndRound )
	{
		g_bEndRound = true;
		
		g_iCTScore++;
   
	}
}

public LogEventRoundStart( )
{
	g_bEndRound = false;
        
}

public LogEventRoundEnd( )
{
	if( g_bMixStarted )
	{
		if( g_iTeroScore + g_iCTScore == MAX_ROUNDS )
		{
			new iPlayers[32], iNum, player;
			
			get_players(iPlayers, iNum, "h");
			
			for( new i = 0; i < iNum; i++ )
			{
				player = iPlayers[i];
				
				if( cs_get_user_team(player) == CS_TEAM_T )
				{
					cs_set_user_team(player, CS_TEAM_CT);
				}
				
				else if( cs_get_user_team(player) == CS_TEAM_CT )
				{
					cs_set_user_team(player, CS_TEAM_T);
				}
			}
			server_cmd( "sv_restart 1");
        		server_cmd( "mp_freezetime 10" );
        		server_cmd( "mp_buytime 0.25" );
        		server_cmd( "mp_startmoney 800" );
        		server_cmd( "mp_roundtime 1.75" );
        		server_cmd( "mp_forcecamera 2" );
       	 		server_cmd( "mp_friendlyfire 0");
        		server_cmd( "mp_c4timer 35");
			
			new iAux = g_iTeroScore;
			g_iTeroScore = g_iCTScore;
			g_iCTScore = iAux;
			
			g_iTeroSScore = g_iTeroScore;
			g_iCTSScore = g_iCTScore;
			
			g_bSecondPart = true;
			g_bMixStarted = false;
			
			server_cmd("sv_restart 1");
		}
		
		if( g_iTeroScore >= MAX_ROUNDS + 1 )
		{
			client_printcolor(0, "%s!t Echipa Tero!y a castigat meciul cu!g %d!y la!g %d!y.", TAG, g_iTeroScore, g_iCTScore);
			server_cmd( "sv_restart 1");
        		server_cmd( "mp_freezetime 0" );
        		server_cmd( "mp_buytime 0.25" );
			server_cmd( "mp_startmoney 16000" );
			server_cmd( "mp_roundtime 8.75" );
        		server_cmd( "mp_forcecamera 2" );
       	 		server_cmd( "mp_friendlyfire 0");
        		server_cmd( "mp_c4timer 35");

			if( task_exists(TASK) )
			{
				remove_task(TASK);
			}
			cmdStop(TASK);
			return PLUGIN_HANDLED;
		}
		
		else if( g_iCTScore >= MAX_ROUNDS + 1 )
		{
			client_printcolor(0, "%s!t Echipa CT!y a castigat meciul cu!g %d!y la!g %d!y.", TAG, g_iCTScore, g_iTeroScore);
			server_cmd( "sv_restart 1");
       			server_cmd( "mp_freezetime 0" );
        		server_cmd( "mp_buytime 0.25" );
        		server_cmd( "mp_startmoney 16000" );
        		server_cmd( "mp_roundtime 8.75" );
        		server_cmd( "mp_forcecamera 2" );
        		server_cmd( "mp_friendlyfire 0");
        		server_cmd( "mp_c4timer 35");	

			if( task_exists(TASK) )
			{
				remove_task(TASK);
			}
			cmdStop(TASK);
			
			return PLUGIN_HANDLED;
		}
			
		else if( g_iTeroScore == MAX_ROUNDS && g_iCTScore == MAX_ROUNDS )
		{
			client_printcolor(0, "%s!y Meciul s-a terminat egal.", TAG);
			client_printcolor(0, "%s!y Pentru prelungiri, tastati comanda !g/extra!y.", TAG);
			
			cmdStop(TASK);
			
			return PLUGIN_HANDLED;
		}
		
		if( get_pcvar_num(cvar_msg) != 2 )
		{
			client_printcolor(0, "%s!y Terrorists!g %d!y -!g %d!y Counter-Terrorists", TAG, g_iTeroScore, g_iCTScore);
		}
	}
	return PLUGIN_HANDLED;
}

public taskMSG(T_A_S_K)
{
	if( get_pcvar_num(cvar_msg) > 1 )
	{
		set_hudmessage(80, 80, 80, -1.0, 0.03, 0, 0.0, 1.1, 0.0, 0.0, -1);
		ShowSyncHudMsg(0, SyncHud, "Echipa TERO %d - %d Echipa CT", g_iTeroScore, g_iCTScore);
	}
	
	set_task(1.0, "taskMSG", TASK);
}

public moveSpec(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}

	if( g_bMixStarted )
	{
		client_printcolor(id, "%s!y Nu poti pune jucatorii !gSpectator !yin timpul meciului.", TAG);
		return PLUGIN_HANDLED;
	}

	new players[32], total, i;
	get_players(players,total,"h");
	for (i=0; i<total;i++)
	{
		user_kill(players[i], 0);
		cs_set_user_team(players[i], CS_TEAM_SPECTATOR);
	}
	client_printcolor(id, "%s!y Jucatorii au fost pusi !gSpectator !ypentru alegeri.", TAG);
	return PLUGIN_HANDLED;
}

//===============================================================================================//
//==================================AFK REPORT=======================================================================//
public e_Spawn(id)
{
    remove_task(id);
    if(is_user_alive(id))
    {
        set_task(0.8, "get_spawn", id);
    }
    return HAM_IGNORED;
}

public get_spawn(id)
{
    pev(id, pev_origin, player_origin[id]);
    set_task(TIME, "check_afk", id);
}

public check_afk(id)
{
    if(is_user_alive(id))
    {
        if(same_origin(id))
        {
            new name[33];
            get_user_name(id, name, 32);
            client_printcolor(id, "%s!y Player-ul!g %s!y a fost raportat ca AFK!", TAG, name);
        }
    }
}

public same_origin(id)
{
	new Float:origin[3];
	new Float:player_origin[3];
	pev(id, pev_origin, origin);

	for(new i = 0; i < 3; i++)
		if ( origin[i] != player_origin[id])
           		 return 0;
	return 1;
}

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

//===============================================BLOCK CHAT=============================================================
public ClCmdSay( id )
{
	
	static szArgs[ 192 ];
	read_args( szArgs, sizeof ( szArgs ) -1 );
	
	if( !szArgs[ 0 ] )	return PLUGIN_CONTINUE;
	
	if( !g_bUsersCanChat )
	{
		client_printcolor( id, "%s!y Chat-ul este!g blocat!y, folositi functia !tsay_team!y!", TAG );
	}
		
	return g_bUsersCanChat ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
	
}

public cmdBlocare( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	if( !g_bUsersCanChat )
	{
		client_printcolor( id, "%s!y Chat-ul este deja!g blocat!y.", TAG );
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	client_printcolor( id, "%s!y Chat-ul a fost!g blocat!y de catre adminul!g %s!y.", TAG, szName );
	
	g_bUsersCanChat = false;
	
	return PLUGIN_CONTINUE;
}

public cmdDeblocare( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	if( g_bUsersCanChat )
	{
		client_printcolor( id, "%s!y Chat-ul este deja!g deblocat!y.", TAG );
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	client_printcolor( id, "%s!y Chat-ul a fost!g deblocat!y de catre adminul!y %s!g.", TAG, szName );
	
	g_bUsersCanChat = true;
	
	return PLUGIN_CONTINUE;
}

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

public cmdSetari( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	static iSize = sizeof ( g_szInterpCommands );
	
	for( new i = 0; i < iSize; i++ )
		client_cmd( 0, g_szInterpCommands[ i ] );
		
	client_print( 0, print_console, "=================== Setari War-Mix ================" );
	client_print( 0, print_console, "[Destroy] Comenzile ti-au fost setate! (cl_cmdrate 105, cl_updrate 102, rate 25000 si ex_interp 0.01." );
	client_print( 0, print_console, "====================================================" );
			
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	client_printcolor( id, "%s !g%s!y executa interp pe jucatori. Verificati consola.", TAG, szName );
	
	return PLUGIN_CONTINUE;
}

public cmdComenzi( id )
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	
	static iSize = sizeof ( g_szInterpCommands );
	
	for( new i = 0; i < iSize; i++ )
		client_cmd( 0, g_szInterpCommands[ i ] );
		
	client_print( 0, print_console, "=================== Comenzi War-Mix ================" );

	client_print( 0, print_console, "/comenzi - Lista comenzi war" );
	client_print( 0, print_console, "/start - Porneste meciul" );
	client_print( 0, print_console, "/stop - Opreste meciul" );
	client_print( 0, print_console, "/lame - Porneste runda de lame" );
	client_print( 0, print_console, "/off - Opreste chat-ul" );
	client_print( 0, print_console, "/on - Porneste chat-ul " );
	client_print( 0, print_console, "/interp - Seteaza interp 0.01 playerilor" );
	client_print( 0, print_console, "/warm - Porneste warm-up" );
	client_print( 0, print_console, "/rr - Restart" );
	client_print( 0, print_console, "/money - Arata situatia financiara" );
	client_print( 0, print_console, "/demo nick - Porneste demo jucatorului respectiv" );
	client_print( 0, print_console, "/extra - Porneste rundele de departajare in caz de egal" );
	client_print( 0, print_console, "/specall- Transferi toti playerii la SPEC" );
 
	client_print( 0, print_console, "----------------------------------------" );
	client_print( 0, print_console, "----Comenzi amx: ----" );
	client_print( 0, print_console, "---------------------------------------" );

	client_print( 0, print_console, "amx_ct nume - Transferi player-ul la CT" );
	client_print( 0, print_console, "amx_t nume - Transferi player-ul la T" );
	client_print( 0, print_console, "amx_spec nume - Transferi player-ul la spectatori" );
	client_print( 0, print_console, "====================================================" );
			
	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	
	
	
	return PLUGIN_CONTINUE;
}

//======================================= Prelungiri =================================================
public cmdExtra(id)
{
	if( !UserHasAcces( id ) )
	{
		client_printcolor( id, "%s!y Nu ai acces la aceasta comanda.", TAG );
		return PLUGIN_HANDLED;
	}
	if( !g_bSecondPart )
	{
		if( g_bMixStarted )
		{
			client_printcolor(id, "%s!y Meciul este deja pornit.", TAG);
			
			return PLUGIN_HANDLED;
		}
		
		g_iTeroScore = 0;
		g_iCTScore = 0;
		g_iTeroSScore = 0;
		g_iCTSScore = 0;
		KNIFE = 0;
		g_bMixStarted = true;
		g_bSecondPart = false;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
		taskMSG(TASK);
		
		server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 10000" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");

		client_printcolor(id, "%s!y %s a pornit prima parte a prelungirilor. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	else if( g_bSecondPart )
	{
		KNIFE = 0;
		g_bMixStarted = true;
		new szName[ 32 ];
		get_user_name( id, szName, sizeof ( szName ) -1 );
                server_cmd("sv_restart 1");
                server_cmd( "mp_freezetime 10" );
                server_cmd( "mp_buytime 0.25" );
                server_cmd( "mp_startmoney 10000" );
                server_cmd( "mp_roundtime 1.75" );
                server_cmd( "mp_forcecamera 2" );
                server_cmd( "mp_friendlyfire 1");
                server_cmd( "mp_c4timer 35");
		
		client_printcolor(id, "%s!y %s a pornit a II-a parte a prelungirilor. Good luck!", TAG, szName);
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
                client_printcolor(id, "!gLIVE !yLIVE !gLIVE !t!!! !gGood luck!");
	}
	
	return PLUGIN_HANDLED;
}

//==========================================DEMO=======================================================
      
new const g_Demoname[] = "DEMO_Destroy_RO";


public client_connect(id)
{
	hasdemo[id] = false;
}

public hookSay( id )
{
	new szSaid[ 192 ];
	read_args( szSaid, sizeof( szSaid ) -1 );
	remove_quotes( szSaid );
	
	if( contain( szSaid, "/demo" ) != -1 )
	{
		if( get_user_flags( id ) & ADMIN_KICK )
		{
			new target[ 32 ];
			copy( target, sizeof( target ) -1, szSaid[ 6 ] );
			
			new id2 = cmd_target( id, target, 2 );
			
			if(hasdemo[id2])
			{
				static szName[ 32 ]; 
				new mapname[32];
				get_user_name( id2, szName, sizeof( szName ) -1 );
				get_mapname(mapname,31);
				client_printcolor( id, "%s !y Jucatorul %s are deja demo!", TAG, szName );
				return PLUGIN_HANDLED;
			}
			
			if( id2 )
			{
				static szName[ 32 ]; 
				new mapname[32];
				get_user_name( id2, szName, sizeof( szName ) -1 );
				get_mapname(mapname,31);
				hasdemo[id2] = true;
				
				client_cmd( id2, "record ^"%s-%s^"", g_Demoname, mapname);
				
				client_printcolor( id, "%s!y Ai pornit demo pe jucatorul!g %s!y!", TAG, szName );
			}
			
			else
			{
				console_print( id, "Player-ul nu exista !!!" );
			}
			
			return PLUGIN_HANDLED;
		}
	}
	return PLUGIN_CONTINUE;
}

//========================================TRANSFER===================================================
public admin_chteam(id, level, cid) {
   if (!cmd_access(id, level, cid, 2))
      return PLUGIN_HANDLED;
   
   new cmd[10];
   new arg[32];
   new name[32], name2[32];
   
   read_argv(0,cmd,9);
   read_argv(1,arg,31);
   new player = cmd_target(id,arg,2);
   if (!player) return PLUGIN_HANDLED;
  
   user_kill(player, 1);
   get_user_name(id, name, 31);
   get_user_name(player, name2, 31);
   
   if(cmd[4]=='t')
   {
      cs_set_user_team(player,1);
      client_printcolor( id, "%s!y Adminul!g %s!y l-a mutat pe!g %s!y la!g TERO!y.", TAG, name, name2 );
   }
   if(cmd[4]=='c')
   {
      cs_set_user_team(player,2);
      client_printcolor( id, "%s!y Adminul!g %s!y l-a mutat pe!g %s!y la!g CT!y.", TAG, name, name2 );
   }
   if(cmd[4]=='s')
   {
      cs_set_user_team(player,3);
      client_printcolor( id, "%s!y Adminul!g %s!y l-a mutat pe!g %s!y la!g Spectator!y.", TAG, name, name2 );
   }
   return PLUGIN_HANDLED;
} 

//============================================PAUSE & NOPAUSE=========================================
public cmdPause(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
if (paused == 0)
{
paused = 1;
server_cmd("amx_pause");
client_printcolor( id, "%s!y SERVER PAUSED!", TAG);
}
return PLUGIN_HANDLED;
}
public cmdUnPause(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
if (paused == 1)
{
paused = 0;
server_cmd("amx_pause");
client_printcolor( id, "%s!y SERVER UNPAUSED!", TAG);
}
return PLUGIN_HANDLED;
}

public show_messages ( )
{
	new Buffer[256];
	formatex(Buffer, sizeof Buffer - 1, "!g%s", messages[random(sizeof messages)]);
	
	new players[32], num, id;
	get_players(players, num);
	
	for(new i = 0 ; i < num ; i++)
	{
		id = players[id];
	
		message_begin(MSG_ONE, get_user_msgid("SayText"), _, id);
		write_byte(id);
		write_string(Buffer);
		message_end();
	}
}

public GameDesc( ) {
static gamename[32];
get_pcvar_string( amx_gamename, gamename, 31 );
forward_return( FMV_STRING, gamename );
return FMRES_SUPERCEDE;
}


stock client_printcolor(const id, const input[], any:...) // stock in client_printcolor
{
        new count = 1, players[32];
        static msg[191];
        vformat(msg, 190, input, 3);
       
        replace_all(msg, 190, "!g", "^4"); // Green Color
        replace_all(msg, 190, "!y", "^1"); // Default Color
        replace_all(msg, 190, "!t", "^3"); // Team Color
       
        if (id) 
		players[0] = id; 
	
	else get_players(players, count, "ch");
	{
                for ( new i = 0; i < count; i++ )
                {
                        if ( is_user_connected(players[i]) )
                        {
                                message_begin(MSG_ONE_UNRELIABLE, SayText, _, players[i]);
                                write_byte(players[i]);
                                write_string(msg);
                                message_end();
                        }
                }
        }
}
It compiles, not sure if it works. I just took care of your errors and indentation issues.
i try now if it's work
sebiq is offline
sebiq
Junior Member
Join Date: Jun 2020
Old 06-06-2020 , 16:50   Re: I need some help with the plugin
Reply With Quote #8

Thank you very much for waste your time but doesn't work, I'll solve it somehow ...

Last edited by sebiq; 06-06-2020 at 16:51.
sebiq is offline
lobopack23
Senior Member
Join Date: Jun 2009
Location: California , United Stat
Old 06-06-2020 , 16:58   Re: I need some help with the plugin
Reply With Quote #9

Good luck sebiq!
__________________
- Steam: Lobopack23 - Link
Contact me if you need any help with Pokemod.
- 2nd Generation Pokemod - Link
(new skills, items, and pokemons)
- Buy Xp - Link
lobopack23 is offline
sebiq
Junior Member
Join Date: Jun 2020
Old 06-06-2020 , 17:00   Re: I need some help with the plugin
Reply With Quote #10

Thank you, you too
sebiq is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode