[GESIOR ACC] Report-BUG System (Advanced)

Was this script usefull?

  • Yes

    Votes: 23 95.8%
  • No

    Votes: 1 4.2%

  • Total voters
    24

Dark ShaoOz

Member
Joined
Apr 19, 2009
Messages
80
Best answers
0
Reaction score
0
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)

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

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


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

------------------------------------------------------------------------------------------------------------


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:


------------------------------------------------------------------------------------------------------------
It will open a window like this:
------------------------------------------------------------------------------------------------------------


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:


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

I hope you Like my post :)
100% Made by Dark Shaooz (me)
 

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,536
Best answers
172
Reaction score
1,240
Location
Norway, Oslo
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:

TheMask

World of Comodato Owner
Joined
May 28, 2007
Messages
80
Best answers
0
Reaction score
0
Location
Brasil
have possible to use it with ctrl+z report? can someone help me with that?
 

HappyFeet

Premium User
Premium User
Joined
Nov 8, 2012
Messages
243
Best answers
0
Reaction score
2
Location
Netherlands
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
 

1268995

Intermediate OT User
Joined
Sep 9, 2010
Messages
423
Best answers
0
Reaction score
13
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.
 
OP
Dark ShaoOz

Dark ShaoOz

Member
Joined
Apr 19, 2009
Messages
80
Best answers
0
Reaction score
0
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
 

raf

Intermediate OT User
Joined
Jan 10, 2011
Messages
260
Best answers
0
Reaction score
36
Location
Warsaw, PL
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
No, something is wrong with you script (php side).
 

eduwx

New Member
Joined
Feb 7, 2010
Messages
11
Best answers
0
Reaction score
0
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
 

AlexUsed

DustOt
Joined
Jan 29, 2011
Messages
3
Best answers
0
Reaction score
0
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.
 

persson2

Member
Joined
Apr 7, 2014
Messages
60
Best answers
0
Reaction score
1
Location
Sweden
so, i installed this and its working but how do i check all the reports?
 

justikar

Intermediate OT User
Joined
Oct 28, 2013
Messages
142
Best answers
0
Reaction score
26
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
Change db.Query for db.executeQuery on talkaction.
 
Top