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)
------------------------------------------------------------------------------------------------------------
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:
Now Open your Data/Talkactions/Scripts in your server and create a new LUA File called adminreport and add this code inside:
Gesior 2012:
Now go to your website folder, open htdocs/pages and create a new php file called adminreport.php and copy this inside:
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:
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:
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:
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)
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 ;
------------------------------------------------------------------------------------------------------------
Then just click on GO or OK, and thats everything...
ENJOY IT!
I hope you Like my post
100% Made by Dark Shaooz (me)