Raised This Month: $ Target: $400
 0% 

fVault Level & Points storage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-19-2011 , 05:57   fVault Level & Points storage
Reply With Quote #1

Hey guys,

I have a problem, well, not that something doesnt work, but only sometimes work, and then gets fixed.

I store Level and Points on STEAM ID of players. I save it by fvault, when the key name is their STEAM ID and the data is their points / level (seperate vault for each thing.... points and level).

Now, sometimes when players log in, lets say they are Level 10, so sometimes they log in and it says they are level 1 and with no points, means it didnt load their things. BUT, after map change, they get their stats back.

'retry' doesnt fix the problem, only map change, then it happens to others, or to none at all.

My question is, why the hell would it randomally load / not load their stats? From what I know fvault doesn't have a mood.

Here is my function, can something go wrong?

PHP Code:
LoadLvl(plr)
{
    new 
authid[35];
    
get_user_authid(plrauthidsizeof(authid) - 1);
    
    new 
data[16];
        
    if( 
fvault_get_data(g_vault_levelauthiddatasizeof(data) - 1) )
        
g_lvl[plr] = str_to_num(data);
    
    else
        
g_lvl[plr] = 0;
        

__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive

Last edited by Diegorkable; 11-19-2011 at 05:58.
Diegorkable is offline
mrhellish
Junior Member
Join Date: Jun 2010
Old 11-19-2011 , 14:47   Re: fVault Level & Points storage
Reply With Quote #2

I think the problem is in the saving data, not loading..
mrhellish is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-19-2011 , 15:29   Re: fVault Level & Points storage
Reply With Quote #3

PHP Code:
SaveLvl(plr)
{
    new 
authid[35];
    
get_user_authid(plrauthidsizeof(authid) - 1);
    
    new 
data[16];
    
num_to_str(g_lvl[plr], datasizeof(data) - 1);
    
fvault_set_data(g_vault_levelauthiddata)
            
    return 
PLUGIN_CONTINUE

I believe there's no problem with it.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
mrhellish
Junior Member
Join Date: Jun 2010
Old 11-19-2011 , 16:33   Re: fVault Level & Points storage
Reply With Quote #4

Counter-Strike?
register_event("HLTV","client_disconnect","a" ,"1=0","2=0");
public client_disconnect(id) SaveLvl(id);
mrhellish is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-19-2011 , 16:40   Re: fVault Level & Points storage
Reply With Quote #5

yep i have that thing, it saves lvl on client disconnect. just so you know i think it mighht be a third party plugin issue, not this one but something else ruining it, I'll post here when I have an update.

thanks still

EDIT: It was that third party plugin, problem fixed. thanks
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive

Last edited by Diegorkable; 11-20-2011 at 16:38.
Diegorkable is offline
Reply



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 08:34.


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