Ir para conteúdo

Featured Replies

Postado

@ceesar90 

Spoiler


local tempo = 900 -- Tempo para usar novamente 
local storage = 23585 -- storage pra verificar se o player já pode usar novamente

function onSay(cid, words, param, channel)
if(param == '') then
	doSendMsg(cid, "Relate o bug da seguinte forma: '!report Encontrei um bug'")
	return true
end

if exhaustion.check(cid, storage) then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Mensagem dizendo ao player que ele tem que esperar")
	return true
end

exhaustion.set(cid, storage, tempo)

local playerName, playerPos = getCreatureName(cid), getThingPos(cid)
local str = "Nome: " .. playerName .. "\nPosX: " .. playerPos.x ..", PosY: " .. playerPos.y .. ", PosZ: " .. playerPos.z .. "\nData: " .. os.date()

local file = io.open('data/reports/'.. playerName ..' Bug ' .. getAllReports(playerName) +1 .. '.txt', 'w')

str = str .. "\n\nBug: " .. param 

file:write(str)
file:close()
doSendMsg(cid, 'Bug reportado com sucesso.')
return true
end

function getAllReports(name)
local count = 0
for i = 1, 300 do
local file = io.open('data/reports/'.. name ..' Bug '.. i ..'.txt', 'r')
	if file ~= nil then 
		io.close(file) 
		count = count +1
	end
end
	return count
end

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

  • Respostas 6
  • Visualizações 510
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @ceesar90 talvez por causa de um problema existente no fórum, ao copiar algum texto, acaba vindo caracteres especiais ou alterando a do próprio texto:  

  • @ceesar90   

Postado
Em 27/09/2018 em 00:54, KotZletY disse:

@ceesar90 

  Ocultar conteúdo


local tempo = 900 -- Tempo para usar novamente 
local storage = 23585 -- storage pra verificar se o player já pode usar novamente

function onSay(cid, words, param, channel)
if(param == '') then
	doSendMsg(cid, "Relate o bug da seguinte forma: '!report Encontrei um bug'")
	return true
end

if exhaustion.check(cid, storage) then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Mensagem dizendo ao player que ele tem que esperar")
	return true
end

exhaustion.set(cid, storage, tempo)

local playerName, playerPos = getCreatureName(cid), getThingPos(cid)
local str = "Nome: " .. playerName .. "\nPosX: " .. playerPos.x ..", PosY: " .. playerPos.y .. ", PosZ: " .. playerPos.z .. "\nData: " .. os.date()

local file = io.open('data/reports/'.. playerName ..' Bug ' .. getAllReports(playerName) +1 .. '.txt', 'w')

str = str .. "\n\nBug: " .. param 

file:write(str)
file:close()
doSendMsg(cid, 'Bug reportado com sucesso.')
return true
end

function getAllReports(name)
local count = 0
for i = 1, 300 do
local file = io.open('data/reports/'.. name ..' Bug '.. i ..'.txt', 'r')
	if file ~= nil then 
		io.close(file) 
		count = count +1
	end
end
	return count
end

 

 

 

Funcionando, obrigado !

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo