Raised This Month: $ Target: $400
 0% 

Vault Save/Load


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 04-09-2007 , 14:21   Vault Save/Load
Reply With Quote #1

I need to save and load data by authid and name.

PHP Code:
public save_xp(id)
{
    new 
authid[35]
    
get_user_authid(id,authid,34)
    
    new 
name[35]
    
get_user_name(id,name,34)
    
    new 
vaultkey[64],vaultdata[96]
    
formatex(vaultkey,63,"%s-%s-SSTATS",authid,name)
    
formatex(vaultdata,95,"%i#%i",kills[id],deaths[id])
    
set_vaultdata(vaultkey,vaultdata)

The save seems to work as I can see it in my vault file. However the following which is the loading process doesn't seem to be working... any ideas? Thanks in advance.

PHP Code:
public load_xp(id)
{
    new 
authid[35]
    
get_user_authid(id,authid,34)
    
    new 
name[35]
    
get_user_name(id,name,34)
    new 
vaultkey[64],vaultdata[96]
    
formatex(vaultkey,63,"%s-%s-SSTATS",authid,name)
    if(
vaultdata_exists(vaultkey))
    {
        
get_vaultdata(vaultkey,vaultdata,95)
        
replace_all(vaultdata,95,"#"," ")
        new 
pre_kills[8],pre_deaths[8]
        
parse(vaultdata,pre_kills,7,pre_deaths,7)
        
kills[id]=str_to_num(pre_kills)
        
deaths[id]=str_to_num(pre_deaths)
    }
    else
    {
        
kills[id]=0
        deaths
[id]=0
    
}

__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
 


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 06:40.


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