2022-06-06 21:30:34 +00:00
|
|
|
|
<?
|
|
|
|
|
if(!defined('GAME'))
|
|
|
|
|
{
|
|
|
|
|
die();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$cgo = $_POST['city'];
|
|
|
|
|
if(!isset($u->city_name[$cgo]))
|
|
|
|
|
{
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$uer = 'Город "'.$cgo.'" не найден.';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}else{
|
|
|
|
|
$uu = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['logingo']).'" LIMIT 1'));
|
|
|
|
|
if(isset($uu['id']))
|
|
|
|
|
{
|
|
|
|
|
if($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($uu['battle']>0)
|
|
|
|
|
{
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$uer = 'Персонаж находится в бою';
|
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'] && $u->info['admin']==0){
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$uer = 'Персонаж находится в другом городе';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}elseif(floor($uu['align'])==$a && $uu['align']>$u->info['align'] && $u->info['admin']==0)
|
|
|
|
|
{
|
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
|
|
|
|
$rid = mysql_fetch_array(mysql_query('SELECT * FROM `room` WHERE `name` = "Вокзал" AND `city` = "'.mysql_real_escape_string($cgo).'" LIMIT 1'));
|
2022-06-06 21:30:34 +00:00
|
|
|
|
if(!isset($rid['id']))
|
|
|
|
|
{
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$uer = 'Телепортация в "'.$u->city_name[$cgo].'" запрещена!';
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}else{
|
|
|
|
|
$upd = mysql_query('UPDATE `users` SET `city` = "'.mysql_real_escape_string($cgo).'",`room` = "'.$rid['id'].'" WHERE `id` = "'.$uu['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/teleport.gif]] '.$rang.' "'.$u->info['cast_login'].'" телепортировал'.$sx.' персонажа "'.$uu['login'].'" в [img[city_ico/'.$cgo.'.gif]] '.$u->city_name[$cgo].'.';
|
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.' в "<b>'.$u->city_name[$cgo].'</b>".';
|
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']."',5)");
|
2023-01-10 16:29:32 +00:00
|
|
|
|
$uer = 'Вы успешно телепортировали персонажа "'.$uu['login'].'" в <b>'.$u->city_name[$cgo].'</b>.';
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|