AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   fVault Level & Points storage (https://forums.alliedmods.net/showthread.php?t=172340)

Diegorkable 11-19-2011 05:57

fVault Level & Points storage
 
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;
        



mrhellish 11-19-2011 14:47

Re: fVault Level & Points storage
 
I think the problem is in the saving data, not loading..

Diegorkable 11-19-2011 15:29

Re: fVault Level & Points storage
 
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.

mrhellish 11-19-2011 16:33

Re: fVault Level & Points storage
 
Counter-Strike?
register_event("HLTV","client_disconnect","a" ,"1=0","2=0");
public client_disconnect(id) SaveLvl(id);

Diegorkable 11-19-2011 16:40

Re: fVault Level & Points storage
 
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 :D

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


All times are GMT -4. The time now is 08:34.

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