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

clearing vault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-07-2012 , 17:32   clearing vault
Reply With Quote #1

How can i clear a vault on a efficient way?
nvault_prune, nvault_pset or both?

(is nvault_pset correct in this code block?)
PHP Code:
public clear_vault()
{
 if(
g_iVault) {
  
nvault_prune(g_iVault0get_systime())
  
nvault_pset g_iVault"0""0" 
  
client_printcolor(0"/gVault succesfully reset")
 }
 else
  
client_print(0print_chat"Failed to find the vault")

__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-07-2012 , 18:37   Re: clearing vault
Reply With Quote #2

nvault_prune( vault , 0 , get_systime() )

This will not remove entries written with pset, for that you can use nvault_util include to read entries and delete them manually.
__________________

Last edited by Bugsy; 07-07-2012 at 18:54.
Bugsy is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-07-2012 , 19:37   Re: clearing vault
Reply With Quote #3

how do i do that?
can you show me how you code to clear the vault from all data
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-07-2012 , 21:03   Re: clearing vault
Reply With Quote #4

Just delete the file located in ur data folder.
Santaaa is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-07-2012 , 23:22   Re: clearing vault
Reply With Quote #5

Quote:
Originally Posted by Santaaa View Post
Just delete the file located in ur data folder.
THAT'S THE SPIRIT!
Do it the admin way.
or you can use delete_file ;)
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 07-07-2012 , 23:28   Re: clearing vault
Reply With Quote #6

Quote:
Originally Posted by Santaaa View Post
Just delete the file located in ur data folder.
What if he wants it to automatically reset after a period of time.
__________________
Hi.
Kreation is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-08-2012 , 06:36   Re: clearing vault
Reply With Quote #7

Yes, and also from my expierence deleting the vault doesnt nescsearely clear it.
I've done it before and also deleted the journal file and the plugin vault was bugged then idk why but it wasnt working anymore.

So like kreation said I need to know how to code it for like when i want to do it manually from ingame (wich is so much faster) or when i decide to add a function that clears all data in the vault after a period of time.

so can anyone tell me the best way to clear a vault effecient (through coding).

grtz
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-08-2012 , 10:23   Re: clearing vault
Reply With Quote #8

don't use pset. just use nvault_set if you want to be able to clear all entries. pset is for more like identifiers, or notes or things that you don't want to get rid of. Hence p(ermanent)set

In answer to your original question. If your data is saved using nvault_set just use nvault_prune(g_iVault, 0, get_systime())
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 07-08-2012 at 10:27.
Liverwiz is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-08-2012 , 11:10   Re: clearing vault
Reply With Quote #9

Quote:
Originally Posted by Bugsy View Post
nvault_prune( vault , 0 , get_systime() )

This will not remove entries written with pset, for that you can use nvault_util include to read entries and delete them manually.
Delete everything in vault, including pset entries, with nvault_utility
PHP Code:
ClearVaultiVault , const szVault[] )
{
    
nvault_pruneiVault get_systime() );
    
    new 
iUtilVault;
    
    if ( ( 
iUtilVault nvault_util_openszVault ) ) )
    {
        new 
iCount iPos szKey256 ] , szVal] , iTS;
        
        if ( ( 
iCount nvault_util_countiUtilVault ) ) )
        {
            for ( new 
iCount i++ )
            {
                
iPos nvault_util_readiUtilVault iPos szKey charsmaxszKey ) , szVal charsmaxszVal ) , iTS );
                
nvault_removeiVault szKey );
            }
        }
        
nvault_util_closeiUtilVault );
    }

__________________

Last edited by Bugsy; 07-08-2012 at 11:15.
Bugsy is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-08-2012 , 13:56   Re: clearing vault
Reply With Quote #10

Quote:
Originally Posted by Liverwiz View Post
don't use pset. just use nvault_set if you want to be able to clear all entries. pset is for more like identifiers, or notes or things that you don't want to get rid of. Hence p(ermanent)set

In answer to your original question. If your data is saved using nvault_set just use nvault_prune(g_iVault, 0, get_systime())
thanks but that doesnt clear the vault when the server does that, nothing happends.

I'm gonna try the code you gave bugsy, I hope it will work becous I cant delete my vault anymoer :s i deleted it 3times but it always seems to come back automaticly with all the data intact, very strange
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 07-08-2012 at 13:56.
striker07 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 10:36.


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