diff options
-rw-r--r-- | init.lua | 2 | ||||
-rw-r--r-- | welfare.lua (renamed from interest.lua) | 15 |
2 files changed, 16 insertions, 1 deletions
@@ -601,7 +601,7 @@ minetest.register_craft({ } }) -dofile(modpath .. "/interest.lua") +dofile(modpath .. "/welfare.lua") atm.readaccounts() minetest.register_on_shutdown(atm.saveaccounts) diff --git a/interest.lua b/welfare.lua index ffcc0fc..964c2f6 100644 --- a/interest.lua +++ b/welfare.lua @@ -46,3 +46,18 @@ minetest.register_chatcommand("give_welfare", { end, }) +minetest.register_chatcommand("view_finances", { + description = "view a player's finances", + params = "<player>", + privs = { kick = true }, + func = function (name, plname) + if not atm.balance[plname] then + return false, plname.." does not have a bank account!" + end + minetest.chat_send_player(name, "Account balance: "..atm.balance[plname]) + if atm.welfare[plname] then + minetest.chat_send_player(name, "Remaining welfare: "..atm.welfare[plname]) + end + return true + end +}) |