Raised This Month: $ Target: $400
 0% 

[Get player with most kills]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-20-2010 , 11:32   Re: [Get player with most kills]
Reply With Quote #4

Quote:
Originally Posted by lazarev View Post
PHP Code:
WinnerCheck()
{
    new 
players[32], numid;
    
get_playersplayersnum );
    for( new 
0numi++ )
    {
        
id players];
        if(
Kills[id] >= RequiredKills)
        {
            new 
szName33 ];
            
get_user_nameidszName32 );
            
client_print(0,print_chat "%s have won this event!"szName );
            return 
PLUGIN_CONTINUE;
        }
    }
    return 
PLUGIN_CONTINUE;

call WinnerCheck() at round end or at deathmsg.
It's stupid, but you're missing a comma after print_chat. Also, he wants it for both teams so..

PHP Code:
WinnerCheck()
{
    new 
players[32], numid;
    
get_playersplayersnum );
    for( new 
0numi++ )
    {
        
id players];
        
        if( (
cs_get_user_team(id) == CS_TEAM_T) && (Kills[id] >= RequiredKills) )
        {
            new 
szName33 ];
            
get_user_nameidszName32 );
            
client_print(0print_chat"%s has the most kills on the terrorist team!"szName );
            
            return 
PLUGIN_CONTINUE;
        }
        
        if( (
cs_get_user_team(id) == CS_TEAM_CT) && (Kills[id] >= RequiredKills) )
        {
            new 
szName33 ];
            
get_user_nameidszName32 );
            
client_print(0print_chat"%s has the most kills on the counter-terrorist team!"szName );
            
            return 
PLUGIN_CONTINUE;
        }
    }
    
    return 
PLUGIN_CONTINUE;

Of course with the cs_get_user_team he'll have to use #include <cstrike> but it couldn't hurt anyone.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX 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 21:58.


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