Raised This Month: $ Target: $400
 0% 

[help] Cod help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 03-12-2011 , 04:08   Re: [help] Cod help
Reply With Quote #5

Quote:
Originally Posted by natkemon View Post
i know how to debug.
I doubt it.

Quote:
Originally Posted by natkemon View Post
and how would i go about fixing the save and load function?
I normally would recommend going with sql and covering cases that may produce errors, but it may be too much for you, so you can start with this:
PHP Code:
public SaveData(id)
{
    new 
key[32], data[101];
    
get_user_authid(idkey31);
    
format(data100"%d %d"gXP[id], gLevel[id]);
    
nvault_set(g_vaultkeydata);
}

public 
LoadData(id)
{
    new 
key[32], data[101];
    
get_user_authid(idkey31);
    
nvault_get(g_vaultkeydata100);

    new 
szXP[32], szLevel[32];
    
parse(dataszXP31szLevel31);
 
    
gXP[id] = str_to_num(szXP);
    
gLevel[id] = str_to_num(szLevel);
}

public 
plugin_end()
{
    
nvault_close(g_vault);

You need to save data only in client_disconnect and load data only in client_authorized.
__________________
Impossible is Nothing
Sylwester 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 14:35.


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