#include <amxmodx>
#include <cstrike>
#include <ColorChat>
static const
PLUGIN[ ] = "Ace Announcement",
VERSION[ ] = "1.0",
AUTHOR[ ] = "AUTOR",
TAG[ ] = "[LLG]";
new g_iFrags[33];
public plugin_init( )
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("DeathMsg", "EventDeathMsg", "a");
register_logevent("LogEventRoundEnd", 2, "1=Round_End");
}
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)
{
if(g_iFrags[id] == 5)
{
ColorChat(0, GREEN, "%s^x03 %s^x01 a realizat un ^x03ACE^x01.", TAG, get_name(id));
client_cmd(0, "spk vox/buzwarn");
}
else if(g_iFrags[id] == 4)
{
ColorChat(0, GREEN, "%s^x03 %s^x01 a realizat un ^x03SEMI-ACE^x01.", TAG, get_name(id));
client_cmd(0, "spk vox/buzwarn");
}
g_iFrags[id] = 0;
}
get_name(id)
{
new szName[32];
get_user_name(id, szName, charsmax(szName));
return szName;
}