Raised This Month: $ Target: $400
 0% 

Save and Load Problems (nVault)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 11-25-2010 , 10:15   Save and Load Problems (nVault)
Reply With Quote #1

Alright, so here's the basic problem:

When there's no vault file, I can change the map, and it will work perfectly fine, but if someone kills someone, and it saves something to the vault, and I change the map, it crashes. What could possibly be the problem?

PHP Code:
public Save_Data(id)  
{  
    new 
AuthID[35
    
get_user_authid(id,AuthID,34
    
    new 
vaultkey[64], vaultdata[256
    
    if(
pub_Class[id] == WARRIOR)
    {
        
formatex(vaultkey,63,"%s-xp-%i-class",AuthIDWARRIOR)
    }
    else
    {
        
formatex(vaultkey,63,"%s-xp-%i-class",AuthIDASSASSIN);
    }
    
    
formatex(vaultdata254"%i#%i#%i#%i#%i#%i"pub_Stats[id][EXP], 
        
pub_Stats[id][LVL], pub_Stats[id][AGILITY], pub_Stats[id][TRANSPARENCY],
        
pub_Stats[id][STRENGTH], pub_Stats[id][HEALTH]
    );
    
    
nvault_set(g_Vaultvaultkeyvaultdata);
    
    
formatex(vaultkeycharsmax(vaultkey), "%s-stats"AuthID);
    
nvault_set(g_Vaultvaultkeypub_Stats[id][STATSCOUNT]);
}

public 
Load_Data(id

    new 
AuthID[35
    
get_user_authid(id,AuthID,34
    
    new 
vaultkey[64];
    
formatex(vaultkey,63,"%s-xp-%i-class",AuthIDpub_Class[id]) 
    
    new 
Data[256]
    
nvault_get(g_VaultvaultkeyDatacharsmax(Data));
    
replace_all(Datacharsmax(Data), "#"" ");
    
    new 
exp[10], lvl[10], agi[10], trans[10], str[10], health[10];
    
parse(Dataexpcharsmax(exp), lvlcharsmax(lvl), agicharsmax(agi),
        
transcharsmax(trans), strcharsmax(str), healthcharsmax(health)
    );
    
    
pub_Stats[id][EXP] = str_to_num(exp);
    
pub_Stats[id][LVL] = str_to_num(lvl);
    
pub_Stats[id][AGILITY] = str_to_num(agi);
    
pub_Stats[id][TRANSPARENCY] = str_to_num(trans);
    
pub_Stats[id][STRENGTH] = str_to_num(str);
    
pub_Stats[id][HEALTH] = str_to_num(health);
    
    
formatex(vaultkeycharsmax(vaultkey), "%s-stats"AuthID);
    
pub_Stats[id][STATSCOUNT] = nvault_get(g_Vaultvaultkey);

Some possibly useful information:
-The nVault is closed at plugin_end()
-The nVault only loads data when the person joins a team
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX 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 11:17.


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