Update to admin reports: Reports are categorised by status id. You can hide/show categories by clicking the table header. You can configure which statusIds you want to auto-hide.

This commit is contained in:
Stefan Brannfjell
2014-03-11 01:41:31 +01:00
parent dfce8d97dd
commit 42db697f50
2 changed files with 88 additions and 31 deletions

View File

@@ -1,4 +1,5 @@
-- <talkaction words="!report" separator=" " script="adminreport.lua"/>
-- Coded by Dark ShaoOz, modified by Znote
function onSay(cid, words, param, channel)
local storage = 6708 -- (You can change the storage if its already in use)
local delaytime = 30 -- (Exhaust In Seconds.)
@@ -11,10 +12,10 @@ function onSay(cid, words, param, channel)
end
if (getPlayerStorageValue(cid, storage) <= os.time()) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")
db.query("INSERT INTO `player_reports` (`id` ,`name` ,`posx` ,`posy` ,`posz` ,`report_description` ,`date`)VALUES (NULL , '" .. getPlayerName(cid) .. "', '" .. x .. "', '" .. y .. "', '" .. z .. "', '" .. string.gsub(param, "'", "\\'") .. "', '" .. os.time() .. "')")
db.query("INSERT INTO `znote_player_reports` (`id` ,`name` ,`posx` ,`posy` ,`posz` ,`report_description` ,`date`)VALUES (NULL , '" .. getPlayerName(cid) .. "', '" .. x .. "', '" .. y .. "', '" .. z .. "', " .. db.escapeString(param) .. ", '" .. os.time() .. "')")
setPlayerStorageValue(cid,storage,os.time()+delaytime)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have to wait 30 seconds to report again.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have to wait "..getPlayerStorageValue(cid, storage) - os.time().." seconds to report again.")
end
return TRUE
end