Raised This Month: $ Target: $400
 0% 

Solved fvault lost data problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
The overrated maniac
Member
Join Date: Jun 2021
Location: Argentina
Old 07-20-2021 , 08:48   fvault lost data problem
Reply With Quote #1

Example: I have 50 lives and my password is "red". Player B has 15 lives and his password is "green".
I don't know why, but sometimes when player B enters the server he will have 50 lives and his password will be "red". But the SETINFO_PASSWORD is "green" and therefore he can't login in his account. In the FVAULT the information changed so he lost all his data.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fvault>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new SZ_Password192 ]
new 
SZ_Password_T33 ][ 192 ]

new 
Registered33 ]
new 
BadPassword33 ]

new 
g_lifes[33]

new const 
Vault[] = "_datos"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /account""CMDRegister");
    
register_clcmd"EnterPassword""CMDIntroducirContrasenia" )
}

public 
client_putinserverid ){
 
Registered[id] = 0
BadPassword
[id] = 0
set_task
(2.0"Load"id)
}

public 
client_disconnectid ) {
        
    
Save(id);
}

public 
CMDRegister(id){
       
    if( 
Registeredid] == || BadPassword[id] == 1){
        return 
PLUGIN_HANDLED;
    }
    else{
        
client_cmdid"messagemode EnterPassword" )
    }
    return 
PLUGIN_CONTINUE;
}


public 
CMDIntroducirContraseniaid ){
    
    
read_argsSZ_Password191 )
    
remove_quotesSZ_Password )
    
trimSZ_Password )
    
    if( 
equalSZ_Password"" ) || containSZ_Password" ") != -1){
        return 
PLUGIN_HANDLED;
    }
    
    else { 
    
        
client_cmdid"setinfo _password ^"%s^""SZ_Password )
        
Registeredid ] = 1
        
static SZ_Name32 ], SZ_Data512 ]
        
get_user_nameidSZ_Name31 )
        
formatexSZ_DatacharsmaxSZ_Data ), "%s %d"SZ_Passwordg_lifes[id])
        
fvault_set_dataVaultSZ_NameSZ_Data )
        
SZ_Password_Tid ] = SZ_Password

        
return PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;
}

public 
Saveid ){
    
    if(
Registeredid ] == || BadPasswordid ] == 1){
        return 
PLUGIN_HANDLED;
    }

    else{
        static 
SZ_Data512 ], SZ_Name32 ]
    
        
formatexSZ_DatacharsmaxSZ_Data ), "%s %d"SZ_Password_Tid ], g_lifes[id])
        
get_user_nameidSZ_Name31 )
    
        
fvault_set_dataVaultSZ_NameSZ_Data )
    }
    return 
PLUGIN_CONTINUE;
}

public 
Loadid ){
    
    static 
SZ_Data512 ], SZ_Name32 ], SETINFO_Password191 ], VAULT_Password191 ], lifes[32]
    
    
get_user_nameidSZ_Name31 )
    
get_user_infoid"_password"SETINFO_Password190 )
    
    if( !
fvault_get_dataVaultSZ_NameSZ_DatacharsmaxSZ_Data ) ) ){
        return 
0;
    }
    
    
Registered[id] = 1
    parse
SZ_DataVAULT_Password190lifes31)
    
    if( 
equalSETINFO_PasswordVAULT_Password ) ){
        
        
SZ_Password_T[id] = SETINFO_Password
    
        g_lifes
[id] = str_to_num(lifes)
    
        return 
2;
    }
    else{ 
        
BadPasswordid ] = 1
    
}
    return 
1;


Last edited by The overrated maniac; 07-24-2021 at 18:59. Reason: Solved
The overrated maniac is offline
 



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 02:38.


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