Raised This Month: $ Target: $400
 0% 

nVault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bwgrubbs1
Senior Member
Join Date: Sep 2006
Old 07-16-2007 , 12:06   Re: nVault
Reply With Quote #1

Could you possibly show me this in action, because i have tried a lot of different combinations here, specifically in this area of the code.

Code:
public topten_update(id) {     new szvault[64], szmap[32], kreedztime     get_mapname(szmap,32)     format(szvault,64,"bhop_%s",szmap)     new time = getusertime(id)     new vault = nvault_open(szvault) // Now we have to sort the new list :o     if(vault != -1) {         new szkey[8]         for(new i=1;i<=10;i++) {             new szreturn[128]             new arg1[32], arg2[8]             format(szkey,8,"%d",i)             nvault_get(vault,szkey,szreturn,128)             if(parse(szreturn,arg1,32,arg2,8) == 0 || getusertime(id) < str_to_num(arg2))             {                 if(getusertime(id) < str_to_num(arg2)) // if their new time is better than time in vault                     nvault_remove(vault, szreturn) // trying to remove old data                 else { //Where do i incorporate nvault_lookup ???                     new sznew[128], szname[32]                     get_user_name(id,szname,32)                     format(sznew,128,"^"%s^" ^"%d^" ^"%d^" ^"%d^" ^"%d^"",szname,time,timer[id-1][TMR_CPSCNT],timer[id-1][TMR_GCSCNT],timer[id-1][TMR_BOOSTS])                     if(i < 10) {                         for(new x=10;x>i;x--) {                             new sztemp[128], sztempkey[8]                             format(sztempkey,8,"%d",x-1)                             nvault_get(vault,sztempkey,sztemp,128)                                                     if(!equal(sztemp,"")) {                                 format(sztempkey,8,"%d",x)                                 nvault_pset(vault,sztempkey,sztemp)                             }                         }                     }                     nvault_pset(vault,szkey,sznew)                                     if(i == 1)                         client_print(0,print_chat,"[KZ] Congratulations, %s has a new record !",szname)                                         break                 }             }         }         nvault_close(vault)     } }
bwgrubbs1 is offline
Pinatz
Member
Join Date: Dec 2008
Old 05-30-2009 , 06:53   Re: nVault
Reply With Quote #2

May somebody create a tutorial about Nvault and sorting in Nvault?
__________________
Pinatz is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 05-30-2009 , 07:05   Re: nVault
Reply With Quote #3

http://forums.alliedmods.net/showthread.php?t=91503
__________________
alan_el_more is offline
Pinatz
Member
Join Date: Dec 2008
Old 05-30-2009 , 18:59   Re: nVault
Reply With Quote #4

Thanks for the link but there is nothing about how to sort a nvault-based list.
And I donīt know how to get the rank of a specific entry within the list.
__________________
Pinatz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-30-2009 , 22:23   Re: nVault
Reply With Quote #5

Quote:
Originally Posted by Pinatz View Post
rank of a specific entry
Apparently this is too vague because there is no "rank" of data in the "list".
__________________
fysiks is offline
Pinatz
Member
Join Date: Dec 2008
Old 05-31-2009 , 11:57   Re: nVault
Reply With Quote #6

So it is no list because its based on timestamps?
Hmm. Then it may be easier to implement the xp system in sql and let it "SORT BY points" :>
__________________
Pinatz 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 21:31.


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