Raised This Month: $32 Target: $400
 8% 

Vault Save Problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 10-12-2016 , 13:38   Vault Save Problems
Reply With Quote #1

Hello, i have this plugin:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <nvault_util>

#define MAX_BUFFER_LENGTH       2047
#define MOTD_HOURS_NAME "Hours Admins"

new const NVAULT_NAME[] = "Hours_Admins"

new g_sBufferMAX_BUFFER_LENGTH 1] = "";

native get_auth_type(id);

public 
plugin_init()
{
    
register_plugin("Hours Admins""1.0""siriusmd99")
    
    
register_clcmd("say /time""cmdHoursAdmins"ADMIN_RCON)
    
register_event("HLTV""hook_NewRound""a""1=0""2=0")
    
    
g_sBuffer[0] = 0;
    
    new 
iVault nvault_openNVAULT_NAME );
    
    if ( 
iVault == INVALID_HANDLE )
    {
        new 
fail_msg[64]
        
formatex(fail_msgcharsmax(fail_msg), "Cannot open nVault file ^"%s^"."NVAULT_NAME)
        
set_fail_statefail_msg )
    }
    else
    {
        
nvault_closeiVault )
    }
}

public 
hook_NewRound()
{
    new 
month[3], lastmonth[3];
    new 
day[4], lastday[4];
    
    
get_time("%m",month,charsmax(month))
    
get_time("%j",day,charsmax(day))
    
    
get_vaultdata("lastMonthHours"lastmonthcharsmax(lastmonth));
    
    if( !
lastmonth[0] )
    {
        
set_vaultdata("lastMonthHours"month);
        
set_vaultdata("lastDayHours"day);
        return;
    }
    
    new 
iVault nvault_util_openNVAULT_NAME );
    
    if( !
equal(lastmonthmonth))
    {
        
set_vaultdata("lastMonthHours"month);
        
nvault_util_closeiVault)
        
        
iVault nvault_openNVAULT_NAME )
        
nvault_prune(iVault0get_systime() + 1); 
        
nvault_setiVault month day );
        
nvault_closeiVault);         
    }
    else
    {
        
get_vaultdata("lastDayHours"lastdaycharsmax(lastday));
    
        if( !
equal(lastdayday))
        {
            
set_vaultdata("lastDayHours"day);
            
            new 
iKey[35];
            new 
iDays[4]
            new 
iPos;
            
            new 
isecVault nvault_openNVAULT_NAME )
        
            for (new 
invault_util_countiVault ); i++)
            {
                
                
iPos nvault_util_readiVault iPos iKey charsmaxiKey ) , iDays charsmaxiDays ) );
                
                
iDays[0] = 0;
                
                
nvault_setisecVault iKey iDays);
            }
            
            
nvault_closeisecVault);     
        }
        
        
nvault_util_close(iVault)
    }
}

public 
client_disconnect(id)
{
    if(
is_user_admin(id))
    {
        new 
data[35], nv_data[4];
        new 
iAuthType get_auth_type(id);
        
        switch(
iAuthType)
        {
            case 
1:
                
get_user_name(iddatacharsmax(data))
            case 
2:
                
get_user_ip(iddatacharsmax(data), 1)
            case 
3:
                
get_user_authid(iddatacharsmax(data))
        }
        
        new 
iVault nvault_openNVAULT_NAME );
        
        new 
tmp_time get_user_time(id);
        
nv_data[0] += tmp_time;
        
nv_data[1] += tmp_time;
        
nv_data[2] = iAuthType;
        
        
nvault_setiVault data nv_data );
        
        
nvault_closeiVault );
    }
}


public 
cmdHoursAdmins(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    format_top15
(g_sBuffer)
    
show_motd(idg_sBufferMOTD_HOURS_NAME)
    
    return 
PLUGIN_HANDLED
}


format_top15(sBuffer[MAX_BUFFER_LENGTH 1])
{
new 
iKey[32], iHours[4];
new 
iLen 0;
new 
szHours[12], szmHours[12]

iLen formatsBufferMAX_BUFFER_LENGTH,
"<head><META http-equiv=Content-Type content='text/html ;charset=UTF-8'></head><style>body{color:#FFCC99;background-color:black;margin-top:5}.A{background-color:#310000}.B{background-color:#630000}td{font-size:14px}</style><center><b><font size=4>Admins Time</b><table width=500>" )
iLen += formatsBuffer[iLen], MAX_BUFFER_LENGTH iLen,
"<tr bgcolor=#9C0000><td>%s<td>%s<td>%s<td>%s",
"#""Admin Name""Today""This Month")

