game/modules_data/location/karcer.php
2022-06-07 00:30:34 +03:00

163 lines
5.9 KiB
PHP

<?
if(!defined('GAME'))
{
die();
}
if($u->room['file']=='karcer')
{
if(isset($_GET['karcer_back'])) {
if( $u->info['jail'] > time() ) {
$u->error = 'Âû íå ìîæåòå âûéòè èç êàðöåðà ðàíüøå ñðîêà';
}else{
//âûïóñêàåì
$upd = mysql_query('UPDATE `users` SET `jail` = "0", `room`="9", `city`="capitalcity" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
if($upd)
{
mysql_query('UPDATE `items_users` SET `delete` = "0" WHERE `uid` = '.$u->info['id'].' AND `delete` = "1357908642"');
$u->error = 'Âû óñïåøíî âûøëè èç òþðüìû';
}else{
$u->error = 'Íå óäàëîñü èñïîëüçîâàòü äàííîå çàêëÿòèå';
}
}
}
function shtraf($stime)
{
$shkr = $stime - time();
$shkr = ceil($shkr/86400)*1000;
if ($shkr>25000){$shkr=25000;};
return $shkr;
}
if(isset($_GET['payshtraf'])) {
if( shtraf($u->info['jail']) != $_GET['payshtraf']) {
$u->error = 'Íå øàëè!!!';
}elseif (shtraf($u->info['jail'])<=$u->info['money'])
{
//âûïóñêàåì
$upd = mysql_query('UPDATE `users` SET `jail` = "0", `room`="9", `city`="capitalcity" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
if($upd)
{
$u->info['money'] = $u->info['money'] - shtraf($u->info['jail']);
$u->info['jail']=0;
mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `users` SET `jail` = "0", `room`="9", `city`="capitalcity" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `items_users` SET `delete` = "0" WHERE `uid` = '.$u->info['id'].' AND `delete` = "1357908642"');
$u->error = date('d.m.Y H:i',time()).' Âû óñïåøíî îïëàòèëè øòðàô '.$_GET['payshtraf'].' è âûøëè èç òþðüìû';
$u->addDelo(3,$u->info['id'],'Îïëà÷åí øòðàô: '.$_GET['payshtraf'].' êð. è âûïóùåí íà ñâîáîäó.',time(),$u->info['city'],'Prison.System',0,0,$u->bank['id']);
}else{
$u->error = '×òî òî ïîøëî íå òàê';
}
}else{$u->error = 'Íå õâàòàåò ñðåäñòâ!';}
}
if(isset($_GET['ekrobmen'])) {
if( $_GET['ekrobmen'] != 4) {
$u->error = 'Íå øàëè!!!';
}elseif ($u->info['money2']>=4)
{
$u->info['money2']=$u->info['money2']-4;
$u->info['money'] = $u->info['money'] +1000;
mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
mysql_query('UPDATE `users` SET `money2` = "'.$u->info['money2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
$ekrran=rand(1,5);
if ($ekrran==1)
{
$u->error = date('d.m.Y H:i',time()).' Âû óñïåøíî îáìåíÿëè 4 åêð. íà 1000 êð. Îõðàííèê îñòàëñÿ âåñüìà äîâîëåí.';
}elseif ($ekrran==2)
{
$u->error = date('d.m.Y H:i',time()).' Âû óñïåøíî îáìåíÿëè 4 åêð. íà 1000 êð. Îõðàííèê ïðèíåñ âàì ïîåñòü.';
}elseif ($ekrran==3)
{
$u->error = date('d.m.Y H:i',time()).' Âû óñïåøíî îáìåíÿëè 4 åêð. íà 1000 êð. Îõðàííèê ïîäìèãíóë âàì.';
}elseif ($ekrran==4)
{
$u->error = date('d.m.Y H:i',time()).' Âû óñïåøíî îáìåíÿëè 4 åêð. íà 1000 êð. Îõðàííèê ïûòàëñÿ îòâåðòåòüñÿ íî âû äîáèëèñü ñâîåãî.';
}elseif ($ekrran==5)
{
$u->error = date('d.m.Y H:i',time()).' Âû óñïåøíî îáìåíÿëè 4 åêð. íà 1000 êð. Îõðàííèê çàïèë íî íà ñëåäóþùèé äåíü ïðèíåñ âàì êð.';
}
$u->addDelo(3,$u->info['id'],'Îáìåí 4 åêð íà 1000 êð.',time(),$u->info['city'],'Prison.System',0,0,$u->bank['id']);
}else{$u->error = 'Íå õâàòàåò ñðåäñòâ!';}
}
?>
<style type="text/css">
.pH3 {COLOR: #8f0000; FONT-FAMILY: Arial; FONT-SIZE: 12pt; FONT-WEIGHT: bold; }
</style>
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><div align="center" class="pH3"><?=$u->room['name']?></div>
<br />
<font color=red><b><?=$u->error?></b></font><br />
<? if( $u->info['jail'] > time() ) { ?>
Âû çàòî÷åíû â êàðöåðå äî <?=date('d.m.Y H:i',$u->info['jail'])?> <br>
Îñâîáîæäåíèå âîçìîæíî ïðè óñëîâèè îïëàòû Øòðàôà:
<?
if (shtraf($u->info['jail'])>$u->info['money'] && $u->info['jail']>0)
{
echo "<font color=red><b>".shtraf($u->info['jail'])."</b></font> êð. Ó âàñ åñòü: ".$u->info['money']." êð.";
?>
<FORM action="main.php?payshtraf=<? echo shtraf($u->info['jail']); ?>" method="POST">
<INPUT class="btn btn-success" TYPE="submit" disabled value="Îïëàòèòü">&nbspÍåäîñòàòî÷íî ñðåäñòâ!
</FORM>
<br>Ìîæíî îáìåíÿòü ó îõðàííèêà 4 åêð íà 1000 êðåäîâ ó âàñ åñòü <?echo $u->info['money2'];?> êð.
<FORM action="main.php?ekrobmen=4" method="POST">
<INPUT class="btn btn-success" TYPE="submit" value="Îáìåíÿòü">
</FORM>
<?
}
else
{
echo "<font color=gren><b>".shtraf($u->info['jail'])."</b></font> êð. ";
?>
<FORM action="main.php?payshtraf=<? echo shtraf($u->info['jail']); ?>" method="POST">
<INPUT class="btn btn-success" TYPE="submit" value="Îïëàòèòü">
</FORM>
<?
}
} ?>
</td>
<td width="280" valign="top"><table align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">&nbsp;</td>
<td><table border="0" cellpadding="0" cellspacing="0">
<tr align="right" valign="top">
<td><!-- -->
<? echo $goLis; ?>
<!-- -->
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DEDEDE">
<tr>
<td bgcolor="#D3D3D3"><img src="https://img.new-combats.com/i/move/links.gif" width="9" height="7" /></td>
<td bgcolor="#D3D3D3" nowrap="nowrap"><a href="#" id="greyText" class="menutop" onclick="location='main.php?karcer_back=1';">Âûéòè èç êàðöåðà</a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div><br />
<p>&nbsp;</p>
<p> <br />
<br />
</p>
</div></td>
</tr>
</table>
<?
}
?>