this is my first time using nVault, am I doing this correectly, I kinda just pulled it outta my butt....
Code:
#define PLUGIN_VAULT "avp_vault"
new vault = nvault_open(PLUGIN_VAULT);
if(vault == INVALID_HANDLE) {
avp_log("ERROR: Unable to open vault file %s", PLUGIN_VAULT);
return PLUGIN_CONTINUED;
}
//saves
nvault_set(vault, szKey, szData);
nvault_close(vault);
I format the key/data earlier I am not sure I am using the nvault system right or not...
then loading:
Code:
new vault = nvault_open(PLUGIN_VAULT);
if(vault == INVALID_HANDLE) {
avp_log("ERROR: Unable to open vault file %s", PLUGIN_VAULT);
return PLUGIN_CONTINUED;
}
new szKey[128], szData[256], data;
data = nvault_get(vault, szKey, szData, 255);
nvault_close(vault);
if(data) {
parse(szData, ........); //parse dfata blah blah
} else {
//if this is called key not found???? I dunno....
}
is that right?
__________________