new 
iVault nvault_util_openNVAULT_NAME 
new 
iPos;

for (new 
i< (nvault_util_countiVault )) && MAX_BUFFER_LENGTH iLen 0i++)
{
    
iPos nvault_util_readiVault iPos iKey charsmaxiKey ) , iHours charsmaxiHours ) );
    
    if(
iHours[2] > 1)
    {
        new 
plid find_playeriHours[2] == "d" "c"iKey)
        if(
plid)
        {
            
get_user_name(plidiKeycharsmax(iKey))
        }
        
        new 
tmp_curtime get_user_time(plid)
        
        
iHours[0] += tmp_curtime
        iHours
[1] += tmp_curtime
    
}
    
    
iHours[0] /= 60;
    
iHours[1] /= 60;
    
    if(
iHours[0] < 60)
    {
        
formatex(szHourscharsmax(szHours), "%d%s"iHours[0], "m")
    }
    else
    {
        
formatex(szHourscharsmax(szHours), "%d%s %d%s"iHours[0] / 60"h"iHours[0] % 60"m")
    }
    
    if(
iHours[1] < 60)
    {
        
formatex(szmHourscharsmax(szmHours), "%d%s"iHours[1], "m")
    }
    else
    {
        
formatex(szmHourscharsmax(szmHours), "%d%s %d%s"iHours[1] / 60"h"iHours[1] % 60"m")
    }
    
    
iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH iLen"<tr class=%s><td>%d<td>%s<td>%s<td>%s""B"1iKeyszHoursszmHours)
}
nvault_util_closeiVault )


Update.

I made apart date and time which are used to prune nvault keys.

I also change systime to get_user_time, which anyway has no sense.

So it's not working anyway.

I don't understand why.
I stay on server 4 minutes, i disconnect and after i reconnect and check my time , it shows 2 minutes

How the hell this can happen?

Last edited by siriusmd99; 10-13-2016 at 08:56.
siriusmd99 is offline
Old 10-12-2016, 14:07
wickedd
This message has been deleted by wickedd. Reason: misread
wickedd
Veteran Member
Join Date: Nov 2009
Old 10-12-2016 , 15:40   Re: Vault Save Problems
Reply With Quote #2

Why are you doing this?
PHP Code:
g_time[id] = get_systime() 
If anything it should be
PHP Code:
g_time[id] = get_user_timeid 
PHP Code:
new tmp_time get_systime() - g_time[id]; 


PHP Code:
new tmp_time get_systime() - get_user_timeid ); 
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 10-12-2016 , 16:22   Re: Vault Save Problems
Reply With Quote #3

g_time[id] is systime when player connected to server.

And i do systime - g_time to calculate seconds left from connect to disconnect.

The problem is not in the time because it adds properly.
Problem is in nvault. It doesnt save properly.
siriusmd99 is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 10-12-2016 , 17:53   Re: Vault Save Problems
Reply With Quote #4

Before 3 years i want same plugin and fr make this if you think will this help Is not with navault but maybe you reworked аs you like it

Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Ataraa Maikke"
#define VERSION "1.0"
#define AUTHOR "Betchualeng Arnaikem"

new logdir[] = "addons/amxmodx/logs/AdminConnects/";

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
}

public client_disconnect(id) 
{
    if(is_user_admin(id)) 
    {
        new filelog[128]
        
        new szName[32];
        get_user_name(id, szName, charsmax(szName));
        CleanName(szName, charsmax(szName));
        
        formatex(filelog, charsmax(filelog), "%s%s.txt", logdir, szName)
        if(!file_exists(filelog)) 
            write_file(filelog, "------------------------------------------------------------------")
        
        new Log[300], ip[32], timeng[32], nickname[42]
        get_time("%m/%d/%Y - %H:%M:%S", timeng,31)
        get_user_ip(id, ip, charsmax(ip))
        get_user_name(id, nickname, charsmax(nickname))
        formatex(Log, charsmax(Log), "Disconnect admin: %s (%s) ^nDisconection time: %s ^n", nickname, ip, timeng)
        write_file(filelog,Log)
    }
}

