mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-18 20:13:26 +02:00
TFS 0.2 and 1.0 report bug system
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
This commit is contained in:
20
LUA/TFS_10/talkaction report system/adminreport.lua
Normal file
20
LUA/TFS_10/talkaction report system/adminreport.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
-- <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
|
Reference in New Issue
Block a user