Raised This Month: $ Target: $400
 0% 

sorting floats+id


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-25-2018 , 14:44   sorting floats+id
Reply With Quote #1

hello..i have a little trouble to connect id to sorted float value...here is the example:

Code:
p_marker[ id ] = float( g_pBestTouch[ id ] )
p_marker[ 5 ] = 105.3 
p_marker[ 8 ] = 152.2

SortFloats( p_marker, sizeof( p_marker ),  Sort_Descending )//this is working
it stamps:
1. 5005.0
2. 152.2
3.105.3

which is correct by the SortFloat, but how can i implement names to their desired float value?
i went with:
Code:
SortFloats( p_marker, sizeof( p_marker ), Sort_Descending )
for( new i = 0; i < sizeof( p_marker ); i++ )
{
	get_user_name( i, name, charsmax( name ) )
	client_print( 0, print_console, "%d %.01f %s", i, p_marker[ i ], name )
}
but names arent connected with printed floats in console...maybe its needed sort2d, but how with floats :/
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
 


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 07:29.


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