Raised This Month: $ Target: $400
 0% 

[SOLVED] NewRound stopped working O_O


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-02-2007 , 12:13   Re: NewRound stopped working O_O
Reply With Quote #10

Try this, should work.

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN  "Most Kills" #define VERSION "1.0" #define AUTHOR  "MadMaurice" #define MAX_PLAYERS 32 new player_kills[MAX_PLAYERS + 1]; new most_kills; public plugin_init() {     register_plugin( PLUGIN, VERSION, AUTHOR );         register_event( "DeathMsg", "count_kill", "a" );     register_event( "HLTV", "eNewRound", "a", "1=0", "2=0" );         most_kills = register_cvar( "sv_most_kills", "1" ); } public resetcounter() {     arrayset( player_kills, 0, MAX_PLAYERS + 1 ) } public count_kill() {     if( !get_pcvar_num( most_kills ) )         return;             new iKiller = read_data( 1 );     new iVictim = read_data( 2 );         if( iKiller == iVictim )     {         client_print( iKiller, print_chat, "[Most Kills] Team Kills are not counted!" );     }     else     {         player_kills[iKiller]++;         client_print( iKiller, print_chat, "[Most Kills] You have %d kills yet!", player_kills[iKiller] );     } } public get_most_kills_id() {     new mkid, lkills = 0, i;         for( i = 0; i < MAX_PLAYERS + 1; i++ )     {         if( player_kills[i] > lkills )         {             mkid = i;             lkills = player_kills[i];         }     }     return mkid; } public client_disconnect( id ) {     player_kills[id] = 0; } public eNewRound() {     if( !get_pcvar_num( most_kills ) )         return;             new mkid = get_most_kills_id();         static name[32];     get_user_name( mkid, name, 31 );         if( mkid > 0 )     {         client_print( 0, print_chat,"[Most Kills] Kill King is %s with %d kills! Congratulations!", name, player_kills[mkid] );         static iPlayers[32], iNum, pid;         get_players( iPlayers, iNum, "c" );                 for( new i = 0; i < iNum; i++ )         {             pid = iPlayers[i];             client_print( pid, print_chat, "[Most Kills] You had %d kills!", player_kills[i] );         }     }     else         client_print( 0, print_chat,"[Most Kills] No kills this round!" );         resetcounter(); }
__________________

Last edited by Arkshine; 05-02-2007 at 12:18.
Arkshine 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 06:37.


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