2023-03-31 18:42:06 +00:00
< ? php
2022-06-06 21:30:34 +00:00
if ( ! defined ( 'GAME' ))
{
die ();
}
if ( $itm [ 'magic_inci' ] == 'arhmoney' ) {
if ( $u -> info [ 'inTurnir' ] == 0 ) {
2023-01-10 16:29:32 +00:00
$u -> error = 'Необходимо участвовать в турнире Башни Смерти' ;
2022-06-06 21:30:34 +00:00
} else {
$noarh = true ;
$bsd = mysql_fetch_array ( mysql_query ( 'SELECT `id`,`users`,`arhiv`,`count`,`city`,`money` FROM `bs_turnirs` WHERE `id` = "' . $u -> info [ 'inTurnir' ] . '" LIMIT 1' ));
if ( isset ( $bsd [ 'id' ]) ) {
2023-01-10 16:29:32 +00:00
$bsd_arh = mysql_fetch_array ( mysql_query ( 'SELECT `u`.`id`,`u`.`battle`,`s`.`x`,`s`.`y` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`inTurnir` = "' . $u -> info [ 'inTurnir' ] . '" AND `u`.`login` = "Архивариус" AND `u`.`pass` = "bstowerbot" LIMIT 1' ));
2022-06-06 21:30:34 +00:00
if ( $bsd [ 'users' ] > 1 && $noarh == false && true == false ) {
2023-01-10 16:29:32 +00:00
$u -> error = 'Вы должны остаться единственным участником Башни Смерти' ;
2022-06-06 21:30:34 +00:00
} else {
if ( $u -> info [ 'inUser' ] == 0 ) {
$usr_tk = mysql_fetch_array ( mysql_query ( 'SELECT `level`,`id`,`money`,`login`,`align`,`clan`,`sex` FROM `users` WHERE `inUser` = "' . $u -> info [ 'id' ] . '" LIMIT 1' ));
if ( isset ( $usr_tk [ 'id' ]) ) {
if ( $itm [ 'price2' ] == 0 ) {
2023-07-11 15:16:35 +00:00
$u -> addKr ( $itm [ 'price1' ]);
2022-06-06 21:30:34 +00:00
} else {
2023-07-11 15:16:35 +00:00
$u -> addEkr ( $itm [ 'price2' ], $usr_tk [ 'id' ]);
2022-06-06 21:30:34 +00:00
}
mysql_query ( 'UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = ' . $itm [ 'id' ] . ' LIMIT 1' );
if ( $itm [ 'price2' ] == 0 ) {
2023-01-10 16:29:32 +00:00
$u -> error = 'Вы успешно обналичил чек на ' . $itm [ 'price1' ] . ' кр.' ;
2022-06-06 21:30:34 +00:00
} else {
2023-07-11 15:16:35 +00:00
$u -> error = 'Вы успешно обналичил чек на ' . $itm [ 'price2' ] . ' екр.' ;
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
//Добавляем в лог БС
2022-06-06 21:30:34 +00:00
if ( $itm [ 'price2' ] == 0 ) {
if ( $u -> info [ 'sex' ] == 0 ) {
2023-01-10 16:29:32 +00:00
$text = '{u1} обналичил чек на <b>' . $itm [ 'price1' ] . ' кр.</b>' ;
2022-06-06 21:30:34 +00:00
} else {
2023-01-10 16:29:32 +00:00
$text = '{u1} обналичила чек на <b>' . $itm [ 'price1' ] . ' кр.</b>' ;
2022-06-06 21:30:34 +00:00
}
} else {
if ( $u -> info [ 'sex' ] == 0 ) {
2023-01-10 16:29:32 +00:00
$text = '{u1} обналичил чек на <b>' . $itm [ 'price2' ] . ' екр.</b>' ;
2022-06-06 21:30:34 +00:00
} else {
2023-01-10 16:29:32 +00:00
$text = '{u1} обналичила чек на <b>' . $itm [ 'price2' ] . ' екр.</b>' ;
2022-06-06 21:30:34 +00:00
}
}
if ( isset ( $usr_tk [ 'id' ]) ) {
$mereal = '' ;
if ( $usr_tk [ 'align' ] > 0 ) {
2023-03-31 18:30:14 +00:00
$mereal .= '<img src=//img.new-combats.tech/i/align/align' . $usr_tk [ 'align' ] . '.gif width=12 height=15 >' ;
2022-06-06 21:30:34 +00:00
}
if ( $usr_tk [ 'clan' ] > 0 ) {
2023-03-31 18:30:14 +00:00
$mereal .= '<img src=//img.new-combats.tech/i/clan/' . $usr_tk [ 'clan' ] . '.gif width=24 height=15 >' ;
2022-06-06 21:30:34 +00:00
}
2023-03-31 18:30:14 +00:00
$mereal .= '<b>' . $usr_tk [ 'login' ] . '</b> [' . $usr_tk [ 'level' ] . ']<a target=_blank href=/info/' . $usr_tk [ 'id' ] . ' ><img width=12 hiehgt=11 src=//img.new-combats.tech/i/inf_capitalcity.gif ></a>' ;
2022-06-06 21:30:34 +00:00
} else {
2023-01-10 16:29:32 +00:00
$mereal = '<i>Невидимка</i>[??]' ;
2022-06-06 21:30:34 +00:00
}
$text = str_replace ( '{u1}' , $mereal , $text );
2023-01-10 16:29:32 +00:00
//Добавляем в лог БС
2022-06-06 21:30:34 +00:00
mysql_query ( ' INSERT INTO `bs_logs` ( `type` , `text` , `time` , `id_bs` , `count_bs` , `city` , `m` , `u` ) VALUES (
" 1 " , " '.mysql_real_escape_string( $text ).' " , " '.time().' " , " '. $bsd['id'] .' " , " '. $bsd['count'] .' " , " '. $bsd['city'] .' " ,
" '.round( $bsd['money'] *0.85,2).' " , " '. $i .' "
) ' );
//
} else {
2023-01-10 16:29:32 +00:00
$u -> error = 'Что-то здесь не так...' ;
2022-06-06 21:30:34 +00:00
}
} else {
2023-01-10 16:29:32 +00:00
$u -> error = 'Вы должны участвовать в турнире Башни Смерти' ;
2022-06-06 21:30:34 +00:00
}
}
} else {
2023-01-10 16:29:32 +00:00
$u -> error = 'Необходимо участвовать в турнире Башни Смерти' ;
2022-06-06 21:30:34 +00:00
}
}
}
?>