public client_putinserver(id) 
{    
    if(is_user_admin(id))
    {
        set_task(90.0,"joinwr",id);
    }
}

public joinwr(id) 
{
    if(is_user_connected(id)) 
    {
        new filelog[128]
        
        new szName[32];
        get_user_name(id, szName, charsmax(szName));
        CleanName(szName, charsmax(szName));

        formatex(filelog, charsmax(filelog), "%s%s.txt", logdir, szName)
        if(!file_exists(filelog)) 
            write_file(filelog, "------------------------------------------------------------------")
        
        new Log[300], ip[32], timeng[32], nickname[42], team[32]
        get_time("%m/%d/%Y - %H:%M:%S", timeng,31)
        get_user_ip(id, ip, charsmax(ip))
        get_user_name(id, nickname, charsmax(nickname))
        get_user_team(id, team, charsmax(team))
        formatex(Log, charsmax(Log), "Admin %s (%s) join %s ^nJoin time: %s ^n", nickname, ip, team, timeng)    
        write_file(filelog,Log)
    } 
}

CleanName(szName[], len)
{
    static chars[][] = 
    {
        "?",
        "/",
        "\",
        ">",
        "<",
        "*",
        "|",
        ":",
        "^""
    }
    
    for(new i; i < sizeof(chars); i++)
    replace_all(szName, len, chars[i], "");
}

Last edited by Ant1Lamer; 10-12-2016 at 17:54.
Ant1Lamer is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 10-13-2016 , 07:50   Re: Vault Save Problems
Reply With Quote #5

This is scripting forum, not request.
I want to fix my plugin.

I mean it looks that code is ok but it doesnt save properly , maybe it's nvault or nvault_util issue?

I used different handlers when working with both utilities , like in the tutorial.
siriusmd99 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 10-13-2016 , 08:56   Re: Vault Save Problems
Reply With Quote #6

Update.

I made apart date and time which are used to prune nvault keys.

I also changed systime to get_user_time, which anyway has no sense.

So it's not working anyway.

I don't understand why.
I stay on server 4 minutes, i disconnect and after i reconnect and check my time , it shows 2 minutes

How the hell this can happen?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <nvault_util>

#define MAX_BUFFER_LENGTH       2047
#define MOTD_HOURS_NAME "Hours Admins"

new const NVAULT_NAME[] = "Hours_Admins"

new g_sBufferMAX_BUFFER_LENGTH 1] = "";

native get_auth_type(id);

public 
plugin_init()
{
    
register_plugin("Hours Admins""1.0""siriusmd99")
    
    
register_clcmd("say /time""cmdHoursAdmins"ADMIN_RCON)
    
register_event("HLTV""hook_NewRound""a""1=0""2=0")
    
    
g_sBuffer[0] = 0;
    
    new 
iVault nvault_openNVAULT_NAME );
    
    if ( 
iVault == INVALID_HANDLE )
    {
        new 
fail_msg[64]
        
formatex(fail_msgcharsmax(fail_msg), "Cannot open nVault file ^"%s^"."NVAULT_NAME)
        
set_fail_statefail_msg )
    }
    else
    {
        
nvault_closeiVault )
    }
}

public 
hook_NewRound()
{
    new 
month[3], lastmonth[3];
    new 
day[4], lastday[4];
    
    
get_time("%m",month,charsmax(month))
    
get_time("%j",day,charsmax(day))
    
    
get_vaultdata("lastMonthHours"lastmonthcharsmax(lastmonth));
    
    if( !
lastmonth[0] )
    {
        
set_vaultdata("lastMonthHours"month);
        
set_vaultdata("lastDayHours"day);
        return;
    }
    
    new 
iVault nvault_util_openNVAULT_NAME );
    
    if( !
equal(lastmonthmonth))
    {
        
set_vaultdata("lastMonthHours"month);
        
nvault_util_closeiVault)
        
        
iVault nvault_openNVAULT_NAME )
        
nvault_prune(iVault0get_systime() + 1); 
        
nvault_setiVault month day );
        
