Few fixes for RP Servers..
Hey guys,
Closed my hotel now to start releasing more.. ;']
Right first bug i will give you is a new give command!
This give command will disallow your users from using the corporation exploit...
They will not be able to give their selfs credits, when doing the exploit.. Which should fix it up!
Also, if ecorp admins see this give command, feel free to say sorry for giving me grief, and saying its the corporations that do it pmsl..
case "give":
PHP Code:
#region :give <user> <amount>
case "give":
{
int myCoins;
int giveCoins = int.Parse(args[2]);
virtualUser User = userManager.getUser(args[1]);
if (_Username == User._Username)
{
this.sendData("BK" + "You Cannot give credits to your self!");
}
else
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
myCoins = dbClient.getInt("SELECT credits FROM users WHERE name = '" + _Username + "'");
}
if (myCoins >= giveCoins && giveCoins > 0)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
dbClient.runQuery("UPDATE users SET credits = credits + '" + giveCoins + "' WHERE name = '" + User._Username + "'");
dbClient.runQuery("UPDATE users SET credits = credits - '" + giveCoins + "' WHERE name = '" + _Username + "'");
Room.sendSaying(roomUser, "*hands " + User._Username + " " + giveCoins + " credits*");
refreshValueables(true, false);
User.refreshValueables(true, false);
}
}
}
break;
}
#endregion
Now another, making users enabled to give their self VIP.. Which is just an easy step to this.. All you have to do is delete tryout.php from your htdocs, or file manager.. Then thats that done!
Next, news spamming... I've released this ages back but i may aswell compile it here..
articles.php:
Replace this with your current news file!
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.news");
$id = $input->FilterText($_GET['id']);
$category = $input->stringToURL($input->HoloText($_GET['category'],true),true,false);
$archive = $_GET['archive'];
$pagenum = $_GET['pageNumber'];
if(!isset($_GET['pageNumber'])){ $pagenum = 1; }
if(!isset($id) || $id == ""){ $id = $db->result($db->query("SELECT MAX(id) AS count FROM ".PREFIX."news LIMIT 1")); }
$news_row = $db->fetch_assoc($db->query("SELECT * FROM ".PREFIX."news WHERE id = '".$id."' LIMIT 1"));
foreach ($news_row as &$value) {
$value = $input->HoloText($value, true);
}
$page['id'] = "news";
$page['name'] = $lang->loc['pagename.news']." - ".$news_row['title'];
$page['bodyid'] = "news";
$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 default ">
<h2 class="title"><?php echo $lang->loc['pagename.news']; ?>
</h2>
<div id="article-archive">
<?php if(isset($_GET['archive']) && $archive = "true"){
$count = $db->result($db->query("SELECT COUNT(*) FROM ".PREFIX."news"));
$pages = ceil($count / 20); ?>
<div id="article-paging" class="clearfix">
<?php if(($pagenum + 1) <= $pages){ ?><a href="<?php echo PATH; ?>/articles/archive?pageNumber=<?php echo $pagenum + 1; ?>" class="older"><< <?php echo $lang->loc['older']; ?></a><?php } ?>
<?php if(($pagenum - 1) > 0){ ?><a href="<?php echo PATH; ?>/articles/archive?pageNumber=<?php echo $pagenum - 1; ?>" class="newer"><?php echo $lang->loc['newer']; ?> >></a><?php } ?>
</div>
<?php } ?>
<?php
if((!isset($archive) || $archive == "false") && (!isset($_GET['category']) || $_GET['category'] = "")){
$time['stop'] = time() - 60*60*24;
$sql = $db->query("SELECT * FROM ".PREFIX."news WHERE time > ".$time['stop']." ORDER BY id DESC");
if($db->num_rows($sql) > 0){ ?>
<h2><?php echo $lang->loc['today']; ?></h2>
<ul>
<?php while($row = $db->fetch_assoc($sql)){ $row['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true); ?>
<li>
<a href="<?php echo PATH; ?>/articles/<?php echo $row['id']."-".$row['title_safe']; ?>" class="article-<?php echo $row['id']; ?>"><?php echo stripslashes($row['title']); ?> »</a>
</li>
<?php } ?>
</ul>
<?php }
$time['start'] = time() - 60*60*24; $time['stop'] = time() - 60*60*24*2;
$sql = $db->query("SELECT * FROM ".PREFIX."news WHERE time < ".$time['start']." AND time > ".$time['stop']." ORDER BY id DESC");
if($db->num_rows($sql) > 0){ ?>
<h2><?php echo $lang->loc['yesterday']; ?></h2>
<ul>
<?php while($row = $db->fetch_assoc($sql)){ $row['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true); ?>
<li>
<a href="<?php echo PATH; ?>/articles/<?php echo $row['id']."-".$row['title_safe']; ?>" class="article-<?php echo $row['id']; ?>"><?php echo stripslashes($row['title']); ?> »</a>
</li>
<?php } ?>
</ul>
<?php }
$time['start'] = time() - 60*60*24*2; $time['stop'] = time() - 60*60*24*7;
$sql = $db->query("SELECT * FROM ".PREFIX."news WHERE time < ".$time['start']." AND time > ".$time['stop']." ORDER BY id DESC");
if($db->num_rows($sql) > 0){ ?>
<h2><?php echo $lang->loc['this.week']; ?></h2>
<ul>
<?php while($row = $db->fetch_assoc($sql)){ $row['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true); ?>
<li>
<a href="<?php echo PATH; ?>/articles/<?php echo $row['id']."-".$row['title_safe']; ?>" class="article-<?php echo $row['id']; ?>"><?php echo stripslashes($row['title']); ?> »</a>
</li>
<?php } ?>
</ul>
<?php }
$time['start'] = time() - 60*60*24*7; $time['stop'] = time() - 60*60*24*14;
$sql = $db->query("SELECT * FROM ".PREFIX."news WHERE time < ".$time['start']." AND time > ".$time['stop']." ORDER BY id DESC");
if($db->num_rows($sql) > 0){ ?>
<h2><?php echo $lang->loc['last.week']; ?></h2>
<ul>
<?php while($row = $db->fetch_assoc($sql)){ $row['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true); ?>
<li>
<a href="<?php echo PATH; ?>/articles/<?php echo $row['id']."-".$row['title_safe']; ?>" class="article-<?php echo $row['id']; ?>"><?php echo stripslashes($row['title']); ?> »</a>
</li>
<?php } ?>
</ul>
<?php }
$time['start'] = time() - 60*60*24*14; $time['stop'] = time() - 60*60*24*30;
$sql = $db->query("SELECT * FROM ".PREFIX."news WHERE time < ".$time['start']." AND time > ".$time['stop']." ORDER BY id DESC");
if($db->num_rows($sql) > 0){ ?>
<h2><?php echo $lang->loc['this.month']; ?></h2>
<ul>
<?php while($row = $db->fetch_assoc($sql)){ $row['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true); ?>
<li>
<a href="<?php echo PATH; ?>/articles/<?php echo $row['id']."-".$row['title_safe']; ?>" class="article-<?php echo $row['id']; ?>"><?php echo stripslashes($row['title']); ?> »</a>
</li>
<?php } ?>
</ul>
<?php }
}elseif(isset($_GET['archive']) && $archive = "true"){ ?>
<h2><?php echo $lang->loc['pagename.news']; ?></h2>
<ul>
<?php
$sql = "SELECT * FROM ".PREFIX."news ORDER BY time DESC LIMIT 20";
if($pagenum > 1){ $sql = $sql." OFFSET ".($pagenum - 1) * 20; }
$sql = $db->query($sql);
while($row = $db->fetch_assoc($sql)){ $row['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true); ?>
<li>
<a href="<?php echo PATH; ?>/articles/<?php echo $row['id']."-".$row['title_safe']; ?>/in/archive<?php if($pagenum > 1){ echo $pagenum; } ?>" class="article-<?php echo $row['id']; ?>"><?php echo stripslashes($row['title']); ?> »</a>
</li>
<?php } ?>
</ul>
<?php }elseif(isset($_GET['category'])){ ?>
<h2><?php echo $lang->loc['pagename.news']; ?></h2>
<ul>
<?php
$sql = $db->query("SELECT * FROM ".PREFIX."news WHERE categories LIKE '%".$category."%'");
while($row = $db->fetch_assoc($sql)){ $row['title_safe'] = $input->stringToURL($input->HoloText($row['title'],true),true,true); ?>
<li>
<a href="<?php echo PATH; ?>/articles/<?php echo $row['id']."-".$row['title_safe']; ?>/in/category/<?php echo $category; ?>" class="article-<?php echo $row['id']; ?>"><?php echo stripslashes($row['title']); ?> »</a>
</li>
<?php } ?>
</ul>
<?php } ?>
<a href="<?php echo PATH; ?>/articles/archive"><?php echo $lang->loc['more.news']; ?> »</a>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
</div>
<div id="column2" class="column">
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper">
<h2><?php echo $news_row['title']; ?></h2>
<div class="article-meta"><?php echo $lang->loc['posted']." ".date('M j, Y',$news_row['time']); ?>
<?php $categories = explode(",",$news_row['categories']); $output = ""; foreach($categories as &$value){ $output = $output."<a href=\"".PATH."/articles/category/".$input->stringToURL($input->HoloText($value,true),true,true)."\">".$value."</a>, "; } $output = substr_replace($output,"",-2); ?>
<?php echo $output; ?></div>
<?php $images = explode(",",$news_row['images']); if(!empty($images[0])){ ?>
<img src="<?php echo $images[0]; ?>" class="article-image"/>
<?php } ?>
<p class="summary"><?php echo nl2br($news_row['summary']); ?></p>
<div class="article-body">
<p><?php echo nl2br($news_row['story']); ?></p>
<div class="article-author">- <?php echo $news_row['author']; ?></div>
<?php if(count($images) > 1){ unset($images[0]); $output = ""; foreach($images as &$value){ $output = $output."<a href=\"".$value."\" style=\"background-image: url(".$value."); background-position: -0px -0px\"></a>\n"; } ?>
<div class="article-images clearfix">
<?php echo $output; ?>
</div>
<?php } ?>
<script type="text/javascript" language="Javascript">
document.observe("dom:loaded", function() {
$$('.article-images a').each(function(a) {
Event.observe(a, 'click', function(e) {
Event.stop(e);
Overlay.lightbox(a.href, "<?php echo $lang->loc['image.loading']; ?>");
});
});
$$('a.article-<?php echo $news_row['id']; ?>').each(function(a) {
a.replace(a.innerHTML);
});
});
</script>
</div>
</div>
</div>
</div>
<style type="text/css">
input[type="text"], input[type="password"] {
background-color: #F1F1F1;
border: 1px solid #999999;
width: 175px;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
input[type="submit"] {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
textarea {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
width: 517px;
height: 70px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
select {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
</style>
<?php
if(isset($_POST['post_comment']) && $user->name != 'Guest'){
$posted_on = date("M j, Y g:i A");
$comment = strip_tags($input->FilterText($_POST['comment']));
if($comment == NULL){
$error_message = 'You have left a field empty.<br /><br />';
}else{
$GetInfo = mysql_query("SELECT * FROM cms_news_comments WHERE article = '".$news_row['id']."' ORDER BY id DESC LIMIT 1");
$myID = mysql_fetch_array($GetInfo);
if($myID['userid'] == $user->id){
$error_message = 'Please wait untill somebody else have placed a comment!<br /><br />';
}else{
mysql_query("INSERT INTO cms_news_comments (article, userid, comment, posted_on) VALUES ('".$news_row['id']."', '".$user->id."', '".$comment."', '".$posted_on."');");
$error_message = 'You have successfully left a comment.<br /><br />';
}
}
}
?>
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper"><h2>Post Comment</h2>
<div class="article-meta"></div>
<div class="article-body">
<?php
if($user->name != 'Guest'){
echo $error_message; ?>
<form action="" method="post">
<textarea name="comment" maxlength="500"></textarea><br /><br />
<input type="submit" name="post_comment" value="Post Comment" />
</form>
<?php
}else{
echo 'You must login to post a comment.';
}
?>
</div>
</div>
</div>
</div>
<?php
$getComments = mysql_query("SELECT * FROM cms_news_comments WHERE article = '".$news_row['id']."' ORDER by id DESC");
?>
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper"><h2>Comments (<?php echo mysql_num_rows($getComments); ?>)</h2>
<div class="article-meta"></div>
<div class="article-body">
<?php
if(mysql_num_rows($getComments) == 0){
echo 'Sorry, but no one has posted a comment yet.';
}else{
echo '<table width="528px">';
while($Comments = mysql_fetch_array($getComments)){
$getUserInfo = mysql_query("SELECT * FROM users WHERE id = '".$Comments['userid']."'");
$userInfo = mysql_fetch_array($getUserInfo);
echo '
<tr>
<td width="90px" valign="top">
<div style="float:left"><img src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure='.$userInfo['figure'].'&size=b&direction=2&head_direction=3&gesture=sml&size=m"></div>
';
if($userInfo['rank'] > 5){
echo '<div style="position: absolute; z-index:1"><img src="http://92.232.205.192/dcrs/c_images/ADM.gif"></div>';
}
if($userInfo['rank'] == 3){
echo '<div style="position: absolute; z-index:1"><img src="http://92.232.205.192/dcrs/c_images/VIP.gif"></div>';
}
echo '
</td>
<td width="427px" valign="top">
<strong>RE: '.$news_row['title'].'</strong><br /><br />'.$Comments['comment'].'
</td>
</tr>
<tr>
<td width="90px" valign="top">
</td>
<td width="427px" align="right">
<i>Posted by <strong><a href="#">'.$userInfo['name'].'</a></strong> on '.$Comments['posted_on'].'</i><br /><br />
</td>
</tr>';
}
echo '</table>';
}
?>
</div>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
</div>
<script type="text/javascript">
HabboView.run();
</script>
<?php require_once('./templates/community_footer.php'); ?>
Now the figure fixes, this is easy.. Just replace your includes/classes.php with this:
NOTE:
i did this fix on another account 'Sledehh'.
Quote:
Right, firstly.
1) Navigate to housekeeping.
2) Navigate to the settings menu, then site.
3) Click disable on both cache settings.
4) Now, we goto includes/classes.php
5) Do ctrl + h (In a coding program or ctrl + f if notepad).
6) Now in the search for box, put in "habbo.co.uk" (with no quotes).
7) In the replace with box, put in "habbo.com" (With no quotes).
8) Done!
But, you will still have some pages where it is buggy, such as, staff.php etc...
All you have to do is;
1) Open the file.
2) Do ctrl + h (In a coding program or ctrl + f if notepad).
3) Now in the search for box, put in "habbo.co.uk" (with no quotes).
4) In the replace with box, put in "habbo.com" (With no quotes).
5) Done!
Don't forget to save it ;').
Also, a fix for uncuff!, Right the uncuff command is all okay, just one thing, if you set security to 'stun = 1' that means they can uncuff which allot hate so here we are:
case "uncuff":
PHP Code:
#region :uncuff
case "uncuff": // Uncuff the specified user
{
int getJob;
int isWorking;
int getAuth;
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
getJob = dbClient.getInt("SELECT secure_id FROM users WHERE name = '" + _Username + "'");
isWorking = dbClient.getInt("SELECT working FROM users WHERE name = '" + _Username + "'");
getAuth = dbClient.getInt("SELECT uncuff FROM jobs_ranks WHERE id = '" + getJob + "'");
}
virtualUser User = userManager.getUser(args[1]);
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 (getAuth > 0 && isWorking > 0)
{
int _userID = userManager.getUserID(args[1]);
virtualUser Target = userManager.getUser(_userID);
Target.roomUser.walkLock = false; // Freeze the user
Room.sendSaying(roomUser, "*removes cuffs from " + Target._Username + " wrists*");
}
}
break;
}
#endregion
Now goto > database >> jobs_ranks >> make a new column 'uncuff' int 1 default = 0.
Then you can set any rank to have uncuff :').
I'l release more fixes and little tips soon, i understand this is a rough thread, i did it fast, also i know there is not much but trust me, when you see your members randomly going from 500 credits to 10,000 credits you'll appreciate this :').
If this helps you click the 'Thanks' button!!
Also, if you need any commands fixing. ask meh :').
Re: Few fixes for RP Servers..
Re: Few fixes for RP Servers..
Aha, thanks :'). - feel free to click teh 'Thanks' button! :').
Re: Few fixes for RP Servers..
Nice release buddeh ;]
Will help meh alot
Thanked :)
Re: Few fixes for RP Servers..
Re: Few fixes for RP Servers..
Ty, i was looking for the give command ;)
Re: Few fixes for RP Servers..
Re: Few fixes for RP Servers..
Re: Few fixes for RP Servers..
Re: Few fixes for RP Servers..
Another great release and don't worry I hit the "thanks" button xD
Re: Few fixes for RP Servers..
Ahaha, thanks dooood :').
Re: Few fixes for RP Servers..
nice release craig :) you should make a very stable v26/r35 normal server with decent commands :P
Re: Few fixes for RP Servers..
Thanks richie :') I may do ;'D!
Re: Few fixes for RP Servers..
Re: Few fixes for RP Servers..
nice, again wonderful release, useful for me as an rp owner