Mod Request: Currency
Here's a little snippet of my idea:
any mod dev's want to take this challenge up?
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_on_newplayer will check if a person has a "bank account" if the search for the file is nil then it creates a "bank account" file and a "savings account" file in the format YOURNAME:savings YOURNAME:account
bank block - basically an ATM ..looks like an ATM, functions like an ATM
/balance - displays balance in $ from the "bank account" file
/deposit - deposit money into the "bank" if a person is pointed at a "bank block"
(this would store it in the "savings" file, and every time TIME = 0 then it would add on 10% into the "savings")
store block - this is an ABM
-If pointed to, you can type in /store FOLDER:BLOCKNAME buy/sell , which in a real world scenario would look like /store default:dirt 10/5
(but if pointed_thing = NIL then return "minetest.chat_send_player(player:get_player_name(), "There is no way to sell this!")"
-When the command "/store" is sent, the player who sent the command will become the "store owner" of the store block
-When the command "/store" sent to the server, the store block will react by creating another store block on top of it with a sign that will read Buy:THEBUYNUMBER Sell:THESELLNUMBER on the front of it, also an unbreakable representation of the block youve posted to sell will be created in front of the original store block
-The sign created is not editable
-All parts of the store block (as a whole when its "in use") are indestructible by anyone who is not the "store owner" (they will break it and it will reappear just as it was)
-If the bank blocks sign is broken by the "store owner", then the bank block ABM will remove the sign,the top bank block, and the representation, and anyone will be able to claim the blank store block
-On right click of the store block sign, it will check if that block is in your inventory, if this is true, then that item will be "sold" at to the store block (aka it will remove 1 of that block from your inventory and then it will add in the "SELL" amount that the store block is defined as)
-On left click (aka punch) of the store block sign, the server will check your inventory, if you do not have enough money then the server will do:
minetest.chat_send_player(player:get_player_name(), "Not enough money!")
else if there is enough money, then it will deduct the amount of money in the "BUY" amount that the block is defined as and it will add in 1 of that block into your inventory
Jobs too?
any mod dev's want to take this challenge up?