Witajcie.
Mam problem z zapisem do pliku przez nvault. Mam taki testowy kod:
#include <amxmodx>
#include <nvault>
#define PLUGIN "test"
#define VERSION "1.0"
#define AUTHOR "Sebxx"
new g_vault, stamp, szSteam[35], string1[11], string2[11]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_vault = nvault_open("newtest")
}
public client_authorized(id, const authid[])
{
set_task(5.0, "test", id, _, _, "b")
}
public test(id)
{
get_user_authid( id, szSteam, charsmax(szSteam) )
num_to_str( get_systime(), string1, charsmax(string1) );
nvault_set( g_vault , szSteam , string1 );
nvault_get( g_vault , szSteam , string2 , charsmax( string2 ) );
stamp = str_to_num( string2 )
client_print(id, 3, "nVault: %d", stamp)
}
Po prostu co 5 sekund wpisuje do nvaulta pod klucz, którym jest moje steam_id czas w unixie i pobiera od razu tę wartość i wyświetla. I to działa, tzn normalnie co 5 sekund widzę odpowiednią wartość.
Problem jest taki, że kiedy zajrzę do FTP, plik newtest.nvault jest pusty
Zależy mi aby ta wartość pod tym konkretnym kluczem została w tym pliku już na stałe (albo dopóki celowo jej nie wykasuję). Co robię źle?


Dodatki SourceMod



Temat jest zamknięty










