Raised This Month: $51 Target: $400
 12% 

get the best player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 04-02-2008 , 14:48   get the best player
Reply With Quote #1

how is it possible to get the best player on the Server (Counter-Strike)
i want to show it on the end of a map.
i looked in other scripts, but i am not so good so see how it works.
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-02-2008 , 15:08   Re: get the best player
Reply With Quote #2

what you mean by "Best Players" ?...those who have a good KD ratio?
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 04-02-2008 , 15:10   Re: get the best player
Reply With Quote #3

yes
the best player with the best KD ratio
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 04-02-2008 , 15:10   Re: get the best player
Reply With Quote #4

Well the best player is I think Frags - Deaths = X
And a player with the highest number X is the best
__________________
I am out of order!
grimvh2 is offline
Old 04-02-2008, 15:50
Exolent[jNr]
This message has been deleted by Exolent[jNr].
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-02-2008 , 15:53   Re: get the best player
Reply With Quote #5

Isn't the KD ration = (Kills / Deaths) ... :/
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-02-2008 , 15:54   Re: get the best player
Reply With Quote #6

thats not fair cause i can maintain a 100-25 k-d but someone with a 10-0 would beat me
thats why this is the best way to determine
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 04-02-2008 , 17:57   Re: get the best player
Reply With Quote #7

You only needed one loop. ;)

Code:
stock get_best_player(ratiotype = 0) {     new players[32], iNum;     get_players(players, iNum);         if(!iNum)     {         return 0;     }         new id, iBestPlayer, iBestRatio, iCurrentRatio;         if(!ratiotype)     {         for(new i = 0; i < iNum; i++);         {             id = players[i];                         iCurrentRatio = get_user_frags(id) - get_user_deaths(id);                         if(iCurrentRatio > iBestRatio)             {                 iBestPlayer = id;                 iBestRatio = iCurrentRatio;             }         }     }     else     {         for(new i = 0; i < iNum; i++);         {             id = players[i];                         iCurrentRatio = get_user_frags(id) / get_user_deaths(id);                         if(iCurrentRatio > iBestRatio)             {                 iBestPlayer = id;                 iBestRatio = iCurrentRatio;             }         }     }         return iBestPlayer; }

Last edited by Lee; 04-02-2008 at 18:04.
Lee is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-02-2008 , 18:17   Re: get the best player
Reply With Quote #8

Quote:
Originally Posted by Lee View Post
You only needed one loop. ;)
i see now
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 04-03-2008 , 14:46   Re: get the best player
Reply With Quote #9

thx
how is it possible to get the id of the best player on a new funtion ?
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-03-2008 , 15:10   Re: get the best player
Reply With Quote #10

Code:
new idBestPlayer = get_best_player();
idBestPlayer is the index of best player...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Reply



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 00:43.


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