Thanks for support.
PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < csstats >
#include < csx >
#define STATS_KILLS 0
#define STATS_DEATHS 1
#define STATS_HS 2
#define STATS_TKS 3
#define STATS_SHOTS 4
#define STATS_HITS 5
#define STATS_DAMAGE 6
#define IsPlayer(%0) ( 1 <= (%0) <= g_iMaxPlayers )
new t_sName[31 + 1] = ""
new g_sBuffer[2047 + 1] = ""
new g_iMaxPlayers;
new const g_szTopColors[ ][ ] = { "#ff0000", "#07fcff", "#fff007"};
public plugin_init()
{
register_plugin( "Rank + Top15", "1.0", "daNzEt")
register_event("DeathMsg", "event_DeathMsg", "a", "1>0");
register_clcmd( "say /rank", "cmdRank", 0 );
register_clcmd( "say /stats", "cmdRank", 0 );
register_clcmd( "say /rankstats", "cmdRank", 0 );
register_clcmd( "say /top15", "cmdTop15", 0 );
g_iMaxPlayers = get_maxplayers();
}
Float:effec(izStats[8])
{
if (!izStats[STATS_KILLS])
return (0.0)
return (100.0 * float(izStats[STATS_KILLS]) / float(izStats[STATS_KILLS] + izStats[STATS_DEATHS]))
}
Float:accuracy(izStats[8])
{
if (!izStats[STATS_SHOTS])
return (0.0)
return (100.0 * float(izStats[STATS_HITS]) / float(izStats[STATS_SHOTS]))
}
format_top15( sBuffer[2047+1] )
{
new iMax = get_statsnum()
new izStats[8], izBody[8]
new iLen = 0
if (iMax > 15)
{
iMax = 15
}
new lKills[16], lDeaths[16], lHits[16], lShots[16], lEff[16], lAcc[16]
format(lKills, 15, "Kill")
format(lDeaths, 15, "Deaths")
format(lHits, 15, "Hits")
format(lShots, 15, "Shots")
format(lEff, 15, "Eff.")
format(lAcc, 15, "Acc.")
ucfirst(lEff)
ucfirst(lAcc)
iLen = format(sBuffer, 2047, "<body bgcolor=#000000><font color=#FFFFFF><pre>")
iLen += format(sBuffer[iLen], 1500-iLen,"<center><img src=^"http://s15.************/i9k79lhln/rsz_2n5irhd.png^"></center></img>");
iLen += format(sBuffer[iLen], 2047 - iLen, "%s %-22.20s %5s %7s %8s %7s %5s %8s %5s^n", "#", "Nick", lKills, lDeaths, lHits, lShots, "HS", lEff, lAcc)
new iMaxColors = sizeof( g_szTopColors );
for (new i = 0; i < iMax && 2047 - iLen > 0; i++)
{
get_stats(i, izStats, izBody, t_sName, 31)
replace_all(t_sName, 31, "<", "[")
replace_all(t_sName, 31, ">", "]")
if( i < iMaxColors )
{
iLen += format(sBuffer[iLen], 2047 - iLen, "<font color=%s>%2d %-17.14s %7d %7d %8d %8d %6d %6.0f%% %6.0f%%</font>^n", g_szTopColors[ i ], i + 1, t_sName, izStats[STATS_KILLS],
izStats[STATS_DEATHS], izStats[STATS_HITS], izStats[STATS_SHOTS], izStats[STATS_HS], effec(izStats), accuracy(izStats))
}
else
{
iLen += format(sBuffer[iLen], 2047 - iLen, "%2d %-17.14s %7d %7d %8d %8d %6d %6.0f%% %6.0f%%^n", i + 1, t_sName, izStats[STATS_KILLS],
izStats[STATS_DEATHS], izStats[STATS_HITS], izStats[STATS_SHOTS], izStats[STATS_HS], effec(izStats), accuracy(izStats))
}
}
}
public cmdTop15( id )
{
format_top15( g_sBuffer );
show_motd( id, g_sBuffer, "Top 15" );
return PLUGIN_CONTINUE;
}
public cmdRank( id )
{
new izStats[8], izBody[8];
new iRankPos, iRankMax;
iRankPos = get_user_stats( id, izStats, izBody );
iRankMax = get_statsnum();
chat_color(id, "!nPozitia ta in rank este !t%d !ndin !t%d !n[!g%d !nkills] [!g%d !ndeaths] [!g%d !nhits]", iRankPos, iRankMax, izStats[STATS_KILLS], izStats[STATS_DEATHS], izStats[STATS_HITS] );
return PLUGIN_CONTINUE;
}
public event_DeathMsg(id)
{
new iKiller = read_data(1);
new iVictim = read_data(2);
if(iKiller != iVictim && IsPlayer(iKiller))
{
new name[32], szWeapon[32];
get_user_name(iKiller, name, charsmax(name));
read_data(4, szWeapon, charsmax(szWeapon));
chat_color(iVictim, "!nJucatorul !t%s !nte-a ucis cu !g%s !nsi a ramas cu !g%d !nhp", name, szWeapon, get_user_health(iKiller));
}
}
stock chat_color(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!n", "^1")
replace_all(msg, 190, "!t", "^3")
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, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
How can i remove definitely Eff and Acc. from /top15 cmd?