battles/classes/cave/lose.php
2019-01-16 19:45:30 +02:00

23 lines
818 B
PHP

<?
if(in_array($user['room'], $caverooms)) {
include_once("cavedata.php");
$floor = mysql_fetch_row(mysql_query("SELECT `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
if(!isset($cavedata[$user['room']]['x'.$floor])) {
$floor = 1;
}
}
$lomka1 = $lomka;
foreach($lomka1 as $k => $v) {
if($v < _BOTSEPARATOR_) {
if(in_array($user['room'], $caverooms)) {
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '".$cavedata[$user['room']]['x'.$floor]."', `y` = '".$cavedata[$user['room']]['y'.$floor]."', `dir` = '".$cavedata[$user['room']]['dir'.$floor]."', `loses` = (`loses`+1) WHERE `user` = '$v' LIMIT 1");
}
if($user['laba'] > 0) {
mysql_query('UPDATE `users` SET `x` = `xf`, `y` = `yr` WHERE `id` = "'.$v.'" LIMIT 1');
die('Suka');
}
}
}