Файл: chats/city1/bank.php
Строк: 378
<?php
require( "../inc/conf.inc.php" );
require( "../inc/check.php" );
include "./../includes/header.php";
include "../includes/inc_online.php";
include "../russian/lang_main.php"; //языковой файл
if(!empty($id))
{
$q = mysql_query("select secur,golod,band,voodoo,nums,guns,cars,id,login,pass,mafcredits,level,police,health from users where id='".$id."';");
}
$data = mysql_fetch_array($q);
$id=$data['id'];
$login=$data['login'];
$mafcredits=$data['mafcredits'];
$level=$data['level'];
$police=$data['police'];
$stage=$data['stage'];
$health=$data['health'];
$cars=$data['cars'];
$guns=$data['guns'];
$nums=$data['nums'];
$band=$data['band'];
$golod=$data['golod'];
$secur=$data['secur'];
mysql_query("update users set last='".time()."',city='1' where id='".$id."';");
include "./../includes/inc_secur.php";
include "./../includes/inc_golod.php";
include "./../includes/inc_hospital.php";
include "./../includes/inc_police.php";
include "./../includes/inc_die.php";
include "./../includes/inc_voodoo.php";
include "./../includes/inc_attack.php";
include "./../includes/inc_mes.php";
print "<b>".$lang['game_city1']."</b><br/>";
print "<u>[".$lang['area_bank']."]</u><br/>";
$db=mysql_fetch_array(mysql_query("select * from krisha where city='1' and house='bank';"));
$bcity=$db['city'];
$bband=$db['band'];
$busers=$db['users'];
$bmafcredits=$db['mafcredits'];
$btime=$db['time'];
if(empty($bmafcredits))
{
$bank_mafcredits=rand(1,1000);
mysql_query("update krisha set mafcredits='".$bank_mafcredits."' where city='1' and house='bank';");
}
switch ($mode)
{
case "grab":
if(empty($guns) || ($bband==$band && $band!=''))
{
print $lang['uv_without_guns']."<br/>";
}
else
{
if(empty($a))
{
$guns_array = explode(".", $guns);
$count_guns=count($guns_array);
echo "<form method="post" action="bank.php?id=$id&pass=$pass&mode=grab">";
print $lang['cops_select_gun']."</small><br/><select name="at_gun">";
for($i=0;$i<$count_guns;$i++)
{
print "<option value="".$guns_array[$i]."">".$guns_array[$i]."</option>";
}
echo "<input value="Напасть" type="submit" class="cp">rn</form>";
echo "<postfield name="a" value="b"/><postfield name="at_gun" value="$(at_gun)"/>";
//print "</select><br/><small>";
//print "<anchor>".$lang['ok']."
//<go href="bank.php?id=$id&pass=$pass&mode=grab" method="post">
//<postfield name="a" value="b"/>
//<postfield name="at_gun" value="$(at_gun)"/>
//</go></anchor><br/>";
}
else
{
if($at_gun==$lang['gun1'])$at_gun=1;
elseif($at_gun==$lang['gun2'])$at_gun=2;
elseif($at_gun==$lang['gun3'])$at_gun=3;
elseif($at_gun==$lang['gun4'])$at_gun=4;
elseif($at_gun==$lang['gun5'])$at_gun=5;
elseif($at_gun==$lang['gun6'])$at_gun=6;
elseif($at_gun==$lang['gun7'])$at_gun=7;
elseif($at_gun==$lang['gun8'])$at_gun=8;
elseif($at_gun==$lang['gun9'])$at_gun=9;
elseif($at_gun==$lang['gun10'])$at_gun=10;
elseif($at_gun==$lang['gun11'])$at_gun=11;
elseif($at_gun==$lang['gun12'])$at_gun=12;
$gun_cop=rand(6,12);
if($gun_cop==6)$cop_gun=$lang['gun6'];
elseif($gun_cop==7)$cop_gun=$lang['gun7'];
elseif($gun_cop==8)$cop_gun=$lang['gun8'];
elseif($gun_cop==9)$cop_gun=$lang['gun9'];
elseif($gun_cop==10)$cop_gun=$lang['gun10'];
elseif($gun_cop==11)$cop_gun=$lang['gun11'];
elseif($gun_cop==12)$cop_gun=$lang['gun12'];
$police=$police+3;
if($gun_cop>$at_gun)
{
--$level;
if($level<0)$level=0;
$health=$health-6;
if($health<0) $health=0;
mysql_query("update users set health='".$health."',police='".$police."',level='".$level."' where id='".$id."';");
print $lang['bank_grab_fuck']." ".$cop_gun."!<br/>".$lang['bank_grab_health']." ".$health."%<br/>";
}
else
{
++$level;
$grab_mafcredits=$mafcredits+$bmafcredits;
mysql_query("update users set mafcredits='".$grab_mafcredits."',police='".$police."',level='".$level."' where id='".$id."';");
mysql_query("update krisha set mafcredits='0' where city='1' and house='bank';");
print $lang['bank_grab_yeah']." ".$grab_mafcredits."$$<br/>";
}
}
}
print "><a href="bank.php?id=$id&pass=$pass">".$lang['area_bank']."</a><br/>";
break;
case "kr":
if(empty($bband) && !empty($band))
{
mysql_query("update krisha set band='".$band."' where city='1' and house='bank'");
print $lang['bank_now_your_band_is_kr'];
$bank_band=mysql_fetch_array(mysql_query("select boss from bands where name='".$band."';"));
$boss=$bank_band['boss'];
$db_boss=mysql_fetch_array(mysql_query("select id,pass from users where login='".$boss."';"));
$dbid=$db_boss['id'];
$dbpass=$db_boss['pass'];
$messaga=$lang['bank_now_mes']."<br/>[<a href="./../mes.php?pass=$dbpass&id=$dbid&dbid=0&mode=del">".$lang['ok']."</a>]";
mysql_query("insert into messagi values(0,'0','$dbid','$messaga');");
}
else
{
print $lang['error']."<br/>";
}
print "><a href="bank.php?id=$id&pass=$pass">".$lang['area_bank']."</a><br/>";
break;
case "at_kr":
if(!empty($band) && $band!=$bband)
{
$band_array_att=mysql_fetch_array(mysql_query("select avtoritet from bands where name='".$band."';"));
$band_array_kr=mysql_fetch_array(mysql_query("select boss,avtoritet from bands where name='".$bband."';"));
$avtoritet_att=$band_array_att['avtoritet'];
$boss_kr=$band_array_kr['boss'];
$avtoritet_kr=$band_array_kr['avtoritet'];
if($avtoritet_att>$avtoritet_kr)
{
mysql_query("update krisha set band='".$band."' where city='1' and house='bank';");
print $lang['bank_kr_another_band']." ".$band."!<br/>";
$db_boss=mysql_fetch_array(mysql_query("select id,pass from users where login='".$boss_kr."';"));
$dbid=$db_boss['id'];
$dbpass=$db_boss['pass'];
$messaga="<b>".$lang['bank_city1']."</b><br/>".$lang['bank_kr_another_band']." ".$band.".<br/>[<a href="./../mes.php?pass=$dbpass&id=$dbid&dbid=0&mode=del">".$lang['ok']."</a>]";
mysql_query("insert into messagi values(0,'0','$dbid','$messaga');");
}
elseif($avtoritet_att<=$avtoritet_kr)
{
print $lang['bank_small_level'];
}
}
else
{
print $lang['error']."<br/>";
}
print "><a href="bank.php?id=$id&pass=$pass">".$lang['area_bank']."</a><br/>";
break;
case "gp":
if(($btime+3600)<time())
{
$band_array=mysql_fetch_array(mysql_query("select boss,mafcredits from bands where name='".$bband."';"));
$percents=rand(1,50000);
$bmafcredits=$bmafcredits-$percents;
$band_mafcredits=$band_array['mafcredits'];
$band_boss=$band_array['boss'];
$band_mafcredits=$band_mafcredits+$percents;
mysql_query("update krisha set mafcredits='".$bmafcredits."',time='".time()."' where city='1' and house='bank';");
mysql_query("update bands set mafcredits='".$band_mafcredits."' where name='".$bband."';");
print $percents."$$ ".$lang['bank_now_at_obwak']."<br/>";
$db_boss=mysql_fetch_array(mysql_query("select id,pass from users where login='".$band_boss."';"));
$dbid=$db_boss['id'];
$dbpass=$db_boss['pass'];
$messaga="<b>".$lang['bank_city1']."</b><br/>".$lang['bank_has_percents']." ".$band_mafcredits."$$<br/>[<a href="./../mes.php?pass=$dbpass&id=$dbid&dbid=0&mode=del">".$lang['ok']."</a>]";
mysql_query("insert into messagi values(0,'0','$dbid','$messaga');");
}
else
{
print $lang['bank_kto-to']." ".$bband." ".$lang['bank_uje']."<br/>";
}
print "><a href="bank.php?id=$id&pass=$pass">".$lang['area_bank']."</a><br/>";
break;
default:
print $lang['bank_mes']."<br/>";
if(!empty($bband)) print $lang['bank_krishuet'].": <b><a href="./../bands/viewband.php?id=$id&pass=$pass&band=".urlencode($bband)."">".$bband."</a></b><br/>";
if($bband!=$band || $bband=='') print "<a href="bank.php?id=$id&pass=$pass&mode=grab">".$lang['bank_grab']."</a><br/>";
if(empty($bband) && $band!='') print "<a href="bank.php?id=$id&pass=$pass&mode=kr">".$lang['bank_krisha']."</a><br/>";
elseif(!empty($bband) && $bband!=$band && $band!='')
{
print "<a href="bank.php?id=$id&pass=$pass&mode=at_kr">".$lang['bank_att_krisha']."</a><br/>";
}
if($band==$bband && $band!='') print "<a href="bank.php?id=$id&pass=$pass&mode=gp">".$lang['bank_get_percent']."</a><br/>";
break;
}
print "---<br/>><a href="index.php?id=$id&pass=$pass">".$lang['in_city']."</a>";
print "<br/>>><a href="./../game.php?id=$id&pass=$pass">".$lang['menu']."</a>";
print "<br/>---";
echo "<br/><a href="../enter.php?id={$id}&pass={$pass}&ref={$ref}">Прихожка</a><br/>";
mysql_close();
include "./../includes/footer.php";
?>