Raised This Month: $ Target: $400
 0% 

[SOLVED] XXX Times kills


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-06-2010 , 13:10   Re: XXX Times kills
Reply With Quote #3

Quote:
Originally Posted by lucas_7_94 View Post
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 );     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode