3 Tries on Vault help?

Diddy8000

Member
Aug 22, 2011
78
18
Hello guys,

I'm using the vault script released on here but there is one issue that i can't seem to work out. This vault system is ment to be a 3 tries and then you can't do it any more but it doesn't seem to be doing that. Does anyone know why?

<head><style>
.test{background-image:url(../../images/vault_bg.gif);background-repeat:no-repeat;margin-left:6px;height:155px;}
.test2{background-image:url(../images/vault_prizebg.gif);background-repeat:no-repeat;margin-top:5px;padding-top:8px;width:277px;height:117px;}
</style>
</head>
<div class="habblet-container ">
<div class="cbb clearfix">
<div class="test">


<div class="box-content">








<?php


$error = '';
$error1 = '';




$sent = (isset($_POST['sent'])) ? $_POST['sent'] : '';
$username = (isset($_POST['username'])) ? mysql_real_escape_string($_POST['username']) : '';
$p1 = (isset($_POST['p1'])) ? mysql_real_escape_string($_POST['p1']) : '';
$p2 = (isset($_POST['p2'])) ? mysql_real_escape_string($_POST['p2']) : '';
$p3 = (isset($_POST['p3'])) ? mysql_real_escape_string($_POST['p3']) : '';
$p4 = (isset($_POST['p4'])) ? mysql_real_escape_string($_POST['p4']) : '';


$time = time();
$time2 = $time + 86400;
$time2 = mysql_real_escape_string($time2);




$checkd = dbquery("SELECT COUNT(username) FROM expire WHERE username = '" . USER_NAME . "' AND expire > '" . time() . "' LIMIT 1");
$resultd = mysql_result($checkd, 0);


//if($resultd == 1)
//{
// echo "You have Completed Your Vault Tries";
// die();
//
//} else
//{




if(isset($_POST['username']) && $username == '')
{


$error = '<strong><font color="red">You Must Add Your Username!<br><br></font></strong>';


}




