function onSay(player, words, param)
local split = param:split(",")
if split[1] == nil then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "[MasterTreino]: Os comandos disponiveis sao:\n !master tempo\n !master on \n!master off (NAO UTILIZAR O COMANDO ON E OFF POR ENQUANTO)")
return
end
if split[1] == 'tempo' then
if player:getStorageValue(15732) >= os.time() then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Tempo Restante: " .. showTimeLeft(player:getStorageValue(15732) - os.time(), true) .. ".")
return
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Nao existe nenhum master treino ativo, compre seu master treino no NPC GM na cidade VIP ou na STORE.")
return
end
elseif split[1] == 'on' then
if player:getStorageValue(15742) > 0 then
local tempoSobra = player:getStorageValue(15742)
player:setStorageValue(15732, os.time() + tempoSobra)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "O seu master treino foi ativado.")
return
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Nao existe nenhum master treino ativo, compre seu master treino no NPC GM na cidade VIP ou na STORE.")
return
end
elseif split[1] == 'off' then
if player:getStorageValue(15732) >= os.time() then
player:setStorageValue(15742, player:getStorageValue(15732))
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "O seu master treino foi pausado.")
player:setStorageValue(15732, 1)
return
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Nao existe nenhum master treino ativo, compre seu master treino no NPC GM na cidade VIP ou na STORE.")
return
end
end
--15742
return true
end