Adição de variaveis e traduções
parent
c589863ba3
commit
6f829b4af1
24
autogen.lua
24
autogen.lua
|
@ -10,15 +10,17 @@
|
|||
]]
|
||||
|
||||
-- Certifica de que jogador tem um balao, caso ainda não tenha cria um
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
if not player then return end
|
||||
|
||||
-- Pegar nome do jogador
|
||||
local name = player:get_player_name()
|
||||
|
||||
-- Verifica se o registro de balao existe no banco de dados
|
||||
if telepro.bd.verif("jogador_"..name, "pos") == false then
|
||||
telepro.gerar_balao_aleatorio(name)
|
||||
end
|
||||
end)
|
||||
if telepro.var.autogen == true then
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
if not player then return end
|
||||
|
||||
-- Pegar nome do jogador
|
||||
local name = player:get_player_name()
|
||||
|
||||
-- Verifica se o registro de balao existe no banco de dados
|
||||
if telepro.bd.verif("jogador_"..name, "pos") == false then
|
||||
telepro.gerar_balao_aleatorio(name)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ minetest.register_node("telepro:balao_jogador", {
|
|||
-- Verifica se tem bau ativo
|
||||
minetest.register_abm{
|
||||
nodenames = {"telepro:balao_jogador"},
|
||||
interval = 4,
|
||||
interval = telepro.var.tempo_verificar_balao,
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
|
||||
|
|
2
bau.lua
2
bau.lua
|
@ -58,7 +58,7 @@ minetest.register_node("telepro:bau", {
|
|||
-- Atualização constante do balão
|
||||
minetest.register_abm{
|
||||
nodenames = {"telepro:bau"},
|
||||
interval = 5,
|
||||
interval = telepro.var.tempo_verificar_balao,
|
||||
chance = 1,
|
||||
action = function(pos)
|
||||
|
||||
|
|
|
@ -74,8 +74,10 @@ local finalizar = function(name, spos)
|
|||
player:setpos({x=pb.x, y=pb.y+1.5, z=pb.z})
|
||||
|
||||
-- Travar por 24 horas para impedir ficar gerando em vaios locais
|
||||
telepro.travados[name] = true
|
||||
minetest.after(3600, telepro.destravar, name)
|
||||
if telepro.var.limite_diario == true then
|
||||
telepro.travados[name] = true
|
||||
minetest.after(3600, telepro.destravar, name)
|
||||
end
|
||||
|
||||
-- Finaliza
|
||||
minetest.chat_send_player(name, S("Novo local encontrado"))
|
||||
|
|
15
init.lua
15
init.lua
|
@ -32,6 +32,21 @@ if telepro.bd.verif("centro", "pos") == true then
|
|||
telepro.spawn = telepro.bd.pegar("centro", "pos")
|
||||
end
|
||||
|
||||
-- Variaveis personalizaveis
|
||||
telepro.var = {}
|
||||
|
||||
-- Auto geração de balão em jogadores novos
|
||||
telepro.var.autogen = true
|
||||
if minetest.settings:get("telepro_autogen") == "false" then telepro.var.autogen = false end
|
||||
|
||||
-- Limitação de uma geração automatica por dia
|
||||
telepro.var.limite_diario = true
|
||||
if minetest.settings:get("telepro_daily_limit") == "false" then telepro.var.limite_diario = false end
|
||||
|
||||
-- Tempo de verificação do balao proprio
|
||||
telepro.var.tempo_verificar_balao = tonumber(minetest.setting_get("telepro_time_check_balloon") or 15)
|
||||
if telepro.var.tempo_verificar_balao < 5 then telepro.var.tempo_verificar_balao = 5 end
|
||||
|
||||
-- Funções
|
||||
dofile(modpath.."/tradutor.lua")
|
||||
dofile(modpath.."/mensagens.lua")
|
||||
|
|
|
@ -45,6 +45,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
|
||||
minetest.chat_send_player(player:get_player_name(), S(telepro.msg.aguardar_gerar_balao))
|
||||
telepro.gerar_balao_aleatorio(name)
|
||||
|
||||
elseif fields.por_balao_aqui then
|
||||
if telepro.travados[name] == true then
|
||||
minetest.chat_send_player(name, S(telepro.msg.limite_de_usos_por_dia))
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
# Configurações aplicaveis para o menu gráfico
|
||||
|
||||
#Gera automaticamente um balao proprio para jogadores
|
||||
#que ainda nunca geraram
|
||||
#Automatically generates a balloon for players who
|
||||
#have never yet generated it
|
||||
telepro_autogen (Autogerar Balao proprio) bool true
|
||||
|
||||
#Limita a geração de balões proprios em lugares aleatorios do mapa
|
||||
#Limite de 1 a cada 24 horas
|
||||
#Limits the generation of own balloons in random places on the map
|
||||
#Limit of 24 hours for a new generation
|
||||
telepro_daily_limit (Limite diario para gerar) bool true
|
||||
|
||||
#Tempo entre cada vez que o balão do jogador é verificado
|
||||
#Time step which balloon is verified
|
||||
telepro_time_check_balloon (Tempo do iterador de checagem do balao) int 15 5
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue