mirror of
https://codeberg.org/usrib/emeraldbank.git
synced 2024-12-23 14:42:27 +01:00
revert, chat msgs instead titles
This commit is contained in:
parent
ec81bb270f
commit
3ed54ea8fc
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
-- Copyright (C) 2021, 2022 Ale
|
-- Copyright (C) 2021, 2023 Ale
|
||||||
|
|
||||||
-- This file is part of Emeraldbank Minetest Mod.
|
-- This file is part of Emeraldbank Minetest Mod.
|
||||||
|
|
||||||
@ -56,10 +56,10 @@ core.register_chatcommand("pay", {
|
|||||||
pitch = 1.0,
|
pitch = 1.0,
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
mcl_title.set(player1, "subtitle", {text=S("Not enough Emeralds in your account"), color="dark_red"})
|
core.chat_send_player(name, S("Not enough Emeralds in your account"))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
mcl_title.set(player1, "subtitle", {text=S("Invalid pay"), color="dark_red"})
|
core.chat_send_player(name, S("Invalid pay"))
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
-- Copyright (C) 2021, 2022 Ale
|
-- Copyright (C) 2021, 2023 Ale
|
||||||
|
|
||||||
-- This file is part of Emeraldbank Minetest Mod.
|
-- This file is part of Emeraldbank Minetest Mod.
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ core.register_globalstep(function(dtime)
|
|||||||
for _, player in ipairs(core.get_connected_players()) do
|
for _, player in ipairs(core.get_connected_players()) do
|
||||||
if not player or player.is_fake_player then return end
|
if not player or player.is_fake_player then return end
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
mcl_title.set(player, "subtitle", {text=S("You have earned @1 emeralds in your bank account!", income_count), color="green"})
|
core.chat_send_player(name, S("You have earned @1 emeralds in your bank account!", income_count))
|
||||||
emeraldbank.add_emeralds(player, income_count)
|
emeraldbank.add_emeralds(player, income_count)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
8
shop.lua
8
shop.lua
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
-- Copyright (C) 2021, 2022 Ale
|
-- Copyright (C) 2021, 2023 Ale
|
||||||
|
|
||||||
-- This file is part of Emeraldbank Minetest Mod.
|
-- This file is part of Emeraldbank Minetest Mod.
|
||||||
|
|
||||||
@ -298,7 +298,7 @@ core.register_on_player_receive_fields(function(sender, formname, fields)
|
|||||||
|
|
||||||
-- owner try exchanges
|
-- owner try exchanges
|
||||||
if meta:get_string("owner") == name then
|
if meta:get_string("owner") == name then
|
||||||
mcl_title.set(sender, "subtitle", {text=S("This is your own shop, you can't exchange to yourself!"), color="dark_red"})
|
core.chat_send_player(name, S("This is your own shop, you can't exchange to yourself!"))
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@ -307,13 +307,13 @@ core.register_on_player_receive_fields(function(sender, formname, fields)
|
|||||||
-- have u money?
|
-- have u money?
|
||||||
if bankemeralds < old_price then
|
if bankemeralds < old_price then
|
||||||
can_exchange = false
|
can_exchange = false
|
||||||
mcl_title.set(sender, "subtitle", {text=S("Not enough Emeralds in your account"), color="dark_red"})
|
core.chat_send_player(name, S("Not enough Emeralds in your account"))
|
||||||
end
|
end
|
||||||
|
|
||||||
--there are enough items?
|
--there are enough items?
|
||||||
if not minv:contains_item("stock", shop_item.." "..old_count, true) then
|
if not minv:contains_item("stock", shop_item.." "..old_count, true) then
|
||||||
can_exchange = false
|
can_exchange = false
|
||||||
mcl_title.set(sender, "subtitle", {text=S("Out of Stock!"), color="dark_red"})
|
core.chat_send_player(name, S("Out of Stock!"))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- do not trade air
|
-- do not trade air
|
||||||
|
Loading…
Reference in New Issue
Block a user