Page 1 of 1

Modificare

Posted: 10 Jul 2018, 20:50
by Snoop Dogg
Sall, se poate sa mi-se editeze si mie pluginul de ace_chat
in loc sa apara ace&semi ace vreau sa apara ca pe LOL cu dauna semi dauna
daca intelegeti

Re: Modificare

Posted: 11 Jul 2018, 00:54
by Laurentiu P.
ace&semiaces este bazat pe numarul de fraguri nu pe daunA.
modificat la plesneala :') | Afiseaza codul
#include < amxmodx >
#include < cstrike >
#include < ColorChat >

#pragma semicolon 1

#define SEMI_ACE 4


static const

	PLUGIN[ ] =		"Ace_announcement",
	VERSION[ ] =		"1.1",
	AUTHOR[ ] =		"Rap^^",
	
	TAG[ ] =		"[ACE ANNOUNCEMENT]";


new g_iFrags[ 33 ];

new iForward;


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, AUTHOR );
	register_cvar( PLUGIN, AUTHOR, FCVAR_SERVER );
	
	register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
	register_event( "DeathMsg", "EventDeathMsg", "a" );
	
	register_logevent( "LogEventRoundEnd", 2, "1=Round_End" );
	
	iForward  = CreateMultiForward( "FwdPlayerDidAceOrSemi", ET_STOP, FP_CELL, FP_CELL );
}

public plugin_end( )
{
	DestroyForward( iForward );
}

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 || iKiller == iVictim || 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 ];
		
		if( g_iFrags[ player ] >= SEMI_ACE )
		{
			DidAceOrSemi( player );
			
			if( g_iFrags[ player ] == SEMI_DAUNA + 1 )
			{
				return PLUGIN_CONTINUE;
			}
		}
	}
	
	return PLUGIN_CONTINUE;
}

public CheckAce( id )
{
	if( g_iFrags[ id ] >= SEMI_DAUNA )
	{
		DidAceOrSemi( id );
	}
	
	g_iFrags[ id ] = 0;
}

public DidAceOrSemi( id )
{
	new iReturn = PLUGIN_CONTINUE;
	
	ExecuteForward( iForward, iReturn, id, g_iFrags[ id ] );
	
	if( iReturn == PLUGIN_HANDLED || iReturn == PLUGIN_HANDLED_MAIN )
	{
		return PLUGIN_HANDLED;
	}
	
	new szName[ 32 ];
	
	get_user_name( id, szName, sizeof szName - 1 );
			
	ColorChat( 0, GREEN, "%s^x03 %s^x01 made a%s ^x03%sDAUNA^x01.",
	TAG, szName, g_iFrags [ id ] == SEMI_DAUNA ? "" : "n", g_iFrags [ id ] == SEMI_DAUNA ? "SEMI-" : "" );
	
	client_cmd( 0, "spk vox/buzwarn" );
	
	return PLUGIN_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/