battles/classes/nick.php
2018-03-01 18:56:17 +02:00

30 lines
903 B
PHP

<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
class nick
{
private $id;
private $invis;
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){
$user['login'] = 'невидимка';
$user['level'] = 100;
}
return $user;
}
//$user = db::c()->query('SELECT `login`, `level`, `hp`, `align`, `klan`, `hp`, `maxhp` FROM `users` WHERE `id` = ?i',$id)->fetch_assoc();
//$invisible = db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = ?i', $id, 1022)->fetch_assoc();
}