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

How to use SortCustom2D correctly?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Steveh
Member
Join Date: Oct 2010
Old 12-21-2010 , 13:27   How to use SortCustom2D correctly?
Reply With Quote #1

Hello,
PHP Code:
SortCustom2D(clientScoreMaxClientsSortScoreDesc); 
Whenever I try to compile my plugin, it always says the arrays are not the same.
I thought it may have been something to do with how I declare the it, but I don't think It will be that.

Thanks,
Steveh
Steveh is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 12-21-2010 , 22:11   Re: How to use SortCustom2D correctly?
Reply With Quote #2

How are you defining clientScore?
bl4nk is offline
Steveh
Member
Join Date: Oct 2010
Old 12-22-2010 , 03:29   Re: How to use SortCustom2D correctly?
Reply With Quote #3

Hi bl4nk, I am defining it by doing this:

PHP Code:
new clientScore[MAXPLAYERS+1]; 
Thanks,

Steveh
Steveh is offline
AltPluzF4
Senior Member
Join Date: Aug 2007
Old 12-22-2010 , 06:47   Re: How to use SortCustom2D correctly?
Reply With Quote #4

That's a one dimensional array. Use SortCustom1D.
A two dimensional array would be like:
PHP Code:
new Float:clientOrigins[MAXPLAYERS+1][3]; 
__________________
AltPluzF4 is offline
Steveh
Member
Join Date: Oct 2010
Old 12-22-2010 , 08:18   Re: How to use SortCustom2D correctly?
Reply With Quote #5

Ah right I see. So would I use SortCustom1D like this?
PHP Code:
SortCustom1D(clientScoreMAXPLAYERSSortScoreDesc); 
or would I use it like this?
PHP Code:
SortCustom1D(clientScoreMaxClientsSortScoreDesc); 
I tried the second way, but when I attempted to compile, it said the arrays do not match.

Thanks,
Steveh
Steveh 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 08:18.


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