Raised This Month: $ Target: $400
 0% 

how to get team leaders CT and T


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cLLaW
Junior Member
Join Date: Nov 2008
Old 01-01-2009 , 07:55   how to get team leaders CT and T
Reply With Quote #1

I Want get team leaders CT and T How do i do this
cLLaW is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-01-2009 , 08:09   Re: how to get team leaders CT and T
Reply With Quote #2

If those CT and T leaders already exists, you should inform what the game/mod is or are them on on some plugin you are using.

If you want to get a plugin where's T and CT have team leaders, you need to give more information.
SnoW is offline
Send a message via MSN to SnoW
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-01-2009 , 08:12   Re: how to get team leaders CT and T
Reply With Quote #3

I think he means the CT with best score in CT team, and T with best score in T team...
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-01-2009 , 09:17   Re: how to get team leaders CT and T
Reply With Quote #4

Well that would make sense!
I'll make it if none other will, cLLaW, just confirm that it's what you want.
SnoW is offline
Send a message via MSN to SnoW
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 01-01-2009 , 09:19   Re: how to get team leaders CT and T
Reply With Quote #5

Try it but is not very precise.
PHP Code:
get_leaderteam )
{
    new 
score = - 1;
    new 
fragsindex 0;
    
    
// g_maxplayers = get_maxplayers();
    
    
for( new 1<= g_maxplayersi++ )
    {
        if( !
is_user_connected) )
            continue;
        if( 
get_user_team) != team )
            continue;
        
        
frags get_user_frags);
        if( 
frags >= score )
        {
            
score frags;
            
index i;
        }
    }
    
    return 
index;

Btw, there was a plugin that glows the best player from every team.
__________________

anakin_cstrike is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-01-2009 , 13:47   Re: how to get team leaders CT and T
Reply With Quote #6

This will count the players' kills, so even if you restart the round they will have the same kills saved(this will save the player's kills until he disconnects, so when he reconnects he'll have 0 kills).

Note: This is not a plugin, but an example. Using it won't do anything.
PHP Code:
#include <amxmodx>

new g_iKills33 ], g_iMaxPlayers;

get_best_killerteam )
{
    new 
best 0;
    for( new 
<= g_iMaxPlayers i++ ) // g_iMaxPlayers = get_maxplayers() in plugin_init
    
{
        if( !
is_user_connected) )
            continue;
        
        if( 
get_user_team) != team )
            continue;
        
        if( 
g_iKills] > g_iKillsbest ] )
        {
            
best i;
        }
    }
    
    
// best is now the best killer's id.
    
return best;
}


public 
server_changelevelmap[] )
{
    for( new 
<= g_iMaxPlayers i++ )
    {
        
g_iKills] = 0;
    }
}

public 
client_disconnectid )
{
    
g_iKillsid ] = 0;
}

public 
plugin_init()
{
    
register_event"DeathMsg""ev_Death""a" );
    
g_iMaxPlayers get_maxplayers();
}

public 
ev_Death()
{
    
g_iKillsread_data) ]++;

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-01-2009 , 17:51   Re: how to get team leaders CT and T
Reply With Quote #7

Code:
#include <fakemeta> // check_type determines which way to find best player // check_type = 0 -- most frags // check_type = 1 -- best difference in frags to deaths (frags - deaths) // check_type = 2 -- best ratio of frags per deaths (frags / deaths) get_team_leader(team, check_type) {     new bestClient = 0;     new Float:bestFrags = -9999.9;         static Float:frags, deaths;         // g_max_clients = get_maxplayers();     for( new client = 1; client <= g_max_clients; client++ )     {         if( !is_user_connected(client) || get_pdata_int(client, 114) != team) continue;                 pev(client, pev_frags, frags);                 switch( check_type )         {             //case 0: frags = frags;             case 1: frags -= get_pdata_int(client, 444);             case 2:             {                 deaths = get_pdata_int(client, 444);                 frags /= (deaths ? deaths : 1);             }         }                 if( frags > bestFrags )         {             bestFrags = frags;             bestClient = client;         }     }         return bestClient; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply


Thread Tools
Display Modes

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:09.


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