id = $id; $this->level = Db::getValue('select level from users where id = ? and level between 8 and 12 and battle = 0', [$id]); } /** * проверка уровня, стоимости эквипа, прочие проверки, что персонаж свободен * таймер ожидания 30 минут * * @return int */ public function getLevel() { return $this->level; } /** * @param int $price * @return bool */ public function isEkrOverpriced($price) { $wearedItemsEkrPrice = Db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$this->id]); return $wearedItemsEkrPrice > $price; } /** * @param int $minExp * @return bool */ public function isEnoughExperience($minExp) { return Db::getValue('select exp from stats where id = ?', [$this->id]) >= $minExp; } /** * @return bool */ public function IsRestrictedToJoin() { $delayEffect = Db::getValue( 'select count(*) from eff_users where uid = ? and id_eff = 486 and `delete` = 0', [$this->id] ); return (bool)$delayEffect; } }