diff options
author | gpcf <gpcf@gpcf.eu> | 2024-09-22 21:21:09 +0200 |
---|---|---|
committer | gpcf <gpcf@gpcf.eu> | 2024-09-22 21:21:09 +0200 |
commit | 1dcf3af5ab71dccad7b12f4240b62ee695a6dd9a (patch) | |
tree | 8f790a7ee6b66160efb9afe94e63399c18234e52 | |
parent | ace14bc0c24ff0fb1901727a088d651e2473cac5 (diff) | |
download | atm-1dcf3af5ab71dccad7b12f4240b62ee695a6dd9a.tar.gz atm-1dcf3af5ab71dccad7b12f4240b62ee695a6dd9a.tar.bz2 atm-1dcf3af5ab71dccad7b12f4240b62ee695a6dd9a.zip |
-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 +}) |