mirror of
https://gitlab.com/lunovox/minertrade.git
synced 2025-03-21 16:01:22 +00:00
CORREÇÃO DE BUG
* O comando '/checkstrongbox' estava bugando o servidor.
This commit is contained in:
parent
0de37b28dc
commit
3573720c1d
1 changed files with 30 additions and 20 deletions
50
commands.lua
50
commands.lua
|
@ -3,34 +3,42 @@ minetest.register_privilege("checkstrongbox", {
|
||||||
give_to_singleplayer=false,
|
give_to_singleplayer=false,
|
||||||
})
|
})
|
||||||
|
|
||||||
modMinerTrade.propCheckStrongBox = function(playername, param)
|
modMinerTrade.propCheckStrongBox = function(admname, param)
|
||||||
return {
|
return {
|
||||||
params = "<PlayerName>",
|
params = "<PlayerName>",
|
||||||
description = modMinerTrade.translate("Lets you check the contents of another players strongbox."),
|
description = modMinerTrade.translate("Lets you check the contents of another players strongbox."),
|
||||||
func = function(playername, param)
|
func = function(admname, param)
|
||||||
if minetest.get_player_privs(playername).checkstrongbox then
|
local player = minetest.get_player_by_name(admname)
|
||||||
local targetname = string.match(param, "^([^ ]+)$")
|
if type(player)~="nil" and player:is_player() then --checha se o player que digitou o comando ainda esta online!
|
||||||
if type(targetname)=="string" and targetname~="" then
|
if minetest.get_player_privs(admname).checkstrongbox then
|
||||||
if modMinerTrade.safe and modMinerTrade.safe[targetname] then
|
local targetname = string.match(param, "^([^ ]+)$")
|
||||||
|
if type(targetname)=="string" and targetname~="" then
|
||||||
local inv = modMinerTrade.getDetachedInventory(targetname)
|
if modMinerTrade.safe and modMinerTrade.safe[targetname] then
|
||||||
minetest.show_formspec(
|
modMinerTrade.showInventory(player, targetname,
|
||||||
playername,
|
modMinerTrade.translate("INVENTORY OF '%s':"):format(targetname)
|
||||||
"safe_"..targetname,
|
)
|
||||||
modMinerTrade.getFormspec(targetname)
|
return true
|
||||||
)
|
else
|
||||||
return true
|
minetest.chat_send_player(admname,
|
||||||
|
core.colorize("#ff0000","[MINERTRADE:ERRO] ")
|
||||||
|
..modMinerTrade.translate("The strongbox of %s was not created yet!"):format(dump(targetname))
|
||||||
|
)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(playername, "[MINERTRADE:ERRO] "..modMinerTrade.translate("The strongbox of %s was not created yet!"):format(dump(targetname)))
|
minetest.chat_send_player(admname,
|
||||||
end
|
core.colorize("#ff0000","[MINERTRADE:ERRO] ")
|
||||||
|
.." /"..modMinerTrade.translate("checkstrongbox").." <PlayerName> | "..modMinerTrade.translate("Lets you check the contents of another players strongbox.")
|
||||||
|
)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(playername, "[MINERTRADE:ERRO] /"..modMinerTrade.translate("checkstrongbox").." <PlayerName> | "..modMinerTrade.translate("Lets you check the contents of another players strongbox."))
|
minetest.chat_send_player(admname,
|
||||||
|
core.colorize("#ff0000","[MINERTRADE:ERRO] ")
|
||||||
|
..modMinerTrade.translate("You do not have permission to run this command without the privileges 'checkstrongbox'!")
|
||||||
|
)
|
||||||
end
|
end
|
||||||
else
|
|
||||||
minetest.chat_send_player(playername, "[MINERTRADE:ERRO] "..modMinerTrade.translate("You do not have permission to run this command without the privileges 'checkstrongbox'!"))
|
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end,
|
end, --FIM DE: func = function(admname, param)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -39,6 +47,7 @@ minetest.register_chatcommand("csb", modMinerTrade.propCheckStrongBox())
|
||||||
|
|
||||||
--###############################################################################################################
|
--###############################################################################################################
|
||||||
|
|
||||||
|
--[[
|
||||||
minetest.register_chatcommand("minertrade", {
|
minetest.register_chatcommand("minertrade", {
|
||||||
params = "",
|
params = "",
|
||||||
description = "Exibe informações adicionais deste mod.",
|
description = "Exibe informações adicionais deste mod.",
|
||||||
|
@ -80,3 +89,4 @@ minetest.register_chatcommand("minertrade", {
|
||||||
minetest.chat_send_player(name, name..", precione F10 e use a rolagem do mouse para ler todo este tutorial!!!", false)
|
minetest.chat_send_player(name, name..", precione F10 e use a rolagem do mouse para ler todo este tutorial!!!", false)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
--]]
|
||||||
|
|
Loading…
Add table
Reference in a new issue