Raised This Month: $ Target: $400
 0% 

Getting Top5 Players of Map


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-25-2013 , 12:59   Re: Getting Top5 Players of Map
Reply With Quote #4

That's one way. I would format the message inside the loop instead of using those variables. But you may need them somewhere else of course. Then they really should be an array instead of 5 separate variables.

If we're going to use the code you provided there's no point of looping it since we know what indexes we want.
Code:
for ( new i = 0 ; i < clamp(iPlayersnum, 0, 5) ; i++ ) {     switch(i)     {     case 0: g_iFirstPlace = iPlayers[i]     case 1: g_iSecondPlace = iPlayers[i]     case 2: g_iThirdPlace = iPlayers[i]     case 3: g_iFourthPlace = iPlayers[i]     case 4: g_iFifthPlace = iPlayers[i]     } }
-->
Code:
g_iFirstPlace = iPlayers[0] g_iSecondPlace = iPlayers[1] g_iThirdPlace = iPlayers[2] g_iFourthPlace = iPlayers[3] g_iFifthPlace = iPlayers[4]
__________________

Last edited by Black Rose; 08-25-2013 at 12:59.
Black Rose is offline
 



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


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