Hey guys,
Its me again, Well a friend of mine (Him.) Made an RP server, and he had an page for wanted users that was buggy, and didnt fully work, and i said want me to make a new one? so its not like the top stats, and it goes by if they're wanted!
So he said sure, but i'm also going to release this to you ragezoners!
Right the commands work in away to send messages to cops on who has been added and has been removed! Also, the new arrest command is there to remove the users wanted status! -EDIT- It now says who added them to the list!
NEW: ADDED COMMANDS!!
Right,
SQL:
Goto the users table, add a new collum called "wanted" (with no quotation marks) with the values, init 1 default 0!
C# (COMMANDS)
:addwanted username command!
PHP Code:
#region :addwanted <user>
case "addwanted":
{
virtualUser User = userManager.getUser(args[1]);
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
int isworking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'");
if (isworking == 1)
{
{
int me_secure_id = dbClient.getInt("SELECT secure_id FROM users WHERE name = '" + _Username + "'");
int canarrest = dbClient.getInt("SELECT arrest FROM jobs_ranks WHERE id = '" + me_secure_id + "'");
if (canarrest == 1)
{
Room.sendSaying(roomUser, "*Adds " + User._Username + ", to the wanted list!*");
dbClient.runQuery("UPDATE users SET wanted = '1' WHERE name = '" + User._Username + "'");
userManager.sendToCop(1, false, "BK" + "" + User._Username + " has been added to the wanted list by " + _Username + "!");
}
}
}
}
break;
}
#endregion
:removewanted username command
PHP Code:
#region :removewanted <user>
case "removewanted":
{
virtualUser User = userManager.getUser(args[1]);
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
int isworking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'");
if (isworking == 1)
{
{
int me_secure_id = dbClient.getInt("SELECT secure_id FROM users WHERE name = '" + _Username + "'");
int canarrest = dbClient.getInt("SELECT arrest FROM jobs_ranks WHERE id = '" + me_secure_id + "'");
if (canarrest == 1)
{
Room.sendSaying(roomUser, "*Removes " + User._Username + ", from the wanted list!*");
dbClient.runQuery("UPDATE users SET wanted = '0' WHERE name = '" + User._Username + "'");
userManager.sendToCop(1, false, "BK" + "" + User._Username + " has been removed from the wanted list by " + _Username + "!");
}
}
}
}
break;
}
#endregion
:arrest user time command
this file was edited to remove their wanted stats when arrested!
PHP Code:
#region :arrest <user> <time>
case "arrest":
{
virtualUser User = userManager.getUser(args[1]);
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
int isworking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'");
if (isworking == 1)
{
{
int me_secure_id = dbClient.getInt("SELECT secure_id FROM users WHERE name = '" + _Username + "'");
int canarrest = dbClient.getInt("SELECT arrest FROM jobs_ranks WHERE id = '" + me_secure_id + "'");
if (User._roomID == _roomID && (roomUser.Y == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y + 1 == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X))
{
if (canarrest == 1)
{
if (User.roomUser.walkLock == false)
{
Room.sendSaying(roomUser, "*attempts to arrest " + User._Username + ", but notices that he is not cuffed*");
}
else
{
int time = int.Parse(args[2]);
if (time > 60 || time < 1)
{
sendData("BK" + "What exactly are you trying to do?");
}
else
{
dbClient.runQuery("UPDATE users SET arrested = '1', wanted = '0' arrests = arrests + '1', time_jail = '" + args[2] + "' WHERE name = '" + User._Username + "'");
int fine = time * 5;
dbClient.runQuery("UPDATE users SET credits = credits - '" + fine + "' WHERE name = '" + User._Username + "'");
refreshValueables(true, false);
Room.sendSaying(roomUser, "*arrests " + User._Username + " for " + time + " minutes, and fines them " + fine + " credits*");
User.sendData("D^" + "H" + Encoding.encodeVL64(112));
User.sendData("BK" + "You have been arrested by " + _Username + ", and fined " + fine + " credits!");
ThreadStart jailStarter = new ThreadStart(User.jailTime);
User.jailLooper = new Thread(jailStarter);
User.jailLooper.Priority = ThreadPriority.Lowest;
User.jailLooper.Start();
}
}
}
}
}
}
}
break;
}
#endregion
PHP:
PHP Code:
<?php
/*================================================================+\
|| # PHPRetro - An extendable virtual hotel site and management
|+==================================================================
|| # Copyright (C) 2009 Yifan Lu. All rights reserved.
|| # http://www.yifanlu.com
|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|| # All images, scripts, and layouts
|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.
|+==================================================================
|| # PHPRetro is provided "as is" and comes without
|| # warrenty of any kind. PHPRetro is free software!
|| # License: GNU Public License 3.0
|| # http://opensource.org/licenses/gpl-license.php
\+================================================================*/
$page['allow_guests'] = true;
require_once('./includes/core.php');
require_once('./includes/session.php');
$data = new community_sql;
$lang->addLocale("community.community");
$page['id'] = "wantedusers";
$page['name'] = "Wanted users";
$page['bodyid'] = "home";
$page['cat'] = "community";
require_once('./templates/community_header.php');
?>
<div id="container">
<div id="content" style="position: relative" class="clearfix">
<div id="column1" class="column">
<div class="habblet-container ">
<div class="cbb clearfix green ">
<h2 class="title">Wanted Users!</h2>
<div id="notfound-content" class="box-content">
<table width="100%">
Below you will see who has been noted as wanted which means they basically need to be arrested!<br /><br />
<?php
$sql = "SELECT name,wanted,figure,sex,id FROM users WHERE wanted = 1 ORDER BY name DESC";
$result = mysql_query($sql) OR die(mysql_error());
if(mysql_num_rows($result)) {
while($row = mysql_fetch_assoc($result)) {
$userid = $row['id'];
if($row['wanted'] == "1")
{
}
{
$s_username = $row['name'];
$s_figure = 'http://www.habbo.co.uk/habbo-imaging/avatarimage?figure='.$row['figure'].'&size=b&direction=2&head_direction=3&gesture=sml&size=m';
}
echo "<p><img src='".$s_figure."' alt='".$s_username."' align='left' />
<b><a href='home/".$s_username."'>".$s_username."</a></b><br /><br /><br /><br /><br /><br /><br /><br /></p>";
}
}else{
echo 'No one is yet wanted by the NYPD!</a>';
}
?>
</table>
</div>
</div>
</div></div>
<div class="habblet-container ">
</div>
<div id="column2" class="column">
<div class="habblet-container ">
<div class="cbb clearfix green ">
<h2 class="title">Whats this page? </h2>
<div id="notfound-looking-for" class="box-content">
<table width="170px">
This page is to show you who is wanted for being arrested! <br /><br />So look out!
</table>
</div>
</div>
</div></div>
<?php require_once('templates/community_footer.php'); ?>
Screenshots:


Cheers, if you like this, click the thanks button!