Raised This Month: $ Target: $400
 0% 

[SOLVED] [fvault] Error in save..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pacheco
Senior Member
Join Date: Jul 2011
Old 07-12-2012 , 18:53   [SOLVED] [fvault] Error in save..
Reply With Quote #1

I have this code in one plugin

PHP Code:
new szData[20]; 
formatex(szDatacharsmax(szData), "%s %i"g_szTempPassWord[id], g_AP[id])
fvault_set_data("zs_bank_register"g_szTempName[id], szData
When fvault is saved, why is saved like:
Code:
"mylogin" "mypw 0" 1342133388
I want to save like:
Code:
"mylogin" "mypw" "myammopacks" 1342133388
Thanks!
__________________




Last edited by pacheco; 07-12-2012 at 19:59.
pacheco is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-12-2012 , 18:56   Re: [fvault] Error in save..
Reply With Quote #2

Because thats how you're saving it...formatex(szData, charsmax(szData), "%s %i", g_szTempPassWord[id], g_AP[id])

I don't use fvault so I'm not sure if there is a way to save multiple data items per save. But you can get it to save that way with this, you just need to read it correctly when needed...or leave it as-is and just parse the data.
PHP Code:
formatex(szDatacharsmax(szData), "%s^" ^"%i"g_szTempPassWord[id], g_AP[id]) 
__________________

Last edited by Bugsy; 07-12-2012 at 18:58.
Bugsy is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 07-12-2012 , 19:06   Re: [fvault] Error in save..
Reply With Quote #3

Ok Bugsy, thanks!
Now it's saving correctly.

Code:
"lol" "lol" "100" 1342134070
__________________



pacheco is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-12-2012 , 19:18   Re: [fvault] Error in save..
Reply With Quote #4

Yes, but next you're going to ask how to read the data.
__________________
Bugsy is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 07-12-2012 , 19:24   Re: [fvault] Error in save..
Reply With Quote #5

Quote:
Yes, but next you're going to ask how to read the data.
Yes, that's it..

Now, when i'm going to login, my password is wrong..

see the code:

PHP Code:
new data[140]
fvault_get_data"zs_bank_register"g_szTempName[id], data139)

if(
equal(g_szTempPassWord[id], data))
{
    
g_logged[id] = true;

I know it's wrong.. how to fix it?
__________________




Last edited by pacheco; 07-12-2012 at 19:25.
pacheco is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-12-2012 , 19:37   Re: [fvault] Error in save..
Reply With Quote #6

Don't use what I posted above for saving, use your original code.
PHP Code:
//Save data
new szData[20]; 
formatex(szDatacharsmax(szData), "%s %i"g_szTempPassWord[id], g_AP[id])
fvault_set_data("zs_bank_register"g_szTempName[id], szData)  

//Load data
new data[140] , szPassword128 ] , szVal10 ] , iVal;
fvault_get_data"zs_bank_register"g_szTempName[id], data139)
parsedata szPassword charsmaxszPassword ) , szVal charsmaxszVal ) );
 
if( 
equalg_szTempPassWord[id] , szPassword) )
{
    
iVal str_to_numszVal );
    
g_logged[id] = true;

__________________

Last edited by Bugsy; 07-12-2012 at 19:37.
Bugsy is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 07-12-2012 , 19:49   Re: [fvault] Error in save..
Reply With Quote #7

Ok, thanks Bugsy, the password is now ok!
But and the g_AP? How to load it?
I don't understand this: iVal = str_to_num( szVal );

It's to load the g_AP[id]?

---- EDIT:
Really thanks bugsy, works correctly! Thanks so much!!!
g_AP[id] = str_to_num( szVal );

;)
__________________




Last edited by pacheco; 07-12-2012 at 19:58.
pacheco 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 15:18.


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