if($sent == 'yes' && $username != '') {


$validate = dbquery("SELECT * FROM vault WHERE Pin1 = '" . $p1 . "' AND Pin2 = '" . $p2 . "' AND Pin3 = '" . $p3 . "' AND Pin4 = '" . $p4 . "' AND enabled = '1' LIMIT 1");


$count = mysql_num_rows($validate);


if($count == 1)
{






while($cvalidate = mysql_fetch_assoc($validate))
{


$won = $cvalidate['Prize'];


}


//dbquery("UPDATE users SET perror = 0 WHERE username = '".$username."'");
dbquery("UPDATE vault SET Username = '" . USER_NAME . "', enabled = '0' WHERE Pin1 = '" . $p1 . "' AND Pin2 = '" . $p2 . "' AND Pin3 = '" . $p3 . "' AND Pin4 = '" . $p4 . "' AND enabled = '1'");
//setcookie("vaultdone",$username, time()+3600*24);
dbquery("INSERT INTO expire (username, expire) VALUES ('" . $username . "', '" . $time2 . "')");
dbquery("INSERT INTO vault_winners (username) VALUES ('" . $username . "')");

$error = '<font color="green"><strong>Well done, you got the Correct Combination!<br>You won ' . $won . '</strong><br><br>You have received your reward, you have either been disconnected or it has been automatically applied to your account! Enjoy.</font><br><br>';


//$getid = dbquery("SELECT * FROM users WHERE username = '" . $username . "'");
//$row = mysql_fetch_array($getid);
//$id = $row['id'];




$getcode = dbquery("SELECT * FROM vault WHERE Pin1 = '" . $p1 . "' AND Pin2 = '" . $p2 . "' AND Pin3 = '" . $p3 . "' AND Pin4 = '" . $p4 . "'");
$coderow = mysql_fetch_array($getcode);
$code = $coderow['code'];


if($code == 1)
{
// Give the winner their much deserved VIP ~
dbquery("UPDATE users SET vip = '1' WHERE username = '" . USER_NAME . "'");
if ($users->GetUserVar(USER_ID, 'rank') == "1") { dbquery("UPDATE users SET rank = 2 WHERE username = '" . USER_NAME . "'"); }
//$core->Mus('updatevip', USER_ID);
//$core->Mus('signout', USER_ID);
}


if($code == 2)
{
// Give the winner their throne ~
$getidd = dbquery("SELECT * FROM items ORDER BY id DESC LIMIT 0,1");
$gotidd = mysql_fetch_array($getidd);
$finalid = $gotidd['id'] + 1;
dbquery("INSERT into items (id, user_id, room_id, base_item, x, y, z, rot, wall_pos)
VALUES ('" . $finalid . "','" . USER_ID . "', '0', '202', '0', '0', '0', '0', '0')");
//$core->Mus('signout', USER_ID);
}


if($code == 3)
{
// Give the winner their
$getidd = dbquery("SELECT * FROM items ORDER BY id DESC LIMIT 0,1");
$gotidd = mysql_fetch_array($getidd);
$finalid = $gotidd['id'] + 1;
dbquery("INSERT into items (id, user_id, room_id, base_item, x, y, z, rot, wall_pos) VALUES ('" . $finalid . "','" . USER_ID . "', '0', '227', '0', '0', '0', '0', '0')");
}


if($code == 4)
{
dbquery("UPDATE user_stats SET badges = 6 WHERE id = '" . USER_ID . "'");
}

if($code == 5)
{
// Give the winner their typewritter ~
$getidd = dbquery("SELECT * FROM items ORDER BY id DESC LIMIT 0,1");
$gotidd = mysql_fetch_array($getidd);
$finalid = $gotidd['id'] + 1;
dbquery("INSERT into items (id, user_id, room_id, base_item, x, y, z, rot, wall_pos)
VALUES ('" . $finalid . "','" . USER_ID . "', '0', '226', '0', '0', '0', '0', '0')");
//$core->Mus('signout', USER_ID);
}

if($code == 6)
{
// Give the winner their petal patch ~
$getidd = dbquery("SELECT * FROM items ORDER BY id DESC LIMIT 0,1");
$gotidd = mysql_fetch_array($getidd);
$finalid = $gotidd['id'] + 1;
dbquery("INSERT into items (id, user_id, room_id, base_item, x, y, z, rot, wall_pos)
VALUES ('" . $finalid . "','" . USER_ID . "', '0', '247', '0', '0', '0', '0', '0')");
//$core->Mus('signout', USER_ID);
}


}
else if($count == 0)
{


//dbquery("UPDATE users SET perror = perror +1 WHERE username = '" .$username. "'");
//$check = dbquery("SELECT perror FROM users WHERE username = '" .$username. "'");
//$result = mysql_result($check, 0);
//if($result >= 5)
//{
// $error1 = '<font color="red"><strong>You have completed your tries for today, Please come back tomorrow</strong></font><br><br>';
// dbquery("INSERT INTO expire (username, expire) VALUES ('" . $username . "', '" . $time2 . "')");
// dbquery("UPDATE users SET perror = 0 WHERE username = '" .$username. "'");
//}
$result = $result;


$error = '<font color="red"><strong>Oh no, you got the wrong combination!<br>Why not try again?</strong></font><br><br>';
}
}


//}


?>
</div>
<style>
a {
color: #000;
}


a.reglink {
font-weight: bold;
text-decoration: underline;
color: #000;
}


input {
border: 1px solid #aaa;
background: #fff;
padding: 5px;
font-family: verdana;
font-size: 10px;
}


input[type=submit] {
padding-left: 10px;
padding-right: 10px;
float: center;
margin:5px;
}


div.loginBox {
background-color: #ffffff;
width: 720px;
margin: 0 auto;
border: 1px solid #aaa;
}


div.loginBox > div.top {
padding: 20px;
overflow: hidden;
text-align: right;
}


div.loginBox > div.top > a > img {
border:0;
float: left;
}


div.loginBox > div.mid {
height: 431px;
background-image: url( '../images/park_battle.png' );
overflow: hidden;
}




div.loginBox > div.mid > div.registerBox {
width: 280px;
float: left;
margin-left: 20px;
margin-top: 20px;
background-color: #fff;
border: 1px solid #000;
padding: 10px;
}
div.loginBox > div.mid > div.registerBox#right {
float: right;
margin-right: 40px;
}


div.loginBox > div.mid > div.registerBox > form > input[type=text] {
width: 95%;
}


div.loginBox > div.mid > div.registerBox > form > input[type=password] {
width: 95%;
}


div.loginBox > div.mid > div.loginForm {
width: 317px;
float: left;
margin-left: 30px;
margin-top: 60px;
background-color: #fff;
border: 3px solid #000;
padding: 10px;
border-radius: 20px;
}




div.loginBox > div.mid > div.loginForm > form > input[type=text] {
width: 95%;
}


div.loginBox > div.mid > div.loginForm > form > input[type=password] {
width: 95%;
}


div.loginBox > div.mid > div.registerstep2 > input[type=text] {
width: 80%;
}


div.loginBox > div.mid > div.registerstep2 > input[type=submit] {
width: 15%;
}


div.loginBox > div.bot > p {
text-align: center;
}


div.loginBox > div.bot > p.copyright > a, div.loginBox > div.bot > p.copyright {
color: #aaa;
}


div.loginBox > div.mid > div.loginForm > div.box_header {
background: #edede5;
padding: 5px;
font-weight: bold;
margin-bottom: 5px;
margin-top: -5px;
margin-left: -5px;
margin-right: -5px;
}


div.loginBox > div.mid > div.logininfo > div.box_header {
background: #edede5;
padding: 5px;
font-weight: bold;
margin-bottom: 5px;
margin-top: -5px;
margin-left: -5px;
margin-right: -5px;
}


div.loginBox > div.mid > div.registerBox > div.box_header {
background: #edede5;
padding: 5px;
font-weight: bold;
margin-bottom: 5px;
margin-top: -5px;
margin-left: -5px;
margin-right: -5px;
}


div.loginBox > div.mid > div.registerstep2 > div.box_header {
background: #edede5;
padding: 5px;
font-weight: bold;
margin-bottom: 5px;
margin-top: -5px;
margin-left: -5px;
margin-right: -5px;
}


select {
border: none;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #edede5;
width: 75px;
}


input.text-field,input.password-field,select {
font-size: 11px;
padding: 4px;
border-style: solid;
border-color: #C6C6C6 #C6C6C6 #E3E3E3;
border-width: 1px;
}


input, textarea, select {
font-size: 11px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}


div.errormsg {
padding: 7px;
background-color: #fff4f2;
border: 1px solid #a63c29;
color: #E2001A;
margin-top: 5px;
}


div.errormsg > h3 {
font-weight: bold;
margin: 0px;
padding: 0px;
font-size: 13px;
}


div.goodmsg {
padding: 7px;
background-color: #d8f3d8;
border: 1px solid #4da04d;
color: #205220;
margin-top: 5px;
}


div.goodmsg > h3 {
font-weight: bold;
margin: 0px;
padding: 0px;
font-size: 13px;
}


div.display_none {
display: none;
}


label.error {
padding: 7px;
background-color: #fff4f2;
border: 1px solid #a63c29;
color: #E2001A;
display: block;
font-weight: bold;
}
</style>
<center>
<form name='validate' action='vault.php' method='post'>


<?php echo $error; echo $error1; ?>


<input type='hidden' name='username' value='%habboName%'>
<br><br>
Crack the vault:
<br>
<select name='p1'>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='0'>0</option>
</select>


<select name='p2'>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='0'>0</option>
</select>


<select name='p3'>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='0'>0</option>
</select>


<select name='p4'>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
<option value='7'>7</option>
<option value='8'>8</option>
<option value='9'>9</option>
<option value='0'>0</option>
</select>
<br><br>
<input type='submit' value='Crack the Vault!'>


<input type='hidden' name='sent' value='yes'>
</form></p>
</center>




</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>












<div class="habblet-container ">
<div class="cbb clearfix blue ">


<h2 class="title">About the Vault!</h2>
<div class="box-content">
<img src="%www%/images/jetset_quest_promo_vault.png" align="right">
The Habless safe is full of rare and special items! But there's only one problem, we have lost the code ..
Do you know what the correct code is safe?
You will receive one of the prizes that are right.
When all codes have guessed, and the vault is emptied it will be refilled with new items.
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

Thanks in advance!
 

Users who are viewing this thread

Top