From e38b64ff82573675df60e4ad9cc3814b16b36af1 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 1 Aug 2005 20:22:01 +0000 Subject: [PATCH] yams --- plugins/include/amxconst.inc | 2 ++ plugins/include/nvault.inc | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 plugins/include/nvault.inc diff --git a/plugins/include/amxconst.inc b/plugins/include/amxconst.inc index 2f90acc2..cfe5485f 100755 --- a/plugins/include/amxconst.inc +++ b/plugins/include/amxconst.inc @@ -281,3 +281,5 @@ enum { #define AMX_ERR_DIVIDE 11 #define AMX_ERR_NOTFOUND 19 #define AMX_ERR_PARAMS 25 + +#define INVALID_HANDLE -1 diff --git a/plugins/include/nvault.inc b/plugins/include/nvault.inc new file mode 100755 index 00000000..aac1edf4 --- /dev/null +++ b/plugins/include/nvault.inc @@ -0,0 +1,37 @@ +/* nVault functions +* +* by the AMX Mod X Development Team +* +* This file is provided as is (no warranties). +*/ + +#if defined _nvault_included + #endinput +#endif +#define _nvault_included + +//Opens a vault by name (such as "myvault") +//Returns a vault id, INVALID_HANDLE otherwise (-1) +native nvault_open(const name[]); + +//Gets a vault value by returning an int +// setting a byref float +// or setting a string + maxlength +native nvault_get(vault, const key[], ...); + +//Looks up a vault value for full information +//Returns 0 if the entry is not found +native nvault_lookup(vault, const key[], value[], maxlen, ×tamp) + +//Sets a vault value (with current timestamp) +native nvault_set(vault, const key[], const value[]); + +//Sets a permanent vault value (no timestamp) +native nvault_pset(vault, const key[], const value[]); + +//Prunes the vault for entries that are within the given timestamps. +//This will not erase values set with pset +native nvault_prune(vault, start, end); + +//Closes a vault +native nvault_close(vault);