fiquei em duvida entre pedidos de script e npc... se essa nao for a area pesso desculpas e movam por favor...
esse e o script de report, bom eu quero fazer um npc de reports, onde o player fala "hi" e depois escreve o report, e esse report va para data/logs/reports.txt (como mostrado em vermelho) REP+ pra quem ajudar
OBS: a intençao nao e fazer um npc de reports mais usar o sistema de reports, so que preciso do npc
data/talkactions/script
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
data/talkactions
<talkaction log="yes" words="/player report" filter="word-spaced" event="script" value="playereport.lua"/>