Originally coded by @Dark ShaoOz for Gesior AAC, I converted it to Znote AAC and improved it.
Should work with TFS 0.2 and 1.0, Znote AAC 1.4 and 1.5+
In-game talkaction
The list:
You can copy the /pos command and paste it in tibia client to teleport to location if you are GM.
Editing a list entry, OPTIONAL: Give them points for their help
Easily add and modify status types to fit your OT
Installation:
SQL:
PHP:
Create file admin_reports.php in www(Znote AAC files) directory
with this code:
https://raw.github.com/Znote/ZnoteAAC/master/admin_reports.php
Link to it from Admin Panel:
Add this to layout/widgets/Wadmin.php:
LUA talkaction
talkactions.xml:
Znote AAC 1.4 only (if you use 1.5+ ignore this step):
Add to engine/function/general.php
Enjoy.
Should work with TFS 0.2 and 1.0, Znote AAC 1.4 and 1.5+
In-game talkaction
The list:
You can copy the /pos command and paste it in tibia client to teleport to location if you are GM.
Editing a list entry, OPTIONAL: Give them points for their help
Easily add and modify status types to fit your OT
Installation:
SQL:
Code:
CREATE TABLE IF NOT EXISTS `znote_player_reports` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`posx` int(6) NOT NULL,
`posy` int(6) NOT NULL,
`posz` int(6) NOT NULL,
`report_description` VARCHAR(255) NOT NULL,
`date` INT(11) NOT NULL,
`status` TINYINT(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
PHP:
Create file admin_reports.php in www(Znote AAC files) directory
with this code:
https://raw.github.com/Znote/ZnoteAAC/master/admin_reports.php
Link to it from Admin Panel:
Add this to layout/widgets/Wadmin.php:
Code:
<li>
<a href='admin_reports.php'>Admin Reports</a>
</li>
talkactions.xml:
Code:
<talkaction words="!report" separator=" " script="adminreport.lua"/>
Lua:
-- Coded by Dark ShaoOz
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 `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 "..getPlayerStorageValue(cid, storage) - os.time().." seconds to report again.")
end
return TRUE
end
Znote AAC 1.4 only (if you use 1.5+ ignore this step):
Add to engine/function/general.php
Code:
function getClock($time = false, $format = false, $adjust = true) {
if ($time === false) $time = time();
// Date string representation
$date = "d F Y (H:i)"; // 15 July 2013 (13:50)
if ($adjust) $adjust = (1 * 3600); // Adjust to fit your timezone.
else $adjust = 0;
if ($format) return date($date, $time+$adjust);
else return $time+$adjust;
}
Last edited: