Ir para conteúdo

[GESIOR] Report BUG Real Position


Mudrock

Posts Recomendados

Fala pessoal, estava negando na gringa e achei um sistema bem legal e decidi trazer totalmente em português para vocês


espero que curtam



Descriação

7HSLPUH.png


O Player reporta o lugar usando o comando !report e você administrador


pode adicionar points a ele pela ajuda ao servidor




Imagen


7HSLPUH.png



4pt6w9.png 9zvfph.png



2mme5mr.png



opydd4.png





2z3ta8y.png



Adicionando em seu servidor/Site



7HSLPUH.png




Abra seu Data/Talkactions na pasta do seu servidor, e abra Talkactions.xml e adicione essa linha



<talkaction words="!report" separator=" " script="adminreport.lua"/>

Agora abra data/ Talkactions / Scripts em seu servidor e criar um novo arquivo chamado adminreport.lua e adicione este código dentro :



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

Servidor Configurado!




Adicionando em seu WebSite



7HSLPUH.png



Agora vá para o site e va em htdocs/pages crie um novo arquivo chamado adminreport.php e coloque isso dentro



<?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.';
}
?>

então aberta index.php e adicione estas linhas



7HSLPUH.png



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

Vá em htdocs/layouts/Seulayout/



7HSLPUH.png



<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>

Adicione esse comando em sua database



7HSLPUH.png



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 ;


Créditos : Mudrock
DarkZ Shaoz

Editado por MudrocK
Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
×
×
  • Criar Novo...