[RP] Wanted Page + Commands

Status
Not open for further replies.

RastaLulz

fight teh power
Staff member
May 3, 2010
3,934
3,933
Sledmore said:
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:
#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:
#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:
#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:
<?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:
nooneiswanted.png

wantedusers.png


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

Credits: Sledmore
 

Andeh

the best cis-boy
Jun 1, 2010
892
124
Sledehh released this some other places aswell
A lovely release to be honest ;)
Thanked
 

Tony

New Member
May 28, 2010
2
0
Wow Rasta, Great oost x] Keep going..I NEED A Custom furni files... To add to my computer so I can upload.
 

Kieren

The OGz
Aug 4, 2010
2,957
752
Nice release but why is craig not using it for his hotel? because he has not go it included ohwell very catchy and nice mmmmmm :)

edit: also how do you create a new table in users? any tuts on that?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Aha. Thanks for releasing this on here, (; - @Kieren, I prefer not to use it on my hotel (;
 

Kieren

The OGz
Aug 4, 2010
2,957
752
Off topic: Is your hotel back open?

Ontopic: Nice release Craig to bad you wouldn't use it on your hotel would of been good.... :)
 

Thomas

Member
Oct 25, 2010
270
5
Great release, btw I do evrything it says to (the sql) ect... and then I add someone to the thing and the name shows but the person dosn't. What should I do?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Thanks lol, This is really old now ;P. I made it cause someone asked for it ;P.
 
Status
Not open for further replies.

Users who are viewing this thread

Top