• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[GESIOR ACC] Report-BUG System (Advanced)

Was this script usefull?

  • Yes

    Votes: 24 88.9%
  • No

    Votes: 3 11.1%

  • Total voters
    27

Dark ShaoOz

Member
Joined
Apr 19, 2009
Messages
80
Reaction score
5
I made this script for those who it's usefull... (Only for MYSQL)

Images:
Command: !report TEXT / It has a 30 seconds exhaust. (I make it easy to edit)
4pt6w9.png
9zvfph.png

------------------------------------------------------------------------------------------------------------
How it looks in the website: (You can only see the page if you are logged on a Admin Account)
------------------------------------------------------------------------------------------------------------
2mme5mr.png

------------------------------------------------------------------------------------------------------------
Using the Reward Players for Reporting Link:
------------------------------------------------------------------------------------------------------------

opydd4.png

------------------------------------------------------------------------------------------------------------
Confirmation:

------------------------------------------------------------------------------------------------------------
2z3ta8y.png


How to add it to your website/server:
Open your Data/Talkactions in your otserver, and open Talkactions.xml and add this line:
Code:
<talkaction words="!report" separator=" " script="adminreport.lua"/>

Now Open your Data/Talkactions/Scripts in your server and create a new LUA File called adminreport and add this code inside:
Code:
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 .. "',  '" .. param .. "',  '" .. os.date() .. "')")
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

Gesior 2012:
Now go to your website folder, open htdocs/pages and create a new php file called adminreport.php and copy this inside:
Code:
<?PHP
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
    $main_content .= '<center><h2><font color=red>Reports List</font></h2></center><br /><br />
<center><table border="0" cellspacing="1" cellpadding="4" width="100%">
    <tr bgcolor="'.$config['site']['vdarkborder'].'">
        <td width="5%"><b><font color=white><center>#</font></center></b></td>
        <td width="10%"><b><font color=white><center>Name</center></b></font></td>
        <td width="20%"><b><font color=white><center>Position</center></b></font></td>
        <td width="40%"><b><font color=white><center>Description</center></b></font></td>
        <td width="20%"><b><font color=white><center>Date</center></b></font></td>
    </tr>';
$i = 0;
foreach($SQL->query('SELECT id, name, posx, posy, posz, report_description, date FROM player_reports GROUP BY name ORDER BY id DESC limit 20;') as $report)
{
    $i++;
    $main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']). '">
        <td>           
            <center>'.$i.'</center>
        </td>
        <td>           
            <center><a href=?subtopic=characters&name='.$report['name'].'>'.$report['name'].'</a></center>
        </td>
        <td>
            <center>'.$report['posx'].', '.$report['posy'].', '.$report['posz'].'</center>
        </td>
        <td>
            <center>'.$report['report_description'].'</center>
        </td>
        <td>
            <center>'.$report['date'].'</center>
        </td>
    </tr>';
}
$main_content .='
</table>
    <a href="?subtopic=adminreport&action=reward">Reward Players for reporting.</a>';
if($action == "reward") {
        $player = stripslashes(ucwords(strtolower(trim($_REQUEST['character']))));
        $points = $_POST['points'];
        if(empty($player)) {
            $main_content .= '<form action="" method="post"><B>Enter Character Name:</B><input type="textbox" name="character"><br>
                <B>Enter Points Amount:</B><input type="textbox" name="points"><br><br><input type="submit" value="Submit">
                </form></center><form action="?subtopic=adminreport" method="post" ><input name="submit" type="submit" value="Close" title="Close"/></form>';
        } else {
            $player_data = $SQL->query("SELECT * FROM `players` WHERE `name` = '".$player."';")->fetch();
            $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` + '".$points."' WHERE `id` = '".$player_data['account_id']."'");
            $main_content .= '<b><center>'.$points.' Premium Points added to the account of <i>'.$player.'</i> !</b></center><br>
                <form action="?subtopic=adminreport" method="post" ><input name="submit" type="submit" value="Close" title="Close"/></form>';
        }
    }
} else {
    $main_content .= 'Sorry, you have not the rights to access this page.';
}
?>

If you are not using Gesior 2012:
Create a new file inside htdocs folder called adminreport.php, and copy the code above in it, then open index.php and add this lines:

Code:
case "adminreport";
                $topic = "adminreport";
                $subtopic = "adminreport";
                include("adminreport.php");
        break;

If you want to see the Admin Report page in your left panel section in your website, then go to htdocs/layouts/yourlayout/ then open your layout.php and add this lines:
Code:
<a href='?subtopic=adminreport'>
  <div id='submenu_adminreport' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>
    <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
    <div id='ActiveSubmenuItemIcon_adminreport' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>
    <div class='SubmenuitemLabel'>Player Reports</div>
    <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>
  </div>
</a>

And the most Important... Log into your Database in: http://127.0.0.1/phpmyadmin/...
Then open your database and click on SQL on the top menu:

1z2pnj7.png

------------------------------------------------------------------------------------------------------------
It will open a window like this:
------------------------------------------------------------------------------------------------------------
25oxs79.png


Add this lines there:
Code:
CREATE TABLE IF NOT EXISTS `player_reports` (

  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` text NOT NULL,
  `posx` int(6) NOT NULL,
  `posy` int(6) NOT NULL,
  `posz` int(6) NOT NULL,
  `report_description` text NOT NULL,
  `date` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
It will Look like this:

10xzxj4.png

------------------------------------------------------------------------------------------------------------
Then just click on GO or OK, and thats everything...
ENJOY IT!

I hope you Like my post :)
100% Made by Dark Shaooz (me)
 
Looks very good, I'll make it compatible with Znote AAC as well. :)

Edit: Done. Ended up adding some alternations so added it to a separate thread:
[Znote AAC] Report bug system
 
Last edited:
have possible to use it with ctrl+z report? can someone help me with that?
 
when I type !report I get the Command param required. report so that works but when I say !report blabla, it will not doing anything
 
It does not send message everytime.

If i send message with a char , i cant send it again... I mean, i can send, appear that i sent sucesfully, but the message do not appear on website.
 
It does not send message everytime.

If i send message with a char , i cant send it again... I mean, i can send, appear that i sent sucesfully, but the message do not appear on website.
Maybe its the connection with the ot-database, a missing row/table, wrong name or something.. And the command has exhaust so players can't spam
 
i find a problem,someone can help me?
when a player make more than one report,just the first appears on the web site,the report save on table on php my admin but on site show just the first report of the player
please help me
thanks
 
i find a problem,someone can help me?
when a player make more than one report,just the first appears on the web site,the report save on table on php my admin but on site show just the first report of the player
please help me
thanks

Im having the same issue here! everything else seems fine! But on the website it will only show you one report from that player.
There is no option to delete a report or clear the list. Maybe thats an improvement idea.
 
When i send message
22:16 Your report has been received successfully!
i can spam this command but do nothing.
on web i cant see report
 

Attachments

Back
Top