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

get the best player


Post New Thread Reply   
 
Thread Tools Display Modes
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 04-03-2008 , 16:45   Re: get the best player
Reply With Quote #11

Code:
new idBestPlayer = get_best_player(NON_ZERO_VALUE);
This returns the best player found by dividing kills by deaths as opposed to finding the difference.
Lee is offline
ch3cker
Veteran Member
Join Date: Jun 2005
Location: Deutschland / Baden-Würt
Old 04-04-2008 , 11:42   Re: get the best player
Reply With Quote #12

so i have this code unde the code that will get the best player:

Code:
public stopperson()
{	
	remove_task(454500)
	new nextmap[32]
	get_cvar_string("amx_nextmap",nextmap,31)
	
	new idBestPlayer = get_best_player();
	new name[32]
	get_user_name(idBestPlayer, name, 32);
	if (read_data(1) == floatround(get_cvar_float("mp_roundtime") * 60.0))
	{
		set_hudmessage(255, 255, 0, 0.14, 0.04, 1, 6.0, 6.0, 1.0, 1.0, -1)
		show_hudmessage(0,"Mapwechsel zu^n%s",nextmap)
		set_hudmessage(255, 255, 0, 0.50, 0.04, 1, 6.0, 6.0, 1.0, 1.0, -1)
		show_hudmessage(0,"Best Player:^n%s", name)
...
Now i get this errors:
Code:
error 036: empty statemant
error 017: undefined symbol "i"
the empty statement is this:
Code:
for(new i = 0; i < iNum; i++);
the undefined symbol:
Code:
id = players[i];
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-04-2008 , 12:12   Re: get the best player
Reply With Quote #13

remove the semicolon after the for()
__________________
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-04-2008 , 14:27   Re: get the best player
Reply With Quote #14

yes
it works know
thx all
__________________
SORRY 4 MY BAD ENGLISH
ch3cker is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 04-05-2008 , 10:53   Re: get the best player
Reply With Quote #15

You can only store 31 characters in an array of 32 cells. The last element is reserved for a zero terminator. Otherwise you risk writing into other areas of memory.
Lee is offline
Havoc
Member
Join Date: Jul 2004
Old 04-05-2008 , 15:46   Re: get the best player
Reply With Quote #16

ch3cker can you please post full code of this plugin?
THANKS! Its great idea .
__________________
Havoc is offline
Send a message via ICQ to Havoc Send a message via MSN to Havoc
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 11:16.


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