diff options
author | gumi <git@gumi.ca> | 2020-07-23 20:36:49 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2020-07-27 08:47:41 -0400 |
commit | b899412192d02f5f36d693a92d97b8cf6863f72f (patch) | |
tree | 30f0dff6fb5d4a856621411e55d49f459f93312c /npc/functions/vault.txt | |
parent | 0d06b85ee4fc385c2d15057f8d8fc59f77f526ed (diff) | |
download | serverdata-b899412192d02f5f36d693a92d97b8cf6863f72f.tar.gz serverdata-b899412192d02f5f36d693a92d97b8cf6863f72f.tar.bz2 serverdata-b899412192d02f5f36d693a92d97b8cf6863f72f.tar.xz serverdata-b899412192d02f5f36d693a92d97b8cf6863f72f.zip |
add the player cache system
Diffstat (limited to 'npc/functions/vault.txt')
-rw-r--r-- | npc/functions/vault.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/npc/functions/vault.txt b/npc/functions/vault.txt index 05d65886..87ee50df 100644 --- a/npc/functions/vault.txt +++ b/npc/functions/vault.txt @@ -72,3 +72,25 @@ function script getvaultvar { function script setvaultvar { return set(getvaultvar(getarg(0), getarg(2, "")), getarg(1)); } + +/** + * handles Vault hooks on player login + */ +- script VaultHandler NPC_HIDDEN,{ + public function OnDualLogin { + .@toKick$ = strcharinfo(PC_NAME, "", getarg(0, 0)); + + if (.@toKick$ != "") { + .@msg$ = sprintf("Kicking player %s (Vault dual-login)", .@toKick$); + consolemes(CONSOLEMES_INFO, .@msg$); // log this + dispbottom(.@msg$); // tell the player + + return kick(.@toKick$, 2); // reason 2 is dual-login + } + + return false; + } + +OnInit: + "playerCache"::addVaultHandler("OnDualLogin"); +} |