Raised This Month: $ Target: $400
 0% 

Nvault Crashing Server


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
RAW_192
Senior Member
Join Date: Feb 2017
Old 07-30-2017 , 12:38   Nvault Crashing Server
Reply With Quote #1

PHP Code:
Save(id)
    {
        new 
szAuthId[32]; 
        
get_user_authid(idszAuthIdcharsmax(szAuthId));
        
        new 
szName[32]; 
        
get_user_name(idszNamecharsmax(szName));
        
        new 
szData[200];
        
formatex(szDatacharsmax(szData), "^"%s^" ^"%i^""szNameg_iPoints[id]);
        
        
nvault_set(g_iVaultszAuthIdszData);
    }
    
Load(id)
    {   
        new 
szAuthId[32]; get_user_authid(idszAuthIdcharsmax(szAuthId));
        
        new 
szData[200], iTimeStamp;
        if(
nvault_lookup(g_iVaultszAuthIdszDatacharsmax(szData), iTimeStamp))
        {
                  new 
szSavedname[32], szPoint[16];
                  
parse(szDataszSavednamecharsmax(szSavedname), szPointcharsmax(szPoint))
                  
remove_quotes(szSavedname)
                  
remove_quotes(szPoint)
                  
set_user_info(id"name"szSavedname)
                  
g_iPoints[id] = str_to_num(szPoint)
         }
    } 

PHP Code:
public plugin_init()
    {
        
register_pluginPLUGINVERSIONAUTHOR )

        new 
g_iVault nvault_open("System");
        
        if ( 
g_iVault == INVALID_HANDLE )
        
set_fail_state"Error opening nVault" );
        
        
set_task(180.0"Task_Advertise"___"b");
    }
    public 
plugin_end() 
    {
        
nvault_close(g_iVault);
    }    
    public 
client_putinserver(id)
    {
        if(
is_user_hltv(id) || is_user_bot(id))
            return 
PLUGIN_HANDLED;

        
Load(id);
        return 
PLUGIN_HANDLED;
    }
    public 
client_disconnect(id)
    {
        if(
is_user_hltv(id) || is_user_bot(id))
            return 
PLUGIN_HANDLED;
        
        
Save(id);
        return 
PLUGIN_HANDLED;
    } 

Is there any issue with the code?

Because on map change its causing the server to crash .. And when we delete the vault file from data-> vault then only the server is able to start
RAW_192 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 10:01.


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