Raised This Month: $ Target: $400
 0% 

find player with most kills of a team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 05-08-2006 , 16:30   find player with most kills of a team
Reply With Quote #1

eumh i need to know how you can find the player with the most kills of a team

thx in advance
__________________
- Bye bye!
nightscreem is offline
o0panda
Member
Join Date: Sep 2005
Old 05-08-2006 , 16:59  
Reply With Quote #2

Tab button
o0panda is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 05-08-2006 , 17:01  
Reply With Quote #3

omg pls post something usefull
__________________
- Bye bye!
nightscreem is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-08-2006 , 17:10  
Reply With Quote #4

Something like this. Correct me if I'm wrong.
Code:
public most_kills_by_team(CsTeams:team) {   new last_frags , last_id , frags;   new CsTeams:p_team;   new const max_players = get_maxplayers();   for(new id = 1; id <= max_players; id++)   {     if(!is_user_connected(id)) continue;     p_team = cs_get_user_team(id);     if(p_team == team)     {       frags = get_user_frags(id);       if(frags > last_frags)       {         last_frags = frags;         last_id = id;       }     }   }   return last_id; }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 05-08-2006 , 17:12  
Reply With Quote #5

i think you want it for cs:
Code:
getMostKills( CsTeams:team ) {         new maxPlayers = get_maxplayers();         new mostkills[2] = { 0, 0 }; // 0 = id, 1 = frags         for( new i = 1; i <= maxPlayers; i++ )         {                 if( !is_user_connected( i ) || cs_get_user_team( i ) != team )                         continue;                 new frags = get_user_frags( i );                 if( frags > mostkills[1] )                 {                         mostkills[1] = frags;                         mostkills[0] = i;                 }                         }         return mostkills[0];       }
I didn't tried it, so use it at you own risk

edit:
v3x why are you always so fast?
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-08-2006 , 17:13  
Reply With Quote #6

Pretty much what I did.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 05-08-2006 , 17:15  
Reply With Quote #7

Quote:
Originally Posted by v3x
Pretty much what I did.
i wrote this b4 i saw your post...
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 05-08-2006 , 17:23  
Reply With Quote #8

thx for the posts but i need the player with the most frags from the T & the one from the CT
__________________
- Bye bye!
nightscreem is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-08-2006 , 17:39  
Reply With Quote #9

You can do that. Just use it twice like so:
Code:
new top_terror = most_kills_by_team(CS_TEAM_T); new top_ct = most_kills_by_team(CS_TEAM_CT);
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 05-08-2006 , 17:51  
Reply With Quote #10

My way of doing it. I don't like get_maxplayers() and is_user_connected()
Code:
stock most_kills_by_team(CsTeams:Team) {     new Players[32] , pnum , Winner[2], temp[2];     get_players(Players , pnum , "ce" , (Team == CS_TEAM_CT) ? "CT" : "TERRORIST");     for( new i = 0 ; i < pnum ; i++)     {         temp[0] = Players[i];         temp[1] = get_user_frags(temp[0]);         if(temp[1] > Winner[1])         {             Winner[0] = temp[0];             Winner[1] = temp[1];         }     }     return Winner[0]; }
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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 04:59.


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