nvault_closeiVault);         
    }
    else
    {
        
get_vaultdata("lastDayHours"lastdaycharsmax(lastday));
    
        if( !
equal(lastdayday))
        {
            
set_vaultdata("lastDayHours"day);
            
            new 
iKey[35];
            new 
iDays[4]
            new 
iPos;
            
            new 
isecVault nvault_openNVAULT_NAME )
        
            for (new 
invault_util_countiVault ); i++)
            {
                
                
iPos nvault_util_readiVault iPos iKey charsmaxiKey ) , iDays charsmaxiDays ) );
                
                
iDays[0] = 0;
                
                
nvault_setisecVault iKey iDays);
            }
            
            
nvault_closeisecVault);     
        }
        
        
nvault_util_close(iVault)
    }
}

public 
client_disconnect(id)
{
    if(
is_user_admin(id))
    {
        new 
data[35], nv_data[4];
        new 
iAuthType get_auth_type(id);
        
        switch(
iAuthType)
        {
            case 
1:
                
get_user_name(iddatacharsmax(data))
            case 
2:
                
get_user_ip(iddatacharsmax(data), 1)
            case 
3:
                
get_user_authid(iddatacharsmax(data))
        }
        
        new 
iVault nvault_openNVAULT_NAME );
        
        new 
tmp_time get_user_time(id);
        
nv_data[0] += tmp_time;
        
nv_data[1] += tmp_time;
        
nv_data[2] = iAuthType;
        
        
nvault_setiVault data nv_data );
        
        
nvault_closeiVault );
    }
}


public 
cmdHoursAdmins(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    format_top15
(g_sBuffer)
    
show_motd(idg_sBufferMOTD_HOURS_NAME)
    
    return 
PLUGIN_HANDLED
}


format_top15(sBuffer[MAX_BUFFER_LENGTH 1])
{
new 
iKey[32], iHours[4];
new 
iLen 0;
new 
szHours[12], szmHours[12]

iLen formatsBufferMAX_BUFFER_LENGTH,
"<head><META http-equiv=Content-Type content='text/html ;charset=UTF-8'></head><style>body{color:#FFCC99;background-color:black;margin-top:5}.A{background-color:#310000}.B{background-color:#630000}td{font-size:14px}</style><center><b><font size=4>Admins Time</b><table width=500>" )
iLen += formatsBuffer[iLen], MAX_BUFFER_LENGTH iLen,
"<tr bgcolor=#9C0000><td>%s<td>%s<td>%s<td>%s",
"#""Admin Name""Today""This Month")

new 
iVault nvault_util_openNVAULT_NAME 
new 
iPos;

for (new 
i< (nvault_util_countiVault )) && MAX_BUFFER_LENGTH iLen 0i++)
{
    
iPos nvault_util_readiVault iPos iKey charsmaxiKey ) , iHours charsmaxiHours ) );
    
    if(
iHours[2] > 1)
    {
        new 
plid find_playeriHours[2] == "d" "c"iKey)
        if(
plid)
        {
            
get_user_name(plidiKeycharsmax(iKey))
        }
        
        new 
tmp_curtime get_user_time(plid)
        
        
iHours[0] += tmp_curtime
        iHours
[1] += tmp_curtime
    
}
    
    
iHours[0] /= 60;
    
iHours[1] /= 60;
    
    if(
iHours[0] < 60)
    {
        
formatex(szHourscharsmax(szHours), "%d%s"iHours[0], "m")
    }
    else
    {
        
formatex(szHourscharsmax(szHours), "%d%s %d%s"iHours[0] / 60"h"iHours[0] % 60"m")
    }
    
    if(
iHours[1] < 60)
    {
        
formatex(szmHourscharsmax(szmHours), "%d%s"iHours[1], "m")
    }
    else
    {
        
formatex(szmHourscharsmax(szmHours), "%d%s %d%s"iHours[1] / 60"h"iHours[1] % 60"m")
    }
    
    
iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH iLen"<tr class=%s><td>%d<td>%s<td>%s<td>%s""B"1iKeyszHoursszmHours)
}
nvault_util_closeiVault )


Last edited by siriusmd99; 10-13-2016 at 08:57.
siriusmd99 is offline
Ant1Lamer
Senior Member
Join Date: Jul 2009
Old 10-13-2016 , 13:14   Re: Vault Save Problems
Reply With Quote #7

