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

New File Vault - A newer file vault system!


Post New Thread Reply   
 
Thread Tools Display Modes
01101101
BANNED
Join Date: Nov 2009
Location: 9`su 09`n0n7e`r0f76a
Old 12-08-2009 , 03:58   Re: New File Vault - A newer file vault system!
Reply With Quote #21

Quote:
Originally Posted by Bugsy View Post
I agree and second this idea\request. A module that does SQL transactions with the ease of nvault-esque commands. I may start trying to put something together for this.
But that way it would suck as much as nvault, you don't have the power of the SQL syntax. BTW, SQL is really simple, you just have to know how to use "INSERT INTO", "UPDATE" and "SELECT" and you are done, think it like learning 3 functions.
01101101 is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 12-08-2009 , 04:04   Re: New File Vault - A newer file vault system!
Reply With Quote #22

Quote:
Originally Posted by 01101101 View Post
But that way it would suck as much as nvault, you don't have the power of the SQL syntax. BTW, SQL is really simple, you just have to know how to use "INSERT INTO", "UPDATE" and "SELECT" and you are done, think it like learning 3 functions.
I agree, SQL is a very easy language to learn. I actually prefer REPLACE INTO to update or insert a line.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-08-2009 , 21:48   Re: New File Vault - A newer file vault system!
Reply With Quote #23

Quote:
Originally Posted by 01101101 View Post
But that way it would suck as much as nvault, you don't have the power of the SQL syntax. BTW, SQL is really simple, you just have to know how to use "INSERT INTO", "UPDATE" and "SELECT" and you are done, think it like learning 3 functions.
You're right, I realized SQL isn't so hard after doing more searching\reading about it. I did end up making a module to simplify basic SQL transactions that is as easy to use as nvault with the exception you need a handler function to handle retrieved data. It can be useful for someone who wants to use SQL and only needs to manipulate data on a key\data format.
__________________
Bugsy is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 02-15-2010 , 13:16   Re: New File Vault - A newer file vault system!
Reply With Quote #24

i use exolent's fvault and it seem to be easier in some cases for me, than this one.
Anyways GJ with this emp!
Lure.d is offline
Send a message via Skype™ to Lure.d
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 02-15-2010 , 16:48   Re: New File Vault - A newer file vault system!
Reply With Quote #25

Quote:
Originally Posted by Lure.d View Post
i use exolent's fvault and it seem to be easier in some cases for me, than this one.
Anyways GJ with this emp!
For it's better to use this, i can save multiple datas without parsing
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Old 04-03-2011, 10:44
D12Eminem989
This message has been deleted by D12Eminem989.
Nomaf
Junior Member
Join Date: Jun 2011
Old 08-27-2011 , 11:39   Re: New File Vault - A newer file vault system!
Reply With Quote #26

Can someone help me? I need a stock to find key by the phrase. I wrote something like that:
PHP Code:
stock nfv_get_key(const filename[], const identifier=';'phrase[], output[], len)
{
    if( !
file_exists(filename) )
        return 
0;
        
    new 
fopen(filename"rt");
    new 
_data[512];
    
    while( !
feof(f) )
    {
        
fgets(f_datacharsmax(_data));
        
        if( 
_data[0] == identifier && equalphrase_data ) )
        {
            
formatoutputlen"%s"_data);
            break;
        }
    }
    
    
fclose(f)
    return 
0;

But don't work.
Nomaf is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-24-2012 , 15:12   Re: New File Vault - A newer file vault system!
Reply With Quote #27

How to retrieve number of keys in a file?
EDIT:
I wrote a quick stock to count the number of keys
will this work?
Code:
stock nfv_get_keys_num(szFile[], const identifier=';') {     new f = fopen(szFile, "r")     if(  !f  )         return 0             new iNum, line[3], i     while(!feof(f))     {         fgets(f, line, charsmax(line))                 if(line[0] == identifier)             ++i     }         fclose(f)     return i }

EDIT2:
After secound thought, it turned to be useless as I can't loop through all entries :\
Too bad ...
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 11-24-2012 at 16:15.
pokemonmaster is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-24-2012 , 17:04   Re: New File Vault - A newer file vault system!
Reply With Quote #28

Here is an example of how I iterate through entries in PokeMod 2.0 for the items:

Code:
FileReadItems()
{
	pokemod_funcstart_debug( "FileReadItems" );

	SetupArray( g_iItemNames, NAME_LEN );
	SetupArray( g_iItemTells, 1 );
	SetupArray( g_iItemProps, 1 );
	SetupTrie( g_iItemTrie );

	new String:szData[128], Int:iTell, Int:iProp, ITEM_PROP:iPropNum;
	new Int:iFileHandle = fopen( FileName( FILE_ITEMS ), "rt" );
	while ( !feof( iFileHandle ) )
	{
		iTell = ftell( iFileHandle );
		fgets( iFileHandle, szData, charsmax(szData) );
		trim( szData );

		if ( szData[ 0 ] == ';' || ( szData[ 0 ] == '/' && szData[ 1 ] == '/' ) )
			continue;

		if ( szData[ 0 ] == '#' )
		{
			TrieSetCell( g_iItemTrie, szData[1], ArraySize( g_iItemNames ) );
			ArrayPushString( g_iItemNames, szData[1] );
			ArrayPushCell( g_iItemTells, iTell );
			ArrayPushCell( g_iItemProps, 0 );
		}
		else if ( equali( szData, "Prop ", 5 ) )
		{
			//Remove Prop
			copy( szData, charsmax(szData), szData[ 5 ] );

			iProp = 0;
			new String:szLeft[ 64 ];
			while ( ValidData( szData ) )
			{
				strbreak( szData, szLeft, charsmax(szLeft), szData, charsmax(szData) );
				for ( iPropNum = ITEM_DEFAULT; iPropNum < ITEM_PROP; iPropNum++ )
				{
					if ( equali( szLeft, szItemProp[ iPropNum ] ) )
					{
						iProp |= ( 1 << _:iPropNum );
						break;
					}
				}
				if ( iPropNum == ITEM_PROP )
				{
					pokemod_debug( "FileReadItems Unknown Item Prop: '%s'", szLeft );
				}
			}
			ArraySetCell( g_iItemProps, ArraySize( g_iItemProps ) - 1, iProp );
		}
	}
	fclose( iFileHandle );

	pokemod_funcend_debug( "FileReadItems %d", ArraySize( g_iItemNames ) );
}
Not sure if that helps you, but I thought you might be interested.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Old 12-23-2013, 16:55
pacheco
This message has been deleted by pacheco. Reason: thread opened
HENNESSY
Member
Join Date: Sep 2013
Location: Russian Federation, Bela
Old 02-07-2014 , 18:25   Re: New File Vault - A newer file vault system!
Reply With Quote #29

i checked NFVault, and i tried hundred times and it has a critical bug.

when you save key all other keys are being removed or become the same as the specified key.

i really liked the way NFVault works but the bug destroys everything.

I hope it would be fixed
HENNESSY is offline
yan1255
Senior Member
Join Date: Jul 2011
Old 09-04-2015 , 14:45   Re: New File Vault - A newer file vault system!
Reply With Quote #30

Quote:
Originally Posted by Emp` View Post
Code:
    nfv_set_data( filename, "key", "name2", "data2" );     nfv_set_data( filename, "key", "name2", "data_2" );
Code:
"name2" "data_2"
What is the point of setting a different data to the same name ? by the outcome you exampled it didn't made any change that what got me confused if you could please clear things up like if it was a mistake or on purpose.
__________________

Last edited by yan1255; 09-04-2015 at 14:47.
yan1255 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:59.


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