battles/cave/lose.php

22 lines
799 B
PHP
Raw Normal View History

2018-01-28 16:40:49 +00:00
<?
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');
}
}
}