--lua PFL_NONE 0 3

local bank = owner(pl)

if not getflag(bank, flag.Bank) then
  send(pl, "You can only check your balance in a bank.")
  return
end

local mob = getobj(bank, "bankmob")

if not mob or owner(mob) != bank then
  send(pl, "The cashier appears to be missing.")
  return
end

local cur = currency(mob)
local bal = balance(pl, cur)

if bal==0 then
  tell(mob, pl, "You have nothing banked with us.")
  return
end

if bal<0 then
  tell(mob, pl, "You are "..formatcash(-bal, cur, 1).." ^Roverdrawn^n.")
  return
end

tell(mob, pl, "You have "..formatcash(bal, cur, 1).." in your account.")
