View file chats/city1/voodoo.php

File size: 6.08Kb
<?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,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'];
$voo_por=$data['voodoo'];
$golod=$data['golod'];
$secur=$data['secur'];

if($pass!=$data['pass'])
{
die ($lang['empty_login']."</small></p></card></wml>");
}

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['sl_kol_voodoo']."]</u><br/>";

switch ($mode) 
{  
case "kill":
if(empty($who))
{
print $lang['voo_mes'];
/////порча////////
echo "<form method=\"post\" action=\"voodoo.php?id=$id&amp;pass=$pass&amp;mode=kill\">";
echo "Логин жертвы:<br/>";
echo "<input type=\"text\" name=\"who\" maxlength=\"15\"/><br/>";
echo "<input value=\"Колдуем\" type=\"submit\"/>";
echo "</form>";




}
else
{
if($mafcredits>50000)
{
$db=mysql_fetch_array(mysql_query("select id,pass,mafcredits from users where login='".$who."';"));
$dbid=$db['id'];
$dbpass=$db['pass'];
$dbmafcredits=$db['mafcredits'];
if(empty($dbid))
{
print $lang['voo_sel_us_err']."<br/>";
}
else
{
/*
if($mafcredits<=$dbmafcredits)
{
$messaga="<b>".$lang['sl_kol_voodoo']."</b><br/>".$login." ".$lang['voo_from_kill']."<br/>[<a href=\"./../mes.php?pass=$dbpass&amp;id=$dbid&amp;dbid=$id&amp;mode=del\">".$lang['ok']."</a>]";
mysql_query("insert into messagi values(0,'$id','$dbid','$messaga');");
$dbmafcredits=$dbmafcredits-50000;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
mysql_query("update users set mafcredits='".$dbmafcredits."' where id='".$dbid."';");
print $lang['voo_kill_error'];
}
else
{
*/
$messaga="<b>".$lang['sl_kol_voodoo']."</b><br/>".$login." ".$lang['voo_mes_porcha']."<br/>[<a href=\"./../mes.php?pass=$dbpass&amp;id=$dbid&amp;dbid=$id&amp;mode=del\">".$lang['ok']."</a>]";
mysql_query("insert into messagi values(0,'$id','$dbid','$messaga');");
mysql_query("update users set voodoo='1' where id='".$dbid."';");
$mafcredits=$mafcredits-50000;
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
print $who." ".$lang['voo_died']."<br/>";
/*}*/
}
}
else
{
print $lang['voo_no_mafcredits'];
}
}

print "&gt;<a href=\"voodoo.php?pass=$pass&amp;id=$id\">".$lang['sl_kol_voodoo']."</a><br/>";
break;
case "health":
if(empty($who) || empty($which))
{
print $lang['voo_mes2'];
///наслать порчу Логин и здоровье/////
echo "<form method=\"post\" action=\"voodoo.php?id=$id&amp;pass=$pass&amp;mode=health\">";
echo "Логин жертвы:<br/>";
echo "<input type=\"text\" name=\"who\" maxlength=\"15\"/><br/>";
echo "Сколько снять здоровья?:<br/>";
echo "<input type=\"text\" name=\"which\" maxlength=\"20\" size=\"15\"/><br/>";
echo "<input value=\"Колдуем\" type=\"submit\"/>";
echo "</form>";

}
else
{
$who=cyr(htmlspecialchars(stripslashes(trim($who))));
$which=cyr(htmlspecialchars(stripslashes(trim($which))));
if($which<150 && $mafcredits>($which*20))
{
$db=mysql_fetch_array(mysql_query("select id,pass,health from users where login='".$who."';"));
$dbid=$db['id'];
$dbpass=$db['pass'];
$dbhealth=$db['health'];
if(empty($dbid))
{
print $lang['voo_sel_us_err']."<br/>";
}
else
{
$dbhealth=$dbhealth-$which;
$mafcredits=$mafcredits-($which*20);
if($dbhealth<=10) die($lang['voo_health_err']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
$messaga="<b>".$lang['sl_kol_voodoo']."</b><br/>".$login." ".$lang['voo_heal_mes1']." ".$which." ".$lang['voo_heal_mes2']."<br/>[<a href=\"./../mes.php?pass=$dbpass&amp;id=$dbid&amp;dbid=$id&amp;mode=del\">".$lang['ok']."</a>]";
mysql_query("insert into messagi values(0,'$id','$dbid','$messaga');");
mysql_query("update users set mafcredits='".$mafcredits."' where id='".$id."';");
mysql_query("update users set health='".$dbhealth."' where id='".$dbid."';");
print $lang['voo_succes']."<br/>";

}
}
else
{
print $lang['voo_no_mafcredits'];
}
}
print "&gt;<a href=\"voodoo.php?pass=$pass&amp;id=$id\">".$lang['sl_kol_voodoo']."</a><br/>";
break;

case "porcha":

if($mafcredits<1000) 
{
/*
mysql_query("delete from messagi where kto='".$dbid."' and komu='".$id."' limit 1;");
*/
die($lang['voo_no_mafcredits']."<br/><anchor>".$lang['back']."<prev/></anchor></small></p></card></wml>");
}
else
{
$mafcredits=$mafcredits-1000;
mysql_query("update users set voodoo='',mafcredits='".$mafcredits."' where id='".$id."'");
print $lang['voo_pr_sn']."<br/>";
}

break;
default:
print $lang['voo_mes3'];
print "<a href=\"voodoo.php?id=$id&amp;pass=$pass&amp;mode=kill\">".$lang['voo_kill']."</a><br/>";
print "<a href=\"voodoo.php?id=$id&amp;pass=$pass&amp;mode=health\">".$lang['voo_minus_he']."</a><br/>";
if(!empty($voo_por)) print "<a href=\"voodoo.php?pass=$pass&amp;id=$id&amp;mode=porcha\">".$lang['voo_otk_por']."</a><br/>";
break;
}




print "---<br/>&gt;<a href=\"index.php?id=$id&amp;pass=$pass\">".$lang['in_city']."</a>";
print "<br/>&gt;&gt;<a href=\"./../game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
print "<br/>---";
echo "<br/><a href=\"../enter.php?id={$id}&amp;pass={$pass}&amp;ref={$ref}\">Прихожка</a><br/>";
mysql_close();
include "./../includes/footer.php";
?>