[Include] Sort multi-dimensional arrays (enums supported)
#81

What do you mean? Sounds like you want to filter data, not sort it.

Either way, 2d arrays with enums are sortable in any way you want. You can create custom logic for sorting. See the examples on the main post.
Reply
#82

Quote:
Originally Posted by Slice
Посмотреть сообщение
What do you mean? Sounds like you want to filter data, not sort it.

Either way, 2d arrays with enums are sortable in any way you want. You can create custom logic for sorting. See the examples on the main post.
I drew a quick diagram in paint to explain myself a bit better, diagram 2 is what my array looks like when i sort it now, and i want my array to look like diagram 1.

http://postimg.org/image/clnzj7rcf/
Reply
#83

Yeah, just use the custom comparator function.

http://forum.sa-mp.com/showpost.php?...3&postcount=29
Reply
#84

How to sort a simple array... SCORE[MAX_PLAYERS]
Reply
#85

Quote:
Originally Posted by JR_Junior
Посмотреть сообщение
How to sort a simple array... SCORE[MAX_PLAYERS]
?
Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)