diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-05-14 21:53:04 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-08-05 03:25:43 -0300 |
commit | 49a6e94787b72c4b15c88318a54e5ef1d29fe9fc (patch) | |
tree | b8fe6216d36ad894ca0f4943afd1e1a0b50bcea0 | |
parent | 2720336cf91ef9792e40c35c3459c4069b64d728 (diff) | |
download | serverdata-49a6e94787b72c4b15c88318a54e5ef1d29fe9fc.tar.gz serverdata-49a6e94787b72c4b15c88318a54e5ef1d29fe9fc.tar.bz2 serverdata-49a6e94787b72c4b15c88318a54e5ef1d29fe9fc.tar.xz serverdata-49a6e94787b72c4b15c88318a54e5ef1d29fe9fc.zip |
New function validacc() which verifies for vault account and assigns one if needed.
This is only relevant for localhosts.
-rw-r--r-- | npc/functions/main.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt index 851c46d0..9331e201 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -224,6 +224,22 @@ function script npctalkonce { return true; } +// validacc() -> Validate attached player vault account +// Returns "true" on success +function script validacc { + .@id=##VAULT[0]; + if (.@id > 0) + return true; + // We failed; Maybe we can do something about it? + if (debug) { + ##VAULT[0]=getcharid(3); + consolemes(CONSOLEMES_ERROR, "Account %d has no vault index. Debug environment detected, automatically assigning one...", getcharid(3)); + return true; + } + // Nothing to be done about it; I dunno what sort of env this is! + return false; +} + // getv(variable{, Vault ID}) -> Returns a Vault Variable function script getv { .@v$=getarg(0); |