try
Code:
nvault_prune(iVault, 0, get_systime() + 1);


to
Code:
nvault_prune(iVault, 0, get_systime() * 60);
Ant1Lamer is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 10-13-2016 , 14:15   Re: Vault Save Problems
Reply With Quote #8

Quote:
Originally Posted by Ant1Lamer View Post
try
Code:
nvault_prune(iVault, 0, get_systime() + 1);


to
Code:
nvault_prune(iVault, 0, get_systime() * 60);
It has no sense, this just deletes all entries from nvault once in a month.


I solved my problem myself.
The problem was that I didn't use correctly get_vaultdata native.

When i get a string(or array) i must use charsmax to define the length
so it's something like this :

PHP Code:
get_vaultdata("lastMonthOre"lastmonth); 


PHP Code:
get_vaultdata("lastMonthOre"lastmonthcharsmax(lastmonth)); 
Problem Solved.
siriusmd99 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 10-13-2016 , 17:30   Re: Vault Save Problems
Reply With Quote #9

Oh my godness.
I thought problem was solved but new problem.

It works normal and after some reconnections it's starting to set negative values or for example if I saved to nvault 135 seconds after reconnect it gets only 20 or -140 , like random values.

Is it something out of maximum possible value for nvault?

After 134 it goes to negative , like it reaches maximum limit or something. I don't understand.

This is the code:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <nvault_util>

#define MAX_BUFFER_LENGTH       2047
#define MOTD_ORE_NAME "Time Admins"

new const NVAULT_NAME[] = "Time_Admins"

new g_sBufferMAX_BUFFER_LENGTH 1] = "";

native get_auth_type(id);

public 
plugin_init()
{
    
register_plugin("Time Admins""1.0""siriusmd99")
    
    
register_clcmd("say /time""cmdTimeAdmins"ADMIN_RCON)
    
register_event("HLTV""hook_NewRound""a""1=0""2=0")
    
    
g_sBuffer[0] = 0;
    
    new 
iVault nvault_openNVAULT_NAME );
    
    if ( 
iVault == INVALID_HANDLE )
    {
        new 
fail_msg[64]
        
formatex(fail_msgcharsmax(fail_msg), "Cannot open nVault file ^"%s^"."NVAULT_NAME)
        
set_fail_statefail_msg )
    }
    else
    {
        
nvault_closeiVault )
    }
}

public 
hook_NewRound()
{
    new 
month[3], lastmonth[3];
    new 
day[4], lastday[4];
    
    
get_time("%m",month,charsmax(month))
    
get_time("%j",day,charsmax(day))
    
    
get_vaultdata("lastMonthOre"lastmonthcharsmax(lastmonth));
    
    if( !
lastmonth[0] )
    {
        
set_vaultdata("lastMonthTime"month);
        
set_vaultdata("lastDayTime"day);
        return;
    }
    
    new 
iVault nvault_util_openNVAULT_NAME );
    
    if( !
equal(lastmonthmonth))
    {
        
set_vaultdata("lastMonthTime"month);
        
nvault_util_closeiVault)
        
        
iVault nvault_openNVAULT_NAME )
        
nvault_prune(iVault0get_systime() + 1); 
        
nvault_setiVault month day );
        
nvault_closeiVault);         
    }
    else
    {
        
get_vaultdata("lastDayTime"lastdaycharsmax(lastday));
        
        if( !
equal(lastdayday))
        {
    
            
set_vaultdata("lastDayTime"day);
            
            new 
iKey[35];
            new 
iDays[4]
            new 
iPos;
            
            new 
isecVault nvault_openNVAULT_NAME )
            
            for (new 
invault_util_countiVault ); i++)
            {
                
                
iPos nvault_util_readiVault iPos iKey charsmaxiKey ) , iDays charsmaxiDays ) );
                
                
iDays[0] = 0;
                
                
nvault_setisecVault iKey iDays);
            }
            
            
nvault_closeisecVault);     
        }
        
        
nvault_util_close(iVault)
    }
}

