2023-03-31 18:42:06 +00:00
|
|
|
|
<?php
|
2023-11-02 13:57:39 +00:00
|
|
|
|
|
|
|
|
|
use Core\Db;
|
|
|
|
|
|
|
|
|
|
if (!defined('GAME')) {
|
|
|
|
|
die();
|
2022-06-06 21:30:34 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
/** @var User $u */
|
|
|
|
|
|
|
|
|
|
$caster = $u;
|
|
|
|
|
$targetUser = $_POST['logingo'];
|
|
|
|
|
$targetRoom = null; // Заглушка
|
|
|
|
|
|
|
|
|
|
echo 'Не работает. Проверь исполняемый файл.';
|
|
|
|
|
|
|
|
|
|
$target = $targetUser === $caster->info['login'] ? $caster->info : User::getInfo($targetUser);
|
|
|
|
|
|
|
|
|
|
if (empty($target) || $target['admin'] > 0 && !$caster->isAdmin()) {
|
|
|
|
|
$uer = 'Цель не найдена!';
|
|
|
|
|
} elseif ($caster->info['id'] != $target['id'] && !$caster->isAdmin()) {
|
|
|
|
|
$uer = 'Нельзя телепортировать других!';
|
|
|
|
|
} elseif (!empty($target['battle']) || !empty($caster->info['battle'])) {
|
|
|
|
|
$uer = 'Не работает в поединке!';
|
|
|
|
|
} else {
|
|
|
|
|
Db::sql('update users set room = ? where login = ?', [$targetRoom, $target['id']]);
|
|
|
|
|
Delo::add(5, 'teleport', $target['login'], "{$caster->info['login']} телепортировал игрока в $targetRoom.");
|
|
|
|
|
$uer = 'Успешная телепортация!';
|
|
|
|
|
}
|
2023-01-28 02:24:37 +00:00
|
|
|
|
|
2023-11-02 13:57:39 +00:00
|
|
|
|
unset($caster, $target, $targetUser, $targetRoom);
|