diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-05-14 21:53:04 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-08-05 03:25:42 -0300 |
commit | 94590e773d49239bd8a7d651eff3ed7e4a30ce80 (patch) | |
tree | 0779925311782a5c0c6a1f93a683eea87a1a7ed7 | |
parent | 2e76bfad08fdbb283c90a3bea77bb8b852696c93 (diff) | |
download | serverdata-94590e773d49239bd8a7d651eff3ed7e4a30ce80.tar.gz serverdata-94590e773d49239bd8a7d651eff3ed7e4a30ce80.tar.bz2 serverdata-94590e773d49239bd8a7d651eff3ed7e4a30ce80.tar.xz serverdata-94590e773d49239bd8a7d651eff3ed7e4a30ce80.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); |