mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-05-24 06:34:28 +02:00

Players can say !report SomeMessageHere to send a report to database, it will automatically fetch position of player etc. You can check reports in admin panel and change status of them, and optionally reward player with points if you feel they deserve it for reporting the bug. Default working TFS 1.0 scripts for shop and firstitems
20 lines
1.1 KiB
Lua
20 lines
1.1 KiB
Lua
-- <talkaction words="!report" separator=" " script="adminreport.lua"/>
|
|
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.)
|
|
local x = getPlayerPosition(cid).x -- (Do not edit this.)
|
|
local y = getPlayerPosition(cid).y -- (Do not edit this.)
|
|
local z = getPlayerPosition(cid).z -- (Do not edit this.)
|
|
if(param == '') then
|
|
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command param required.")
|
|
return true
|
|
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() .. "')")
|
|
setPlayerStorageValue(cid,storage,os.time()+delaytime)
|
|
else
|
|
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have to wait 30 seconds to report again.")
|
|
end
|
|
return TRUE
|
|
end |