Add a configurable income amount.
This commit is contained in:
parent
d4366ff8eb
commit
f9d5edf7fe
10
README.md
10
README.md
|
@ -12,12 +12,14 @@ again).
|
|||
- `money3.initial_amount`: The amount of money new players get. Default: `0`.
|
||||
- `money3.currency_name`: The text appended to the currency when displaying it.
|
||||
Default: `cr`.
|
||||
- `money3.enable_income`: Pays players 10cr every in-game day.
|
||||
Default: `true` if creative mode is disabled, otherwise `false`. If you are
|
||||
using the [currency](https://gitlab.com/VanessaE/currency) mod, it is
|
||||
probably a good idea to set `currency.income_enabled` to `false`. If you
|
||||
- `money3.enable_income`: Pays players money (by default 10cr) every in-game
|
||||
day. Default: `true` if creative mode is disabled, otherwise `false`. If
|
||||
you are using the [currency](https://gitlab.com/VanessaE/currency) mod, it
|
||||
is probably a good idea to set `currency.income_enabled` to `false`. If you
|
||||
use an outdated version of the currency mod where this setting does not
|
||||
exist, the automatic income system is automatically disabled.
|
||||
- `money3.income_amount`: Changes the amount of income players get paid. If
|
||||
income is not enabled, this does nothing.
|
||||
- `money3.convert_items`: A lua table (that can also be `nil` to disable)
|
||||
similar to the following (default) one:
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ end
|
|||
|
||||
setting("initial_amount", 0)
|
||||
setting("currency_name", "cr")
|
||||
setting("income_amount", 10)
|
||||
|
||||
setting("convert_items", {
|
||||
gold = { item = "default:gold_ingot", dig_block="default:stone_with_gold", desc='Gold', amount=75, minval=25 },
|
||||
|
|
|
@ -29,10 +29,11 @@ function money3.earn_income(name)
|
|||
end
|
||||
if income[name] then
|
||||
income[name] = nil
|
||||
money3.add(name, 10)
|
||||
local amount = money3.income_amount
|
||||
money3.add(name, amount)
|
||||
|
||||
-- Tell the player
|
||||
local msg = "[money3] You have earned " .. money3.format(10) ..
|
||||
local msg = "[money3] You have earned " .. money3.format(amount) ..
|
||||
". Your balance is now " .. money3.format(money3.get(name)) .. "."
|
||||
|
||||
if minetest.colorize then msg = minetest.colorize("#CCCCCC", msg) end
|
||||
|
|
|
@ -11,3 +11,7 @@ money3.convert_items (A lua table with a list of money3 items) string
|
|||
# Automatically give active players 10cr every 12 minutes. If the currency
|
||||
# mod is installed and this is enabled, its income will be disabled.
|
||||
money3.enable_income (Enable money3 income) bool true
|
||||
|
||||
# Changes the amount of income players get paid. If income is not enabled,
|
||||
# this does nothing.
|
||||
money3.income_amount (Amount to pay players in money3 income) int 10 0
|
||||
|
|
Loading…
Reference in New Issue