i make the same script (not the same code, it just do the same thing) in 2006, it's a very old script, you don't need to write credits to anyone.
bb
i make the same script (not the same code, it just do the same thing) in 2006, it's a very old script, you don't need to write credits to anyone.
bb
Does anyone have this fixed for 0.3.6
(...)
local getVoc = getPlayerVocationName(cid)
local position = getCreaturePosition(cid)
function onSay(cid, words, param, channel)
if getPlayerLevel(cid) < level then
doPlayerSendTextMessage(cid,20,"Report Manager:")
doPlayerSendTextMessage(cid,18,"You need to be at least level "..level.." to send a report.")
(...)
(...)
function onSay(cid, words, param, channel)
local getVoc = getPlayerVocationName(cid)
local position = getCreaturePosition(cid)
if getPlayerLevel(cid) < level then
doPlayerSendTextMessage(cid,20,"Report Manager:")
doPlayerSendTextMessage(cid,18,"You need to be at least level "..level.." to send a report.")
(...)
local storage = 15245 --exhaust storage
local ex = 120 --exhaust time (seconds)
local log = 'data/logs/reports.xml' --file where reports will be saved
local head = '<report player="%s" date=%q description=%q>' --template for xml file
local minChars = 5
function onSay(cid, words, param, channel)
if(param == '' or param == nil) then
return doPlayerSendCancel(cid, 'Command requires param.')
end
if string.len(param) < minChars then
return doPlayerSendCancel(cid, 'Text is too short, should be longer than ' .. minChars .. ' characters.')
end
if not exhaustion.get(cid, storage) then
local f = io.open(log, 'a+')
if f ~= nil then
f:write(string.format(head, getPlayerName(cid), os.date(), param) .. '\n')
f:close()
end
exhaustion.set(cid, storage, ex)
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Thanks for the report.')
else
return doPlayerSendCancel(cid, 'You need to wait ' .. (exhaustion.get(cid, storage) or 0) .. ' seconds to write another report.')
end
return true
end