I have a array with users sorted by score.
I only want to output a specific users score (in the middle of the outputted list), and users before and after to make the list max length 10.
Like this
1. A
2. B
3. C
--------- OUTPUT START
4. D
5. E
6. F
7. G
8. H (ME)
9. I
10. J
11. K
12. L
13. M
--------- OUTPUT END
14. N
15. O
16. P
Any ideas on how to do this?
Thanks in advance
Try that:
It takes the id of your name in the array and slices the array from your rank-4 with size of 10. If your rank is less than 4, it takes 0 instead (it’s the
maxpart).