Postado Setembro 27, 2018 6 anos @ceesar90 Mostrar conteúdo oculto 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
Postado Setembro 30, 2018 6 anos Em 27/09/2018 em 03:54, KotZletY disse: @ceesar90 Mostrar conteúdo oculto Mostrar conteúdo oculto 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.