public 
client_disconnect(id)
{
    if(
is_user_admin(id))
    {
        new 
data[35], nv_data[4];
        new 
iAuthType get_auth_type(id);
        
        switch(
iAuthType)
        {
            case 
1get_user_name(iddatacharsmax(data))
            case 
2:    get_user_ip(iddatacharsmax(data), 1)
            case 
3get_user_authid(iddatacharsmax(data))
        }
        
        new 
iVault nvault_openNVAULT_NAME );
        
        
nvault_getiVault datanv_datacharsmax(nv_data) );
        
        
log_amx("get %d seconds , %d seconds"nv_data[0], nv_data[1])
        
        new 
tmp_time get_user_time(id);
        
nv_data[0] += tmp_time;
        
nv_data[1] += tmp_time;
        
nv_data[2] = iAuthType;
        
        
nvault_setiVault data nv_data );
        
        
log_amx("set %d seconds, set %d seconds"nv_data[0], nv_data[1])
        
        
nvault_closeiVault );
    }
}


public 
cmdOreAdmins(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
    return 
PLUGIN_HANDLED
    
    format_top15
(g_sBuffer)
    
show_motd(idg_sBufferMOTD_ORE_NAME)
    
    return 
PLUGIN_HANDLED
}


format_top15(sBuffer[MAX_BUFFER_LENGTH 1])
{
    new 
iKey[32], iSeconds[4];
    new 
iLen 0;
    new 
szHours[12], szmHours[12]

    
iLen formatsBufferMAX_BUFFER_LENGTH,
    
"<head><META http-equiv=Content-Type content='text/html ;charset=UTF-8'></head><style>body{color:#FFCC99;background-color:black;margin-top:5}.A{background-color:#310000}.B{background-color:#630000}td{font-size:14px}</style><center><b><font size=4>Admins Time</b><table width=500>" )
    
iLen += formatsBuffer[iLen], MAX_BUFFER_LENGTH iLen,
    
"<tr bgcolor=#9C0000><td>%s<td>%s<td>%s<td>%s",
    
"#""Admin Name""Today""This Month")

    new 
iVault nvault_util_openNVAULT_NAME 
    new 
iPos;

    for (new 
i< (nvault_util_countiVault )) && MAX_BUFFER_LENGTH iLen 0i++)
    {
        
iPos nvault_util_readiVault iPos iKey charsmaxiKey ) , iSeconds charsmaxiSeconds ) );
    
        if(
iSeconds[2] > 1)
        {
            new 
plid find_playeriSeconds[2] == "d" "c"iKey)
            if(
plid)
            {
               
get_user_name(plidiKeycharsmax(iKey))
            }
        
            new 
tmp_curtime get_user_time(plid)
        
            
iSeconds[0] += tmp_curtime
            iSeconds
[1] += tmp_curtime
        
}
    
        
iSeconds[0] /= 60//Converting seconds to minutes
        
iSeconds[1] /= 60;
    
        if(
iSeconds[0] < 60)
        {
            
formatex(szHourscharsmax(szHours), "%d%s"iSeconds[0], "m")
        } 
        else
        {
            
formatex(szHourscharsmax(szHours), "%d%s %d%s"iSeconds[0] / 60"h"iSeconds[0] % 60"m")
        }
    
        if(
iSeconds[1] < 60)
        {
            
formatex(szmHourscharsmax(szmHours), "%d%s"iSeconds[1], "m")
        }
        else
        {
            
formatex(szmHourscharsmax(szmHours), "%d%s %d%s"iSeconds[1] / 60"h"iSeconds[1] % 60"m")
        }
    
        
iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH iLen"<tr class=%s><td>%d<td>%s<td>%s<td>%s""B"1iKeyszHoursszmHours)
    }
    
    
nvault_util_closeiVault )

I put log and it shows on admin disconnect this:

Set 130 seconds and 130 seconds (daily and monthly)

After i reconnect and disconnect back it shows:

get -40 seconds and -40 seconds.

How is this possible?

I saved 130 seconds and when i get the value from nvault it's -40?

I looked and checked the code and there is nothing in code that could change value from 130 to -40 like this.

Thanks for help in advance.
siriusmd99 is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 10-13-2016 , 17:39   Re: Vault Save Problems
Reply With Quote #10

Just offtopic, why you would want to use vault and nvault in the same plugin?

Edit: Also... Nvault util, oh my god..
__________________
Project: Among Us

Last edited by Craxor; 10-13-2016 at 17:41.
Craxor is offline
Send a message via ICQ to Craxor
Reply


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 21:17.


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