This commit is contained in:
lopar
2018-03-03 01:49:16 +02:00
parent ef4c72554e
commit b995ad7117
3 changed files with 16 additions and 1435 deletions

View File

@@ -7,21 +7,24 @@
class nick
{
private $id;
private $invis;
private $user_data;
public function __construct($playerId, $showInvisibility = 1) {
if (!$this->user_data) {
$user = db::c()->query('SELECT `login`, `level`, `hp`, `align`, `klan`, `hp`, `maxhp` FROM `users` WHERE `id` = ?i',$playerId)->fetch_assoc();
$this->user_data = $user;
}
function __construct($playerId, $showInvisibility = 1) {
$this->id = $playerId;
$this->invis = $showInvisibility;
}
public function login(){
$user = db::c()->query('SELECT `login`, `level`, `hp`, `align`, `klan`, `hp`, `maxhp` FROM `users` WHERE `id` = ?i',$this->id)->fetch_assoc();
if ($this->invis){
// db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = ?i', $id, 1022)->fetch_assoc();
$user['login'] = 'невидимка';
$user['level'] = 100;
}
return $user;
// if ($this->invis){
// // db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = ?i', $id, 1022)->fetch_assoc();
// $user['login'] = 'невидимка';
// $user['level'] = 100;
// }
return $this->user_data;
}
}