2022-06-06 21:30:34 +00:00
< ?
if ( ! defined ( 'GAME' ))
{
die ();
}
if ( $p [ 'marry' ] == 1 )
{
$uu = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string ( $_POST [ 'logingo' ]) . '" LIMIT 1' ));
$uu2 = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `users` WHERE `id` = "' . mysql_real_escape_string ( $uu [ 'marry' ]) . '" LIMIT 1' ));
if ( isset ( $uu [ 'id' ]) && isset ( $uu2 [ 'id' ]))
{
if ( $uu [ 'marry' ] == 0 )
{
2023-01-10 16:29:32 +00:00
$uer = 'Персонаж не находится в браке<br>' ;
2022-06-06 21:30:34 +00:00
} elseif ( $uu2 [ 'marry' ] == 0 )
{
2023-01-10 16:29:32 +00:00
$uer = 'Персонаж не находится в браке<br>' ;
2022-06-06 21:30:34 +00:00
} elseif ( $uu [ 'admin' ] > 0 && $u -> info [ 'admin' ] == 0 )
{
2023-01-10 16:29:32 +00:00
$uer = 'Вы не можете накладывать заклятие на Ангелов' ;
2022-06-06 21:30:34 +00:00
} elseif ( $uu [ 'city' ] != $u -> info [ 'city' ] && $p [ 'citym1' ] == 0 ){
2023-01-10 16:29:32 +00:00
$uer = 'Персонаж находится в другом городе' ;
2022-06-06 21:30:34 +00:00
} elseif ( $uu [ 'id' ] == $u -> info [ 'id' ] && $u -> info [ 'admin' ] == 0 ){
2023-01-10 16:29:32 +00:00
$uer = 'Вы не можете использовать на самого себя' ;
2022-06-06 21:30:34 +00:00
} elseif ( $uu2 [ 'admin' ] > 0 && $u -> info [ 'admin' ] == 0 )
{
2023-01-10 16:29:32 +00:00
$uer = 'Вы не можете накладывать заклятие на Ангелов' ;
2022-06-06 21:30:34 +00:00
} elseif ( $uu2 [ 'city' ] != $u -> info [ 'city' ] && $p [ 'citym1' ] == 0 ){
2023-01-10 16:29:32 +00:00
$uer = 'Персонаж находится в другом городе' ;
2022-06-06 21:30:34 +00:00
} elseif ( $uu2 [ 'id' ] == $u -> info [ 'id' ] && $u -> info [ 'admin' ] == 0 ){
2023-01-10 16:29:32 +00:00
$uer = 'Вы не можете использовать на самого себя' ;
2022-06-06 21:30:34 +00:00
} else {
$uu [ 'palpro' ] = time () + 60 * 60 * 24 * 7 ;
$upd = mysql_query ( 'UPDATE `users` SET `marry` = "0" WHERE `id` = "' . $uu [ 'id' ] . '" LIMIT 1' );
$upd = mysql_query ( 'UPDATE `users` SET `marry` = "0" WHERE `id` = "' . $uu2 [ 'id' ] . '" LIMIT 1' );
if ( $upd )
{
$sx = '' ;
if ( $u -> info [ 'sex' ] == 1 )
{
2023-01-10 16:29:32 +00:00
$sx = 'а ' ;
2022-06-06 21:30:34 +00:00
}
2023-01-10 16:29:32 +00:00
$rtxt = '[img[items/unmarry.gif]] ' . $rang . ' "' . $u -> info [ 'cast_login' ] . '" расторгнул' . $sx . ' законность брака между "' . $uu [ 'login' ] . '" и "' . $uu2 [ 'login' ] . '".' ;
2022-06-06 21:30:34 +00:00
mysql_query ( " UPDATE `chat` SET `delete` = 1 WHERE `login` = ' " . $uu [ 'login' ] . " ' LIMIT 1000 " );
2023-01-28 02:24:37 +00:00
$cmsg = new ChatMessage ();
$cmsg -> setCity ( $u -> info [ 'city' ]);
$cmsg -> setRoom ( $u -> info [ 'room' ]);
$cmsg -> setText ( $rtxt );
$cmsg -> setType ( 6 );
$cmsg -> setTypeTime ( 1 );
( new Chat ()) -> sendMsg ( $cmsg );
2023-01-10 16:29:32 +00:00
$rtxt = $rang . ' "' . $u -> info [ 'login' ] . '" расторгнул' . $sx . ' законность брака с ' . $uu2 [ 'id' ] . '.' ;
2022-06-06 21:30:34 +00:00
mysql_query ( " INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES (' " . $uu [ 'id' ] . " ',' " . $_SERVER [ 'REMOTE_ADDR' ] . " ',' " . $u -> info [ 'city' ] . " ',' " . time () . " ',' " . $rtxt . " ',' " . $u -> info [ 'login' ] . " ',0) " );
2023-01-10 16:29:32 +00:00
$rtxt = $rang . ' "' . $u -> info [ 'login' ] . '" расторгнул' . $sx . ' законность брака с ' . $uu [ 'id' ] . '.' ;
2022-06-06 21:30:34 +00:00
mysql_query ( " INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES (' " . $uu2 [ 'id' ] . " ',' " . $_SERVER [ 'REMOTE_ADDR' ] . " ',' " . $u -> info [ 'city' ] . " ',' " . time () . " ',' " . $rtxt . " ',' " . $u -> info [ 'login' ] . " ',0) " );
$u -> addItem ( 76 , $uu [ 'id' ], 'sudba=' . $uu [ 'login' ] . '|noremont=1|notransfer=1' );
$u -> addItem ( 76 , $uu2 [ 'id' ], 'sudba=' . $uu2 [ 'login' ] . '|noremont=1|notransfer=1' );
mysql_query ( 'UPDATE `items_users` SET `delete` = "' . time () . '" WHERE `item_id` = 76 AND (`uid` = "' . $uu [ 'id' ] . '" OR `uid` = "' . $uu2 [ 'id' ] . '")' );
2023-01-10 16:29:32 +00:00
$uer = 'Вы успешно расторгли брак "' . $uu [ 'login' ] . '" и "' . $uu2 [ 'login' ] . '".' ;
2022-06-06 21:30:34 +00:00
} else {
2023-01-10 16:29:32 +00:00
$uer = 'Н е удалось использовать данное заклятие' ;
2022-06-06 21:30:34 +00:00
}
}
} else {
2023-01-10 16:29:32 +00:00
$uer = 'Персонаж не найден в этом городе' ;
2022-06-06 21:30:34 +00:00
}
} else {
2023-01-10 16:29:32 +00:00
$uer = 'У В а с нет прав на использование данного заклятия' ;
2022-06-06 21:30:34 +00:00
}
?>