Просмотр файла release_fix#2/mods/game/win.php

Размер файла: 3.19Kb
<?php
session_start();
$mod_title="игра-вы выиграли";
$mod_status="on";
if($mod_status=="on")
{
function mod_body($auth,$adminauth)
{
$level="";
$guildc="";
$arenac="";
if($auth=="ok")
{
$mcl="";
$mexp="";
$money="";
$query = "SELECT * FROM users WHERE login='$_COOKIE[login]'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$pass,$mail,$reg,$class,$m,$h,$z,$s,$mon,$gold,$pms,$lvl,$ava,$ban,$online,$exp) = mysql_fetch_row($cat))
{
$mcl=$class;
$level=$lvl;
$money=$mon;
$mexp=$exp;
}
$query = "SELECT * FROM count";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$guild,$arena) = mysql_fetch_row($cat))
{
$guildc=$guild;
$arenac=$arena;
}
echo "
<img src='img/bo.png'> <a href='?do=game/char'>персонаж($level)</a>|<img src='img/bs.png'> <a href='?do=game/history'>история</a><br>
<br>
";
$_pg="0";
$ag="-10";
$_pg2="10";
if(!empty($_GET['_pg']))
{
$ag=$_GET['_pg']-"10";
$_pg=$_GET['_pg'];
$_pg2=$_GET['_pg']+"10";
}
$mob_name="";
$cvb1="";
$cvb2="";
$query = "SELECT * FROM battle WHERE login='$_COOKIE[login]'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($login,$nowh,$name,$s,$m,$h) = mysql_fetch_row($cat))
{
$mob_name=$name;
$cvb1=$nowh;
$cvb2=$h;
}
if($cvb2>0)
{
echo "HACKER?!<br>";
}
else
{
$mob_s="";
$mob_m="";
$mob_h="";
$expm1="";
$mm1="";
$drp="";
$query = "SELECT * FROM mobs WHERE name='$mob_name'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$name,$inst,$lvl,$s,$m,$h,$expp,$expm,$mp,$mm,$drop) = mysql_fetch_row($cat))
{
$mob_name=$name;
$mob_s=$s;
$mob_m=$m;
$mob_h=$h;
$expm1=$expp;
$mm1=$mp;
$drp=$drop;
}
$mm11=$money+$mm1;
$expm11=$mexp+$expm1;
if($expm11>0)
{
}
else
{
$expm11="0";
}
$query="UPDATE users SET mon='$mm11',exp='$expm11' WHERE login='".$_COOKIE[login]."'";
$result=mysql_query($query)
or die("<span style='color:red'>ошибка обновления пользователя!</span><br>");
echo "<span style='color:green'>вы выиграли! +$mm1 серебра,+$expm1 exp.</span><br>";
include "data/level.php";
$query="DELETE FROM battle WHERE login='".$_COOKIE[login]."'";
$result=mysql_query($query)
or die("ошибка очистки!");
$query="DELETE FROM battlelog WHERE login='".$_COOKIE[login]."'";
$result=mysql_query($query)
or die("ошибка очистки #2!");
$ab=split (",", $drp, 5);
$randx=rand($ab[0],$ab[1]);
$name_code="";
$query = "SELECT * FROM drop2 WHERE id='$randx'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$name) = mysql_fetch_row($cat))
{
$name_code=$name;
}
if($name_code=="")
{
}
else
{
$query = "INSERT INTO items (login,name) VALUES ('$_COOKIE[login]','$name_code')";
$result = mysql_query ($query)
or die ("<span style='color:red'>ошибка drop-а!</span>");
echo "вы получили предмет $name_code!<br>";
}
}
include "data/buttons.auth.php";
}
else
{
echo "
Ошибка авторизации!<br>
";
}
}
}
else
{
function mod_body($auth,$adminauth)
{
echo "мод выключен администратором!<br>";
}
}
?>