PHP Code:
#include < amxmodx >
#include < amxmisc >
new gMaxPlayers
new gHeadshots[33]
new gUniqueID[33]
public plugin_init()
{
register_plugin( "HS MOTD", "1.0", "Exolent(rbk)" )
register_event( "DeathMsg", "EventDeathMsg", "a" )
register_clcmd( "say /kills", "CmdKills", _, "- shows stats screen" )
gMaxPlayers = get_maxplayers()
}
public EventDeathMsg()
{
new attacker = read_data( 1 )
if ( 1 <= attacker <= gMaxPlayers && read_data( 3 ) )
{
new uniqueID = get_user_userid( attacker )
if ( uniqueID != gUniqueID[attacker] )
{
gHeadshots[attacker] = 0
gUniqueID[attacker] = uniqueID
}
gHeadshots[attacker]++
}
}
public CmdKills( id )
{
ShowMOTD( id )
return PLUGIN_HANDLED
}
ShowMOTD( id ) {
static szMotd[ 2500 ], iDefaultLen;
if( !iDefaultLen ) {
add( szMotd, 2499, "<html>" );
add( szMotd, 2499, "<body style=^"background-color:#FF0000;^">" );
add( szMotd, 2499, "<div align=^"center^">" );
add( szMotd, 2499, "<h2> Player Headshots</h2>" );
add( szMotd, 2499, "<table style=^"border:1px #000000 dashed;^" cellpadding=^"3px^" cellspacing=^"0px^">" );
add( szMotd, 2499, "<tr bgcolor=^"#4A4A4A^" style=^"text-align:left;color:#FFFF00;^">" );
add( szMotd, 2499, "<th width=^"250px^"> Name</th>" );
add( szMotd, 2499, "<th width=^"200px^"> HEADSHOTS</th>" );
add( szMotd, 2499, "</tr>" );
iDefaultLen = strlen( szMotd );
}
new iLen = iDefaultLen;
new iCount;
static name[33];
for( new i = 1; i <= gMaxPlayers; i++ )
{
if( is_user_connected( i ) && !is_user_bot( i ) && !is_user_hltv( i ) )
{
get_user_name( i, name, 32 )
iLen += formatex( szMotd[ iLen ], 2499 - iLen, "<tr bgcolor=^"%s^">", ( ( iCount % 2 ) == 0 ) ? "#CCCCCC" : "#EEEEEE" );
iLen += formatex( szMotd[ iLen ], 2499 - iLen, "<td style=^"color:#009900;^"> %s</td>", name);
iLen += formatex( szMotd[ iLen ], 2499 - iLen, "<td style=^"color:#CC00CC;^">            %d</td>", gHeadshots[id] );
iLen += copy( szMotd[ iLen ], 2499 - iLen, "</tr>" );
iCount++;
}
}
formatex( szMotd[ iLen ], 2499 - iLen, "</table></div></body></html>" );
show_motd( id, szMotd, "PLAYERS HEADSHOTS" );
}
Little scripting i ve done in above code...
the headshots are not updated when clients type /kills than motd appear...showing headshot of all players similar i.e. SAME
when i hit 2 headshot..it shows all players stats like 2...when i hit 10 headshots than it shows 10 hs all...means hs is not updating by player.can u correct it....
------------------------------------------------
srry 4 bad eng