Raised This Month: $ Target: $400
 0% 

The best player of round


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-03-2009 , 21:35   Re: The best player of round
Reply With Quote #3

PHP Code:
#include <amxmodx>

#define PLUGIN "BestPlayer"
#define VERSION "1.0"
#define AUTHOR "KaMaZZ"

new kills[33]

new 
bestplayer 0g_iMaxPlayers;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("DeathMsg""death_event""a""1>0");
    
register_logevent("wyczysc"2"1=Round_Start")
    
register_logevent("wiadomosc",2,"1=Round_End")
    
g_iMaxPlayers get_maxplayers();
}

public 
client_connect(id
{
    
kills[id] = 0
}

public 
death_event()
{
    static 
killer;
    if( ( 
killer read_data) ) != read_data) )
    {
        
killsread_data) ]++;
    }
}
        
public 
wiadomosc() 
{    
    if(
get_playersnum() < 2)
        return
    
    new 
deaths;
    
    for(new 
i=1<= g_iMaxPlayersi++)
    {
        
deaths get_user_deaths);
        
kills[i] -= deaths// kills[i] = kills[i] - deaths.
        
if(kills[i] >= kills[bestplayer])
            
bestplayer i;
    }
    
    new 
name[32];
    
get_user_name(bestplayername31);
    
    
client_print(0print_chat"Najlepszy gracz rundy: %s"name)
    
client_print(0print_chat"Zdobyl %d fragow"kills[bestplayer] + deaths)
    
// client_print(0, print_chat, "Trafil %d razy w leb", hsfrag)
}

public 
wyczysc()
{
    for( new 
<= g_iMaxPlayers i++ )
    {
        
kills] = 0;
    }

Sorry, hleV was faster, but try whatever you like(I think there's a mistake or two in hleV's code, like he said himself).
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 01-03-2009 at 21:38.
Dores 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 09:06.


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