Raised This Month: $32 Target: $400
 8% 

[Help] Sorting rank & show top15 (nvault).


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 05-01-2014 , 03:33   [Help] Sorting rank & show top15 (nvault).
Reply With Quote #1

Yo,

Here is my sample plugin of xp mod, but i want to add top15 and show on MOTD? any idea how to make it? Sorry i have zero knowledge on using "SortCustom2D" native.

sample plugin


All i want is something like this:
Rank PlayerName XP
1. goku 32767
2. bulma 5000
3. majinbuu 4545
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-01-2014 , 05:13   Re: [Help] Sorting rank & show top15 (nvault).
Reply With Quote #2

Look at statx plugin ?
__________________
Arkshine is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-01-2014 , 06:27   Re: [Help] Sorting rank & show top15 (nvault).
Reply With Quote #3

You should use either fVault and sort the data using ArraySort which is more optimal, or the best of all use SQL or SQLite for its ability to sort your data right in the selection query.

You can look up how to use ArraySort on google, it's really simple.


Edit: Just noticed you have more data fields so FVault won't be able to convert it to an array anyway. You'd have to loop through every single string in the nvault, parse it, convert it to an array and then insert it into a dynamic array, once that's done you can finally use ArraySort.

Believe me, forget vaults and use SQL.
__________________
Currently busy working on a very large scale anime database project.

Last edited by Backstabnoob; 05-01-2014 at 06:36.
Backstabnoob is offline
Reply


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 10:43.


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