 |
|
New Member
|

10-12-2014
, 19:49
Re: Kills per round
|
#6
|
Quote:
Originally Posted by HENNESSY
Here you go (not tested)
PHP Code:
#include < amxmodx >
new g_iKills[ 33 ]; new g_iMaxPlayers;
public plugin_init( ) { register_logevent( "LogEvent_RoundEnd", 2, "1=Round_End" ); register_logevent( "LogEvent_RoundStart", 2, "1=Round_Start" ); register_event( "DeathMsg", "Event_DeathMsg", "a" ); g_iMaxPlayers = get_maxplayers( ); }
public LogEvent_RoundEnd( ) { new iBest = 0; for( new i = 1; i <= g_iMaxPlayers; ++i ) { if( !is_user_connected( i ) ) continue; if( g_iKills[ i ] > g_iKills[ iBest ] ) { iBest = i; } } new szName[ 32 ]; get_user_name( iBest, szName, charsmax( szName ) ); client_print( 0, print_chat, "%s did the most kills this round.", szName ); }
public LogEvent_RoundStart( ) { arrayset( g_iKills, 0, 32 ); }
public Event_DeathMsg( ) { new iKiller = read_data( 1 ); new iVictim = read_data( 2 ); if( iKiller == iVictim || get_user_team( iKiller ) == get_user_team( iVictim ) ) return; ++g_iKills[ iKiller ]; }
|
Well, that's not exactly what I wanted to do, but nevertheless it was very useful. Thanks!
Last edited by muh; 10-12-2014 at 19:51.
|
|
|
|