Ir para conteúdo
  • 0

Acrescentar Umas Coisas No Report Aqui


Diley007

Pergunta

queria que quando o player reportace aparecece so o report dele

 

exemplo de como aparece:

Diley reported a bug at 03 June 2012 - 19:05:09.

bug na casa.

 

mais queria so o report assim:

bug na casa.

 

outra coisa queria que removesse um determinado item quando reportace

e arrumar o delaytime que nao ta funfando, ta 120 segundos mas o player ta reportando toda hora que quer

 

ta aqui o script do report, REP+ amanha pra quem ajudar

 

function onSay(cid, words, param, channel)

local storage = 6707

local delaytime = 120

local a = "data/logs/reports.txt"

local f = io.open(a, "a+")

if(param == '') then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")

return true

end

local exhaust = exhaustion.get(cid, storage)

if(not exhaust) then

exhaustion.set(cid, storage, delaytime)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")

f:write(""..getPlayerName(cid).." reported a bug at " .. os.date("%d %B %Y - %X.", os.time()) .."\n"..param.." [x=..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z..].\n\n----------------------------------------------------------\n")

f:close()

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait " .. exhaustion.get(cid, storage) .. " seconds to report.")

end

return TRUE

end

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

  • 0

function onSay(cid, words, param, channel)
local storage = 6707
local delaytime = 120
local item = {itemid = 2160, count = 1}
local a = "data/logs/reports.txt"
local f = io.open(a, "a+")
if(param == '') then
	return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
end

if not doPlayerRemoveItem(cid, item.itemid, item.count) then
	return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need ".. item.count .." ".. getItemNameById(item.itemid) ..".")
end

local exhaust = exhaustion.get(cid, storage)
if(not exhaust) then
	exhaustion.set(cid, storage, delaytime)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")
	f:write(""..param.." [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."].\n\n----------------------------------------------------------\n")
	f:close()
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait " .. exhaustion.get(cid, storage) .. " seconds to report.")
end
return TRUE
end 

 

Abraços.

Link para o comentário
Compartilhar em outros sites

  • 0

function onSay(cid, words, param, channel)
local storage = 6707
local delaytime = 120
local item = {itemid = 2160, count = 1}
local a = "data/logs/reports.txt"
local f = io.open(a, "a+")
if(param == '') then
	return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
end

if not doPlayerRemoveItem(cid, item.itemid, item.count) then
	return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need ".. item.count .." ".. getItemNameById(item.itemid) ..".")
end

local exhaust = exhaustion.get(cid, storage)
if(not exhaust) then
	exhaustion.set(cid, storage, delaytime)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")
	f:write(""..param.." [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."].\n\n----------------------------------------------------------\n")
	f:close()
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait " .. exhaustion.get(cid, storage) .. " seconds to report.")
end
return TRUE
end

 

Abraços.

quase perfeito mais o delaytime n ta funfando, to conseguindo reportar toda hora

Link para o comentário
Compartilhar em outros sites

  • 0

Certo, então isso é erro da biblioteca exhaustion do seu servidor. Vou fazer uma pequena "gambiarra".

 

function onSay(cid, words, param, channel)
       local storage = 6707
       local delaytime = 120
       local item = {itemid = 2160, count = 1}
       local a = "data/logs/reports.txt"
       local f = io.open(a, "a+")
       if(param == '') then
               return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
       end

       if not doPlayerRemoveItem(cid, item.itemid, item.count) then
               return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need ".. item.count .." ".. getItemNameById(item.itemid) ..".")
       end

       local exhaust = getPlayerStorageValue(cid, storage)
       if exhaust < os.time() then
               setPlayerStorageValue(cid, storage, os.time()+delaytime)
               doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")
               f:write(""..param.." [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."].\n\n----------------------------------------------------------\n")
               f:close()
       else
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait " .. getPlayerStorageValue(cid, storage) - os.time() .. " seconds to report.")
       end
       return TRUE
end

Editado por Oneshot
Link para o comentário
Compartilhar em outros sites

  • 0

Certo, então isso é erro da biblioteca exhaustion do seu servidor. Vou fazer uma pequena "gambiarra".

 

function onSay(cid, words, param, channel)
	local storage = 6707
	local delaytime = 120
	local item = {itemid = 2160, count = 1}
	local a = "data/logs/reports.txt"
	local f = io.open(a, "a+")
	if(param == '') then
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	end

	if not doPlayerRemoveItem(cid, item.itemid, item.count) then
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need ".. item.count .." ".. getItemNameById(item.itemid) ..".")
	end

	local exhaust = getPlayerStorageValue(cid, storage)
	if exhaust < os.time() then
			setPlayerStorageValue(cid, storage, os.time()+delaytime)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")
			f:write(""..param.." [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."].\n\n----------------------------------------------------------\n")
			f:close()
	else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait " .. getPlayerStorageValue(cid, storage) - os.time() .. " seconds to report.")
	end
	return TRUE
end

aee veio agora deu, po to te devendo 2 REP ja xD
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...