Quote:
Originally Posted by lucas_7_94
i think you need use tries.
|
Unnecessary.
Just use a 2-dimensional array.
Code:
#define MAX_PLAYERS 32
new g_iKills[ MAX_PLAYERS + 1 ][ MAX_PLAYERS + 1 ];
new g_iMaxPlayers;
public plugin_init( )
{
register_event( "DeathMsg", "EventDeathMsg", "a", "1>0" );
g_iMaxPlayers = get_maxplayers( );
}
public client_disconnect( iPlayer )
{
arrayset( g_iKills[ iPlayer ], 0, ( g_iMaxPlayers + 1 ) );
for( new i = 1; i <= g_iMaxPlayers; i++ )
{
g_iKills[ i ][ iPlayer ] = 0;
}
}
public EventDeathMsg( )
{
new iKiller = read_data( 1 );
if( iKiller <= g_iMaxPlayers )
{
new iVictim = read_data( 2 );
new iKills = ++g_iKills[ iKiller ][ iVictim ];
new szName[ 32 ];
get_user_name( iVictim, szName, charsmax( szName ) );
client_print( iKiller, print_chat. "* You have killed %s %i times!", szName, iKills );
get_user_name( iKiller, szName, charsmax( szName ) );
client_print( iVictim, print_chat. "* You have been killed by %s %i times!", szName, iKills );
}
}
__________________